/*
 * O.Translator Tools - Base Styles (Media-Query Aware)
 * ---------------------------------------------------------
 */

/* 1. Global Styles (Light Theme Default) */
body {
  background-color: #f9fafb; /* gray-50 */
  font-family: "Inter", sans-serif;
  color: #1f2937; /* gray-800 */
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 2. Content Section Components (Light Theme) */
.content-section {
  max-width: 64rem;
  margin: 4rem auto 0;
  background-color: #ffffff;
  border: 1px solid #e5e7eb; /* gray-200 */
  border-radius: 1rem;
  padding: 2.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #111827; /* gray-900 */
  text-align: center;
  margin-bottom: 3rem;
}

.feature-card {
  background-color: #f9fafb; /* gray-50 */
  border: 1px solid #e5e7eb; /* gray-200 */
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.1);
  border-color: #3b82f6; /* blue-500 */
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 4rem;
  width: 4rem;
  border-radius: 9999px;
  background-color: #dbeafe; /* blue-100 */
  color: #1e40af; /* blue-800 */
  margin: 0 auto 1.5rem;
  font-weight: 700;
  font-size: 1.5rem;
  border: 2px solid #60a5fa; /* blue-400 */
}
.feature-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937; /* gray-800 */
  margin-bottom: 0.5rem;
}
.feature-description {
  font-size: 0.875rem;
  color: #4b5563; /* gray-600 */
}

.feature-highlight-card {
  display: flex;
  align-items: flex-start;
  padding: 1rem;
  background-color: transparent;
  border-radius: 0.75rem;
}
.feature-highlight-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 3rem;
  width: 3rem;
  border-radius: 9999px;
  background-color: #dcfce7; /* green-100 */
  color: #166534; /* green-800 */
  border: 1px solid #4ade80; /* green-400 */
}
.feature-highlight-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827; /* gray-900 */
}
.feature-highlight-description {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: #374151; /* gray-700 */
}

.faq-item details {
  background-color: #f9fafb; /* gray-50 */
  border: 1px solid #e5e7eb; /* gray-200 */
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}
.faq-question {
  padding: 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style-type: none;
  display: flex;
  justify-content: space-between;
  color: #1f2937; /* gray-800 */
}
.faq-answer {
  padding: 0 1rem 1rem 1rem;
  border-top: 1px solid #e5e7eb; /* gray-200 */
  color: #4b5563; /* gray-600 */
}
details[open] .faq-answer {
  padding-top: 1rem;
}

.link-card {
  background-color: #f9fafb; /* gray-50 */
  border: 1px solid #e5e7eb; /* gray-200 */
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.link-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.1);
  border-color: #3b82f6; /* blue-500 */
}
.link-card-title {
  font-weight: 700;
  color: #2563eb; /* blue-600 */
  transition: color 0.2s;
}
.link-card:hover .link-card-title {
  color: #1d4ed8; /* blue-700 */
}
.link-card-description {
  font-size: 0.875rem;
  color: #4b5563; /* gray-600 */
  margin-top: 0.5rem;
}

/*
 * Dark Theme Overrides
 * -----------------------------------------
 */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #0d1117;
    color: #c9d1d9;
  }
  .content-section {
    background: linear-gradient(145deg, rgba(22, 27, 34, 0.6), rgba(13, 17, 23, 0.4));
    border-color: #30363d;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  }
  .section-title {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
  }
  .feature-card {
    background-color: rgba(34, 41, 51, 0.5);
    border-color: #30363d;
  }
  .feature-card:hover {
    box-shadow: 0 8px 25px rgba(48, 168, 255, 0.15);
    border-color: #30a8ff;
  }
  .feature-icon {
    background-color: rgba(30, 58, 138, 0.5);
    color: #93c5fd;
    border-color: #1d4ed8;
  }
  .feature-title {
    color: #ffffff;
  }
  .feature-description {
    color: #9ca3af;
  }
  .feature-highlight-card {
    background-color: transparent;
  }
  .feature-highlight-icon {
    background-color: rgba(20, 83, 45, 0.5);
    color: #4ade80;
    border-color: #15803d;
  }
  .feature-highlight-title {
    color: #ffffff;
  }
  .feature-highlight-description {
    color: #9ca3af;
  }
  .faq-item details {
    background-color: rgba(34, 41, 51, 0.5);
    border-color: #30363d;
  }
  .faq-question {
    color: #ffffff;
  }
  .faq-answer {
    border-color: #374151;
    color: #9ca3af;
  }
  .link-card {
    background-color: rgba(34, 41, 51, 0.5);
    border-color: #30363d;
  }
  .link-card:hover {
    box-shadow: 0 8px 25px rgba(48, 168, 255, 0.15);
    border-color: #30a8ff;
  }
  .link-card-title {
    color: #60a5fa;
  }
  .link-card:hover .link-card-title {
    color: #93c5fd;
  }
  .link-card-description {
    color: #9ca3af;
  }
}

