body {
  font-family: Arial, sans-serif;
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}
.container.search-active {
  justify-content: flex-start;
  padding-top: 2rem;
}
h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}
h1:hover {
  color: #0078d4;
}
.container.search-active h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.search-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 420px;
  max-width: 90vw;
  transition: all 0.5s ease-in-out;
}
.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
input[type="text"] {
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  flex: 1;
  box-sizing: border-box;
}
button {
  padding: 10px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  background-color: #0078d4;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
button:hover {
  background-color: #005fa3;
}

/* Search results styles */
.search-results {
  display: none;
  width: 100%;
  margin-top: 2rem;
  box-sizing: border-box;
}

.search-result {
  cursor: pointer;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 8px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.search-result:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.search-result h3 {
  margin-top: 0;
  margin-bottom: 8px;
  color: #0078d4;
}

.search-result-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.9rem;
}

.search-result-details > div {
  margin: 4px 0;
  flex: 1 0 45%;
}

.search-result-details > div > .label {
  font-weight: bold;
  color: #555;
}

@media (max-width: 768px) {
  .search-result-details {
    flex-direction: column;
  }
}

footer {
  text-align: center;
  padding: 16px 0;
  background: #f5f5f5;
  font-size: 1rem;
  color: #555;
}

#loading-spinner {
  display: none;
  width: 50px;
  height: 50px;
  border: 5px solid rgba(0, 120, 212, 0.2);
  border-radius: 50%;
  border-top-color: #0078d4;
  animation: spin 1s ease-in-out infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin-top: 1rem;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Certificate details styles */
#certificate-details {
  display: none;
  width: 100%;
  margin-top: 2rem;
  box-sizing: border-box;
  animation: fadeIn 0.3s ease-out;
}

.back-button {
  margin-bottom: 16px;
}

.certificate-info {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 12px;
}

.certificate-detail-row {
  margin: 8px 0;
  line-height: 1.5;
}

.certificate-detail-label {
  font-weight: bold;
  color: #555;
  margin-right: 8px;
}

.certificate-pem {
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-all;
}
