/*
 * O.Convertor Tools - Base Styles (V13 Theme-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;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

.content-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #60a5fa, transparent); /* light blue */
  animation: beam-animation 5s linear infinite;
}

@keyframes beam-animation {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.section-title {
  font-size: 2.25rem;
  line-height: 2.5rem;
  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(147, 197, 253, 0.2);
  border-color: #93c5fd; /* blue-300 */
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 4rem;
  width: 4rem;
  border-radius: 9999px;
  background-color: #dbeafe; /* blue-100 */
  color: #2563eb; /* blue-600 */
  margin: 0 auto 1.5rem;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 2rem;
  border-width: 2px;
  border-color: #93c5fd; /* blue-300 */
}
.feature-title {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: #1f2937; /* gray-800 */
  margin-bottom: 0.5rem;
}
.feature-description {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #6b7280; /* gray-500 */
}

.feature-highlight-card {
  display: flex;
  align-items: flex-start;
  padding: 1.5rem;
  background-color: transparent;
}
.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: #16a34a; /* green-600 */
  border-width: 1px;
  border-color: #86efac; /* green-300 */
}
.feature-highlight-title {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
  color: #1f2937; /* gray-800 */
}
.feature-highlight-description {
  margin-top: 0.5rem;
  font-size: 1rem;
  line-height: 1.5rem;
  color: #6b7280; /* gray-500 */
}

.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: 1rem;
  border-top: 1px solid #e5e7eb; /* gray-200 */
  color: #4b5563; /* gray-600 */
}

.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(147, 197, 253, 0.2);
  border-color: #93c5fd; /* blue-300 */
}
.link-card-title {
  font-weight: 700;
  color: #2563eb; /* blue-600 */
}
.link-card:hover .link-card-title {
  color: #1d4ed8; /* blue-700 */
}
.link-card-description {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #6b7280; /* gray-500 */
  margin-top: 0.5rem;
}

/*
 * Tool-Specific Styles
 * -----------------------------------------
 */
.loader {
  border: 4px solid #e5e7eb; /* gray-200 */
  border-radius: 50%;
  border-top: 4px solid #3b82f6; /* blue-500 */
  width: 32px;
  height: 32px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.control-button {
  transition: all 0.2s ease-in-out;
}
.control-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.control-button:active {
  transform: translateY(-1px);
}

#image-container {
  padding-bottom: 120px; /* Space for action bar */
}

.image-card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb; /* gray-200 */
  transition:
    transform 0.2s ease-in-out,
    box-shadow 0.2s ease-in-out,
    border-color 0.2s ease-in-out;
  cursor: pointer;
}
.image-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1);
  border-color: #60a5fa; /* blue-400 */
}
.image-card-preview {
  background-color: #f9fafb; /* gray-50 */
  border-bottom: 1px solid #e5e7eb; /* gray-200 */
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.image-card-info-page {
  font-size: 0.75rem;
  color: #6b7280; /* gray-500 */
}
.image-card-info-dims {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937; /* gray-800 */
}

#action-bar {
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}
#action-bar.visible {
  transform: translateY(0);
}

.action-bar-text {
  color: #374151; /* gray-700 */
}
.action-bar-highlight {
  color: #2563eb; /* blue-600 */
}
.action-bar-label {
  color: #4b5563; /* gray-600 */
}
.action-bar-input {
  background-color: #ffffff;
  border: 1px solid #d1d5db; /* gray-300 */
  color: #1f2937; /* gray-800 */
}
.action-bar-divider {
  border-color: #e5e7eb; /* gray-200 */
}

/* Status Messages */
.status-text {
  color: #6b7280; /* gray-500 */
}
.status-error {
  background-color: #fee2e2; /* red-100 */
  border-color: #ef4444; /* red-500 */
  color: #b91c1c; /* red-800 */
}
.status-info {
  background-color: #fef3c7; /* amber-100 */
  border-color: #f59e0b; /* amber-500 */
  color: #92400e; /* amber-800 */
}

/* Modal Styles */
.modal-thumbnail {
  height: 80px;
  width: auto;
  border: 4px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.modal-thumbnail:hover {
  transform: scale(1.05);
  border-color: #93c5fd; /* blue-300 */
}
.modal-thumbnail.active {
  border-color: #3b82f6; /* blue-500 */
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4);
  transform: scale(1.05);
}

#modal-filmstrip-gallery::-webkit-scrollbar {
  height: 8px;
}
#modal-filmstrip-gallery::-webkit-scrollbar-track {
  background: #f1f1f1; /* gray-100 */
  border-radius: 10px;
}
#modal-filmstrip-gallery::-webkit-scrollbar-thumb {
  background: #d1d5db; /* gray-300 */
  border-radius: 10px;
}
#modal-filmstrip-gallery::-webkit-scrollbar-thumb:hover {
  background: #9ca3af; /* gray-400 */
}

/*
 * =========================================
 * Dark Theme Overrides (Block A: Media Query)
 * =========================================
 */