/*
 * Tool-Specific Styles
 * -----------------------------------------
 */

/* Light Theme Tool Styles */
.loader {
  border: 4px solid #e5e7eb; /* gray-200 */
  border-radius: 50%;
  border-top: 4px solid #3b82f6; /* blue-500 */
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.font-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease-in-out;
}
.font-item:nth-child(even) {
  background-color: #f9fafb; /* gray-50 */
}
.font-item-details {
  flex-grow: 1;
  min-width: 0;
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
}
.font-item-details:hover {
  background-color: #eff6ff; /* blue-50 */
}
.font-item-name {
  font-weight: 600;
  color: #1f2937; /* gray-800 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.font-item-meta {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: #6b7280; /* gray-500 */
  margin-top: 0.25rem;
  flex-wrap: wrap;
}
.font-item-meta .separator {
  margin: 0 0.5rem;
  color: #d1d5db; /* gray-300 */
}
.font-item-meta .page-info svg {
  height: 1rem;
  width: 1rem;
  margin-right: 0.25rem;
  color: #9ca3af; /* gray-400 */
}

/* Modal styling */
.modal-tab {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom-width: 2px;
  border-color: transparent;
  color: #6b7280; /* gray-500 */
}
.modal-tab:hover {
  color: #374151; /* gray-700 */
  border-color: #d1d5db; /* gray-300 */
}
.modal-tab.active {
  border-color: #3b82f6; /* blue-500 */
  color: #3b82f6; /* blue-500 */
  font-weight: 600;
}
.modal-pagination-button {
  background-color: #f3f4f6; /* gray-100 */
  border: 1px solid #d1d5db; /* gray-300 */
  color: #374151; /* gray-700 */
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
}
.modal-pagination-button:hover {
  background-color: #e5e7eb; /* gray-200 */
}
.modal-pagination-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.modal-page-info {
  color: #4b5563; /* gray-600 */
}
.char-map-item {
  background-color: #f9fafb; /* gray-50 */
  border: 1px solid #e5e7eb; /* gray-200 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: 0.25rem;
  aspect-ratio: 1 / 1;
}
.char-map-item .char-code,
.char-map-item .hex-code {
  color: #6b7280; /* gray-500 */
  font-size: 0.75rem;
  margin-top: 0.25rem;
}
.font-info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem 0;
  border-bottom: 1px solid #f3f4f6; /* gray-100 */
}
.font-info-row:last-child {
  border-bottom: none;
}
.font-info-label {
  color: #4b5563; /* gray-600 */
  font-weight: 500;
  padding-right: 0.5rem;
}
.font-info-value {
  color: #1f2937; /* gray-800 */
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dark Theme Tool Overrides */
@media (prefers-color-scheme: dark) {
  .loader {
    border-color: #30363d;
    border-top-color: #30a8ff;
  }
  .font-item:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
  }
  .font-item-details:hover {
    background-color: rgba(59, 130, 246, 0.1);
  }
  .font-item-name {
    color: #e5e7eb;
  }
  .font-item-meta {
    color: #9ca3af;
  }
  .font-item-meta .separator {
    color: #4b5563;
  }
  .font-item-meta .page-info svg {
    color: #6b7280;
  }
  .modal-tab {
    color: #9ca3af;
  }
  .modal-tab:hover {
    color: #d1d5db;
    border-color: #4b5563;
  }
  .modal-tab.active {
    border-color: #30a8ff;
    color: #30a8ff;
  }
  .modal-pagination-button {
    background-color: #374151;
    border-color: #4b5563;
    color: #d1d5db;
  }
  .modal-pagination-button:hover {
    background-color: #4b5563;
  }
  .modal-page-info {
    color: #d1d5db;
  }
  .char-map-item {
    background-color: #374151;
    border-color: #4b5563;
  }
  .char-map-item .char-code,
  .char-map-item .hex-code {
    color: #d1d5db;
  }
  .font-info-row {
    border-color: #374151;
  }
  .font-info-label {
    color: #9ca3af;
  }
  .font-info-value {
    color: #e5e7eb;
  }
}