/* ==========================================================================
   1. GLOBALS & VARIABLES (Scraped from Home Page)
   ========================================================================== */
:root {
  --bg-base: #faf5ff;
  --bg-surface: #ffffff;
  --bg-elevated: #f4e8fd;
  --text-primary: #1e1b4b;
  --text-secondary: #6b21a8;
  --border-color: rgba(0, 0, 0, 0.15);
  --border-hover: rgba(141, 24, 231, 0.3);
  --accent: #8d18e7;
  --radius-lg: 24px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 10px 40px -10px rgba(141, 24, 231, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Outfit", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; /* Fixes the blue mobile flash! */
}

body {
  background-color: var(--bg-base);
  background-image:
    radial-gradient(at 0% 0%, rgba(141, 24, 231, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(141, 24, 231, 0.05) 0px, transparent 50%);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  gap: 32px;
  font-weight: 300;
}

/* ==========================================================================
   2. SHARED COMPONENTS (Containers, Hero, Buttons)
   ========================================================================== */
.app-container {
  width: 100%;
  max-width: 1000px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--shadow-soft),
    0 0 0 1px rgba(255, 255, 255, 0.5),
    0 0 0 1px var(--border-color);
  overflow: hidden;
}

.hero-section {
  text-align: center;
  max-width: 800px;
  margin: 20px auto 0;
  padding: 0 20px;
}

.hero-section h1 {
  font-size: 3rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.04em;
}

.hero-section p {
  font-size: 1.125rem;
  color: #4b5563;
  line-height: 1.6;
}

.hero-section strong {
  color: #1f2937;
  font-weight: 700;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.copy-btn:hover {
  color: var(--text-primary);
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn.outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.action-btn.outline:hover {
  background: var(--bg-elevated);
}

.action-btn.filled {
  background: #0f172a;
  border: 1px solid #0f172a;
  color: #ffffff;
}

.action-btn.filled:hover {
  background: #1e293b;
}

/* ==========================================================================
   3. NEW IMAGE PICKER DASHBOARD
   ========================================================================== */
.image-picker-dashboard {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  padding: 40px;
}

.section-header-mini h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.image-preview-container {
  position: relative;
  width: 100%;
  height: auto;
  /* min-height: 320px; <--- DELETE THIS LINE */
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  cursor: crosshair;
}

.image-preview-container img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.expand-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.expand-btn:hover {
  transform: scale(1.05);
  background: #fff;
}

.palette-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}
/* --- NEW PALETTE LAYOUT RESTRUCTURING --- */
.palette-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
/* Converts the circular buttons into rounded squares */
.palette-count-controls .outline-btn,
.palette-row-content .outline-btn {
  border-radius: var(--radius-sm);
}
.palette-row-wrapper {
  margin-bottom: 16px;
}

.palette-row-wrapper:last-child {
  margin-bottom: 0;
}

.palette-row-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Force the color blocks to fill the remaining space */
.palette-row-content .extracted-palette {
  flex: 1;
  margin-bottom: 0 !important;
}

/* Ensure the export buttons don't stretch */
.palette-row-content .outline-btn {
  flex-shrink: 0;
}
.outline-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.outline-btn:hover {
  background: var(--bg-elevated);
}

.palette-count-controls,
.palette-actions {
  display: flex;
  gap: 8px;
}

.extracted-palette {
  flex: 1;
  display: flex;
  height: 40px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.extracted-palette .palette-swatch {
  height: 100%;
  border-radius: 0;
  border: none;
  transition: opacity 0.2s;
}
/* Hides the base color dot when hovering so the HEX code is clearly visible */
.palette-row .color-swatch:hover .base-dot {
  opacity: 0;
}
.extracted-palette .palette-swatch:hover {
  opacity: 0.8;
}

.active-colors-display {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.color-block {
  height: 64px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: background 0.3s ease;

  /* NEW: Centers the text and makes it act like a button */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* NEW: Forces the text to appear on desktop when you hover over the block! */
.color-block:hover .swatch-overlay {
  opacity: 1;
}

.color-block.primary {
  flex: 2;
}
.color-block.secondary {
  flex: 1;
}

.color-values-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.value-row {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.value-row .value-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 64px;
}

.value-row input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}

.view-details-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  margin-bottom: 32px;
  transition: opacity 0.2s;
}

.view-details-link:hover {
  opacity: 0.7;
}

.hidden {
  display: none !important;
}

.upload-card {
  background: var(--bg-surface);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.upload-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.privacy-notice {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  color: var(--text-secondary);
  align-items: flex-start;
}

.privacy-notice svg {
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 2px;
}
.privacy-notice p {
  font-size: 11px;
  line-height: 1.5;
  margin: 0;
}
/* --- MAGNIFIER LENS --- */
.magnifier-glass {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 12px;
  border: 3px solid #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  pointer-events: none; /* Crucial: stops it from blocking your mouse clicks! */
  display: none; /* Hidden until you hover */
  z-index: 50;
  overflow: hidden;
  background: var(--bg-surface);
}

#magnifier-canvas {
  width: 100%;
  height: 100%;
  /* Forces the zoomed pixels to stay sharp and blocky instead of blurry */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.magnifier-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(239, 68, 68, 0.8); /* Red target box */
  box-sizing: border-box;
  pointer-events: none;
}

/* The inner cross line (+) */
.magnifier-crosshair::before,
.magnifier-crosshair::after {
  content: "";
  position: absolute;
  background: rgba(239, 68, 68, 0.8);
}
.magnifier-crosshair::before {
  top: 50%;
  left: 4px;
  right: 4px;
  height: 1px;
  transform: translateY(-50%);
}
.magnifier-crosshair::after {
  left: 50%;
  top: 4px;
  bottom: 4px;
  width: 1px;
  transform: translateX(-50%);
}
/* ==========================================================================
   6. TOAST NOTIFICATIONS (Scraped from Home Page)
   ========================================================================== */
.toast-wrapper {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  pointer-events: none;
}
.toast-notification {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15);
  border-radius: 100px;
  padding: 10px 20px 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast-notification span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.toast-notification b {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
}
.toast-icon {
  background: #22c55e;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast-notification.fade-out {
  animation: fadeOutDown 0.3s forwards;
}

@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes fadeOutDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(20px); /* Pushes it down as it fades */
    opacity: 0;
  }
}

/* ==========================================================================
   7. RESPONSIVE DESIGN & ZOOM OPTIMIZATIONS
   ========================================================================== */
@media (min-width: 769px) {
  .app-container,
  .modern-footer {
    zoom: 0.95;
    transition: zoom 0.2s ease;
  }
}
@media (max-width: 900px) {
  /* ... your existing mobile styles ... */

  /* Center the toast wrapper on mobile */
  .toast-wrapper {
    right: auto; /* Overrides the right: 32px rule */
    left: 50%; /* Moves to the horizontal center */
    transform: translateX(-50%); /* Shifts it perfectly to the middle */
    bottom: 24px; /* Optional: Slightly lower on mobile for easier reach */
    align-items: center; /* Ensures the toasts stack centered if there are multiple */
    width: max-content;
  }
}
@media (max-width: 850px) {
  .image-picker-dashboard {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 24px;
  }
  /* Unwrap the two columns so we can sort everything inside them */
  .image-col,
  .details-col {
    display: contents;
  }

  /* Assign a strict top-to-bottom order for the mobile layout */
  .image-col > .section-header-mini {
    order: 1;
  }
  /* 2. Image with safe scrolling gutters on left and right */
  .image-preview-container {
    order: 2;
    width: calc(100% - 36px) !important; /* Shrinks the image slightly */
    margin: 0 auto; /* Centers it, leaving 24px of safe space on each side */
  }

  /* Upload card right below the image */
  .upload-card {
    order: 3;
  }

  /* The "Colors" Title and Active Color Blocks right below Upload */
  .details-col > .section-header-mini {
    order: 4;
  }
  .active-colors-display {
    order: 5;
  }
  .view-details-link {
    order: 6;
    margin-bottom: 0 !important;
  }
  /* Color values and link stay attached to the active colors */
  .color-values-list {
    order: 7;
  }

  /* Finally, the Extracted Image Palettes (Vibrant, Light, Dark) go at the bottom */
  .palette-header-row {
    order: 8;
    margin-top: 24px !important;
  }
  .palette-group-container {
    order: 9;
  }
  .app-container {
    border-radius: 0;
  }

  .nav-container {
    justify-content: space-between;
    padding: 16px 24px;
  }
  .nav-brand {
    flex: none;
  }
  .nav-right-spacer {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #ffffff;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    display: none;
  }
  .nav-links.active {
    display: flex;
  }
  .nav-link,
  .nav-dropdown-wrapper {
    width: 100%;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
  }
  .nav-dropdown-wrapper {
    border-bottom: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 !important;
  }
  .nav-dropdown-wrapper .dropdown-trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 16px 24px;
  }

  .nav-dropdown-wrapper .nav-dropdown {
    position: static !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    border-left: 2px solid var(--border-color) !important;
    border-radius: 0 !important;
    margin-top: 0;
    margin-bottom: 12px;
    margin-left: 24px;
    padding: 0;
    width: calc(100% - 24px);
    display: none;
    opacity: 1 !important;
    visibility: visible !important;
  }
  .nav-dropdown-wrapper.active .nav-dropdown {
    display: flex !important;
  }
  .nav-dropdown-wrapper .nav-dropdown a {
    padding: 12px 16px;
    white-space: normal;
  }
  .nav-dropdown::before {
    display: none !important;
  }
  .nav-dropdown-wrapper.active .dropdown-trigger svg {
    transform: rotate(180deg) !important;
  }

  .footer-glass-card {
    padding: 32px 24px 24px 24px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px 24px;
  }
  .footer-brand-col {
    grid-column: 1 / -1;
    padding-right: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
  }
  .modern-footer {
    margin-bottom: 0px !important;
  }
} /* ==========================================================================
   TOP METRICS BAR
   ========================================================================== */