@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);
  }
  .content-section::before {
    background: linear-gradient(90deg, transparent, #30a8ff, transparent);
  }

  .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: 1px solid #30363d;
  }
  .feature-card:hover {
    transform: translateY(-5px);
    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-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: 1px solid #30363d;
  }
  .faq-question {
    color: #ffffff;
  }
  .faq-answer {
    border-color: #374151;
    color: #9ca3af;
  }

  .link-card {
    background-color: rgba(34, 41, 51, 0.5);
    border: 1px solid #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;
  }

  .loader {
    border: 4px solid #30363d;
    border-top: 4px solid #30a8ff;
  }

  .control-button:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  }

  .image-card {
    background-color: #161b22;
    border: 1px solid #30363d;
  }
  .image-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3),
      0 4px 6px -4px rgba(0, 0, 0, 0.3);
    border-color: #30a8ff;
  }
  .image-card-preview {
    background-color: #0d1117;
    border-bottom: 1px solid #30363d;
  }
  .image-card-info-page {
    color: #8b949e;
  }
  .image-card-info-dims {
    color: #c9d1d9;
  }

  .action-bar-text {
    color: #c9d1d9;
  }
  .action-bar-highlight {
    color: #58a6ff;
  }
  .action-bar-label {
    color: #8b949e;
  }
  .action-bar-input {
    background-color: #0d1117;
    border-color: #30363d;
    color: #c9d1d9;
  }
  .action-bar-divider {
    border-color: #30363d;
  }

  .status-text {
    color: #8b949e;
  }
  .status-error {
    background-color: rgba(248, 81, 73, 0.1);
    border-color: #f85149;
    color: #f85149;
  }
  .status-info {
    background-color: rgba(212, 167, 44, 0.1);
    border-color: #d4a72c;
    color: #d4a72c;
  }

  .modal-thumbnail:hover {
    border-color: #58a6ff;
  }
  .modal-thumbnail.active {
    border-color: #30a8ff;
    box-shadow: 0 4px 12px rgba(48, 168, 255, 0.4);
  }

  #modal-filmstrip-gallery::-webkit-scrollbar-track {
    background: #0d1117;
  }
  #modal-filmstrip-gallery::-webkit-scrollbar-thumb {
    background: #30363d;
  }
  #modal-filmstrip-gallery::-webkit-scrollbar-thumb:hover {
    background: #8b949e;
  }
}

/*
 * =========================================
 * Dark Theme Overrides (Block B: .dark Class)
 * =========================================
 */
.dark body {
  background-color: #0d1117;
  color: #c9d1d9;
}
.dark .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);
}
.dark .content-section::before {
  background: linear-gradient(90deg, transparent, #30a8ff, transparent);
}
.dark .section-title {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
}
.dark .feature-card {
  background-color: rgba(34, 41, 51, 0.5);
  border: 1px solid #30363d;
}
.dark .feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(48, 168, 255, 0.15);
  border-color: #30a8ff;
}
.dark .feature-icon {
  background-color: rgba(30, 58, 138, 0.5);
  color: #93c5fd;
  border-color: #1d4ed8;
}
.dark .feature-title {
  color: #ffffff;
}
.dark .feature-description {
  color: #9ca3af;
}
.dark .feature-highlight-icon {
  background-color: rgba(20, 83, 45, 0.5);
  color: #4ade80;
  border-color: #15803d;
}
.dark .feature-highlight-title {
  color: #ffffff;
}
.dark .feature-highlight-description {
  color: #9ca3af;
}
.dark .faq-item details {
  background-color: rgba(34, 41, 51, 0.5);
  border: 1px solid #30363d;
}
.dark .faq-question {
  color: #ffffff;
}
.dark .faq-answer {
  border-color: #374151;
  color: #9ca3af;
}
.dark .link-card {
  background-color: rgba(34, 41, 51, 0.5);
  border: 1px solid #30363d;
}
.dark .link-card:hover {
  box-shadow: 0 8px 25px rgba(48, 168, 255, 0.15);
  border-color: #30a8ff;
}
.dark .link-card-title {
  color: #60a5fa;
}
.dark .link-card:hover .link-card-title {
  color: #93c5fd;
}
.dark .link-card-description {
  color: #9ca3af;
}
.dark .loader {
  border: 4px solid #30363d;
  border-top: 4px solid #30a8ff;
}
.dark .control-button:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.dark .image-card {
  background-color: #161b22;
  border: 1px solid #30363d;
}
.dark .image-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3),
    0 4px 6px -4px rgba(0, 0, 0, 0.3);
  border-color: #30a8ff;
}
.dark .image-card-preview {
  background-color: #0d1117;
  border-bottom: 1px solid #30363d;
}
.dark .image-card-info-page {
  color: #8b949e;
}
.dark .image-card-info-dims {
  color: #c9d1d9;
}
.dark .action-bar-text {
  color: #c9d1d9;
}
.dark .action-bar-highlight {
  color: #58a6ff;
}
.dark .action-bar-label {
  color: #8b949e;
}
.dark .action-bar-input {
  background-color: #0d1117;
  border-color: #30363d;
  color: #c9d1d9;
}
.dark .action-bar-divider {
  border-color: #30363d;
}
.dark .status-text {
  color: #8b949e;
}
.dark .status-error {
  background-color: rgba(248, 81, 73, 0.1);
  border-color: #f85149;
  color: #f85149;
}
.dark .status-info {
  background-color: rgba(212, 167, 44, 0.1);
  border-color: #d4a72c;
  color: #d4a72c;
}
.dark .modal-thumbnail:hover {
  border-color: #58a6ff;
}
.dark .modal-thumbnail.active {
  border-color: #30a8ff;
  box-shadow: 0 4px 12px rgba(48, 168, 255, 0.4);
}
.dark #modal-filmstrip-gallery::-webkit-scrollbar-track {
  background: #0d1117;
}
.dark #modal-filmstrip-gallery::-webkit-scrollbar-thumb {
  background: #30363d;
}
.dark #modal-filmstrip-gallery::-webkit-scrollbar-thumb:hover {
  background: #8b949e;
}