.metrics-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center; /* This forces the text to stay perfectly centered */
  padding: 16px 32px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface, #ffffff);
  min-height: 65px;
  width: 100%;
  box-sizing: border-box;
}

.metrics-group {
  display: flex;
  justify-content: center;
  gap: 32px; /* Increased gap slightly to match the breathing room on the home page */
  flex-wrap: nowrap;
  align-items: center;
}
.metric {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.metric span:first-child {
  font-size: 14px;
  font-weight: 500;
  text-transform: capitalize;
  color: var(--text-secondary);
}

.metric span:last-child {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition:
    opacity 0.2s,
    color 0.2s;
  user-select: none;
}

.metric span:last-child:hover {
  opacity: 0.6;
}
/* Spinner Animation for EyeDropper Loading State */
@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}
.spin-animation {
  animation: spin 1s linear infinite;
}
/* Mobile Responsiveness for Metrics Bar */
/* Mobile Responsiveness for Metrics Bar */
@media (max-width: 850px) {
  .metrics-bar {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }

  .metrics-group {
    position: static;
    transform: none;
    left: auto;
    display: flex; /* Changed from grid to flex */
    flex-direction: column; /* Stacks them vertically */
    gap: 8px; /* Tighter gap between the rows */
    width: 100%;
  }

  .metric {
    background: var(--bg-elevated);
    padding: 12px 16px; /* Slightly thicker padding for better tapping */
    border-radius: var(--radius-sm);
    justify-content: space-between; /* Pushes the label left and value right */
    width: 100%; /* Forces it to stretch full width */
  }
}
@media (max-width: 500px) {
  .hero-section h1 {
    font-size: 2.5rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .footer-bottom-bar {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .meta-divider {
    display: none;
  }
}
/* ==========================================================================
   8. ADVANCED COLOR TOOLS (Variations, Harmonies, Contrast, Blindness)
   ========================================================================== */
.blindness-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 48px; /* Adds generous spacing between the columns and rows */
}

/* Removes the default bottom margin so the grid handles the spacing */
.blindness-grid .variation-group {
  margin-bottom: 0;
}

/* Makes the color blocks significantly thicker and cleaner */
.blindness-grid .palette-row {
  height: 48px; /* Increases the height to match the home page */
  border: none; /* Removes the harsh solid border */
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04); /* Very subtle inner ring so it doesn't bleed into the white background */
}

/* Ensures it stacks neatly into a single column on mobile phones */
@media (max-width: 850px) {
  .blindness-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.detail-section {
  width: 100%;
  max-width: 1000px;
  background: transparent !important;
  padding: 40px;
  border-radius: 0 !important; /* Strips away the rounded corners */
  border: none !important; /* Strips away the outer box line */
  border-top: 1px solid var(--border-color) !important; /* Keeps ONLY the top separator line */
  box-shadow: none !important; /* Removes the floating shadow */
  margin-top: 0 !important; /* Removes the awkward gap between sections */
}

.section-header {
  margin-bottom: 24px;
  padding-bottom: 0px;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Grids */
.harmony-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0px 48px; /* Adds space between columns */
}
.blindness-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 48px; /* Adds space between columns */
}
.contrast-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

/* Groups and Headers */
.variation-group {
  margin-bottom: 24px;
}
.variation-group:last-child {
  margin-bottom: 0;
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.group-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.export-btn {
  background: var(--bg-surface); /* Clean white background */
  border: 1px solid var(--border-color);
  color: var(--text-primary); /* Dark text */
  padding: 4px 10px;
  border-radius: 100px; /* This makes it perfectly pill-shaped! */
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.export-btn:hover {
  background: var(--bg-elevated);
  color: black; /* Changes text/icon to purple on hover */
  border-color: var(--border-hover);
}

/* Generated Palette Rows */
.palette-row {
  display: flex;
  height: 48px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.palette-swatch {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: opacity 0.2s;
  min-width: 0; /* Forces flexbox to squish all blocks evenly on mobile */
  overflow: hidden;
  position: relative; /* Required for the absolute positioning of the dot */
}

.palette-swatch:hover {
  opacity: 0.85;
}

/* The Base Color Dot */
.palette-swatch .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  position: absolute;
  top: 50%; /* Add this */
  left: 50%; /* Add this */
  transform: translate(-50%, -50%); /* Add this */
  pointer-events: none;
  transition: opacity 0.2s;
}

/* Hides the dot when hovering so the HEX text is perfectly readable */
.palette-swatch:hover .dot {
  opacity: 0;
}

/* The Text Overlay */
.swatch-overlay {
  opacity: 0;
  font-size: 11px;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  transition: opacity 0.2s;
  white-space: nowrap;
  pointer-events: none;
  position: relative;
  z-index: 2;
  text-align: center;
  line-height: 1.2;
}
.color-block .swatch-overlay {
  font-size: 14px;
}

.palette-swatch:hover .swatch-overlay {
  opacity: 1;
}
/* Hides the text overlay specifically in the extracted image palettes */
.extracted-palette .swatch-overlay {
  display: none !important;
}

/* Tables (Conversion & WCAG) - Base Structure */
.wcag-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.conversion-table {
  width: 100%;
  border-collapse: separate; /* Required for rounded corners */
  border-spacing: 0;
  text-align: left;
  background: var(--bg-surface); /* Pure white background */
  border: 1px solid var(--border-color); /* Outer border */
  border-radius: var(--radius-md); /* Rounded corners */
  overflow: hidden; /* Clips the inner corners cleanly */
}

.conversion-table th,
.wcag-table th {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
}
.card-bottom {
  background-color: #fdfaff;
}
.conversion-table td {
  font-family: "JetBrains Mono", monospace;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: black;
  /* ❌ Removed the JetBrains Mono font from here! */
}
.wcag-table td {
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: black;
}

.conversion-table tr:last-child td,
.wcag-table tr:last-child td {
  border-bottom: none;
}

/* ✅ Apply the code font ONLY to the 3rd column of the Conversion Table */
.conversion-table td:nth-child(3) {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(black);
}

@media (max-width: 850px) {
  .conversion-table td:nth-child(3) {
    font-size: 11px;
  }
  .conversion-table td {
    font-size: 11px;
  }
}
/* Contrast Checker Specifics */
/* --- CONTRAST CHECKER --- */
.contrast-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.ratio-badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.contrast-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.card-top {
  padding: 48px 24px;
  text-align: center;
}
.card-top.white-bg {
  background-color: #ffffff;
}
.card-top.black-bg {
  background-color: #000000;
}
.ratio-number {
  font-size: 3rem;
  font-weight: 800;
  display: block;
}
.wcag-table {
  width: 100%;
  text-align: center;
  border-collapse: collapse;
}
.wcag-table td,
.wcag-table th {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}
.icon-pass svg {
  color: var(--accent) !important;
  width: 20px;
}
.icon-fail svg {
  color: #ef4444;
  width: 20px;
}

/* Responsive adjustments */
@media (max-width: 850px) {
  .harmony-grid,
  .blindness-grid,
  .contrast-grid {
    grid-template-columns: 1fr;
  }
  .detail-section {
    padding: 24px;
  }
}
/* --- EXPORT MODAL STYLES --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: all 0.2s ease;
  padding: 16px;
}
.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}
.modal-container {
  background: var(--bg-surface);
  width: 800px;
  flex-direction: column;
  max-height: 90vh;
  display: flex;
  max-width: 95vw;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.hidden .modal-container {
  transform: translateY(20px);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}
.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
}
.modal-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  max-height: 90vh !important;
}
.modal-content {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.modal-sidebar {
  width: 240px;
  border-right: 1px solid var(--border-color);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-base);
}
.sidebar-item {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.sidebar-item:hover {
  background: var(--border-color);
}
.sidebar-item.active {
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.sidebar-item strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}
.sidebar-item span {
  font-size: 11px;
  color: var(--text-secondary);
}
.export-top-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}
.export-tabs {
  display: flex;
  gap: 16px;
}
.export-tab {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}
.export-tab.active {
  color: var(--text-primary);
}
.prefix-input {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  outline: none;
  width: 120px;
}
.export-preview-area {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0;
}
.export-swatches {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: auto;
}
.export-swatch-row {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  min-height: 34px !important;
}
.export-swatch-row:hover {
  opacity: 0.9;
}
.export-swatch-row svg {
  margin-left: 8px;
  opacity: 0.7;
}

/* Fixes for rounded corners on the top/bottom swatch rows */
.export-swatch-row:first-child {
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}
.export-swatch-row:last-child {
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.export-code-block {
  flex: 1;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.export-code-block pre {
  flex: 1;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-primary);
  line-height: 2;
  overflow-y: auto;
}
#copy-all-export-btn {
  flex: none;
  padding: 10px;
}
/* --- DESKTOP ZOOM OPTIMIZATION --- */
@media (min-width: 769px) {
  .modal-container {
    zoom: 0.85;
    transition: zoom 0.2s ease;
  }
}

/* --- MOBILE RESPONSIVENESS OVERRIDES --- */
@media (max-width: 850px) {
  .modal-body {
    flex-direction: column; /* Stack sidebar on top of content */
    height: auto;
    max-height: 80vh;
    overflow-y: auto;
  }

  .modal-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    flex-direction: row;
    overflow-x: auto; /* Scrollable categories */
    padding: 8px;
  }

  .sidebar-item {
    min-width: 140px;
    padding: 8px;
  }

  .sidebar-item span {
    display: none; /* Hide descriptions to save space */
  }

  .export-preview-area {
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  .export-swatches {
    flex: none;
    max-height: 35vh;
    overflow-y: auto;
  }

  .export-code-block {
    flex: none;
    max-height: 25vh;
    overflow-y: auto;
  }
}
@media (max-width: 850px) {
  /* 1. Stack all rows vertically */
  .palette-row {
    flex-direction: column;
    height: auto !important;
    min-height: 48px;
  }

  /* 2. Force strict height so they don't squish */
  .palette-row .palette-swatch,
  .palette-swatch {
    width: 100%;
    flex: none;
    height: 48px;
  }

  /* 3. Move the base color dot to the left side */
  .palette-swatch .dot {
    left: 24px; /* Pushes it in nicely from the left edge */
    transform: translateY(-50%); /* Keeps it perfectly centered vertically */
  }

  /* 4. Ensure the text overlay is visible on ALL mobile blocks */
  .swatch-overlay {
    opacity: 1 !important;
    display: block !important;
    background: transparent;
  }
}
/* --- ARTICLE / SEO CONTENT STYLES --- */
.article-section {
  padding-bottom: 64px;
}

.article-content {
  color: var(--text-primary);
  line-height: 1.7;
}

.article-content p {
  margin-bottom: 16px;
  font-size: 1.05rem;
  font-weight: 300;
  color: #374151;
}

.article-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 32px 0 16px 0;
  color: #111827;
  letter-spacing: -0.02em;
}

.article-content h4 {
  font-size: 1.15rem;
  font-weight: 500;
  margin: 24px 0 12px 0;
  color: #111827;
}

.article-content ul {
  margin: 0 0 24px 24px;
  color: #374151;
  font-weight: 300;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content strong {
  font-weight: 600;
  color: #111827;
}

.article-content code {
  background: var(--bg-elevated);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9em;
  font-weight: 500;
}

.math-callout {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 1.2rem !important;
  font-family: "JetBrains Mono", monospace;
  margin: 24px 0 !important;
}

.article-divider {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 40px 0;
}

/* Flex Grid for Tints, Tones & Shades */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 24px 0;
}

.article-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: var(--radius-md);
}

.article-card h4 {
  margin-top: 0;
}

.article-card ul {
  margin-bottom: 0;
}
/* Center the 7th Tetradic item in the 2-column harmony grid on desktop */
@media (min-width: 851px) {
  .harmony-grid .tetradic-center {
    grid-column: 1 / -1;
    max-width: calc(
      50% - 16px
    ); /* Matches exact column width accounting for the 32px gap */
    margin: 0 auto;
    width: 100%;
  }
}
