/* --- 1. MODERN LIGHT THEME VARIABLES & RESET --- */
: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);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.04);
}

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  -webkit-font-smoothing: antialiased;
}

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. MAIN APPLICATION CONTAINER --- */
.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 --- */
.hero-section {
  text-align: center;
  max-width: 800px;
  margin: 20px auto 0;
  padding: 0 20px;
}

.hero-section h1 {
  font-size: 3.0rem;
  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;
}

/* --- 3. TOP METRICS BAR --- */
.metrics-bar {
  position: relative;
  display: flex;
  align-items: center;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.01);
}

.swatch-group,
.actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  padding: 6px 8px;
  border-radius: 100px;
  border: 1px solid var(--border-color);
}

.metrics-group {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 24px;
  flex-wrap: nowrap;
  width: max-content;
  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,
#preview-hex-text:hover,
.harmony-swatch-label:hover {
  opacity: 0.6;
}

.metric span:last-child:active,
#preview-hex-text:active,
.harmony-swatch-label:active {
  opacity: 1;
}

.active-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.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);
}

/* --- 4. ORIGINAL MAIN DASHBOARD (Kept for index.html) --- */
.main-dashboard {
  display: grid;
  grid-template-columns: 300px 1fr 280px;
  gap: 32px;
  padding: 32px;
}

.color-map {
  position: relative;
  width: 100%;
  height: 240px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: crosshair;
  border: 1px solid var(--border-color);
}

.map-overlay-white {
  background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-overlay-black {
  background: linear-gradient(to top, #000, rgba(0, 0, 0, 0));
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-pointer {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2.5px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
}

.hue-slider-container {
  position: relative;
  width: 100%;
  height: 16px;
  margin-top: 24px;
  border-radius: 100px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.hue-track {
  width: 100%;
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(
    to right,
    #f00 0%,
    #ff0 17%,
    #0f0 33%,
    #0ff 50%,
    #00f 67%,
    #f0f 83%,
    #f00 100%
  );
}

.hue-pointer {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.large-preview {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
}

/* --- 4B. NEW COLOR WHEEL DASHBOARD (From Video) --- */
.wheel-dashboard-layout {
  display: grid;
  grid-template-columns: 400px 1fr; /* Left: Wheel, Right: Stacked Cards */
  gap: 24px;
  padding: 32px;
}

.wheel-control-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}


/* --- VECTOR WHEEL CSS --- */
.vector-wheel-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto;
  border-radius: 50%;
  touch-action: none; 
  cursor: crosshair;
  /* NEW: Adds a beautiful, subtle 3D lift to the entire wheel */
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.06));
}

.color-wheel-surface {
  position: absolute;
  top: 25px; left: 25px; right: 25px; bottom: 25px;
  border-radius: 50%;
  
  /* Crisp 1px boundary for the inner colored wheel */
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
  
  background: 
    /* 1. Improved Canva-style soft center fade */
    radial-gradient(circle at center, #ffffff 0%, rgba(255,255,255,0.4) 40%, transparent 85%),
    /* 2. Standard RGB clockwise order starting at the Top (0deg) */
    conic-gradient(
      from 0deg, 
      #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000
    );
}

.wheel-ui-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; /* Lets clicks pass through to the container */
  overflow: visible;
}
.wheel-cards-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 320px; /* FIX: Stops the section from stretching across the screen */
}
/* --- NEW ADVANCED WHEEL STYLES --- */
.wheel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column; /* Forces vertical stacking */
  align-items: center;
}
.harmony-selector-header {
  display: flex;
  justify-content: flex-start; /* FIX: Moves dropdown to the left */
  align-items: center;
  margin-bottom: 12px;
}

/* The large stacked blocks container shown in the video */
.harmony-cards-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  width: 100%; /* FIX: Keeps the cards flush with the dropdown */
}

.harmony-stack-block {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif; /* FIX: Clean font instead of monospace */
  font-size: 1.1rem; /* FIX: Normal text size */
  font-weight: 400; /* FIX: Standard weight instead of bold */
  cursor: pointer;
  transition: opacity 0.2s ease, filter 0.2s ease;
  position: relative;   
}

.harmony-stack-block:hover {
  filter: brightness(1.05);
}

.harmony-stack-block:active {
  filter: brightness(0.95);
}

.wheel-harmony-select {
  width: 100%;
}

/* Original Harmony Styling (For index.html compatibility) */
.harmony-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.harmony-header h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  font-weight: 600;
}

.harmony-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.harmony-item span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.harmony-palette {
  display: flex;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.harmony-swatch {
  flex: 1;
}

.harmony-swatch-label {
  flex: 1.5;
  background: #fff;
  font-size: 13px;
  font-family: "JetBrains Mono", monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-left: 1px solid var(--border-color);
}

/* --- 5. DETAIL SECTIONS --- */
.detail-section {
  padding: 40px 32px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.01);
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.variation-group {
  margin-bottom: 32px;
}

.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;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.export-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.export-btn:hover {
  background: var(--bg-elevated);
  color: black;
  border-color: var(--border-hover);
}

.palette-row {
  display: flex;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.palette-swatch {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
  margin-right: -1px;
}
.palette-swatch:last-child {
  margin-right: 0;
  margin-bottom: 0;
}

.palette-swatch .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  opacity: 0.6;
}

.swatch-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.05);
}

.palette-swatch:hover .swatch-overlay,
.harmony-swatch:hover .swatch-overlay {
  opacity: 1;
}

.palette-swatch:hover .dot {
  opacity: 0;
}

.conversion-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.conversion-table th,
.conversion-table td {
  padding: 16px 20px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
}

.conversion-table th {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.conversion-table td {
  font-family: "JetBrains Mono", monospace;
}

.conversion-table tr:last-child td {
  border-bottom: none;
}

/* --- 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);
  width: 20px;
}

.icon-fail svg {
  color: #ef4444;
  width: 20px;
}

/* --- CUSTOM SELECT DROPDOWNS --- */
.custom-select-container {
  position: relative;
  min-width: 170px;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.custom-select-trigger:hover {
  border-color: var(--border-hover);
}

.custom-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: all 0.2s ease;
}

.custom-options:not(.hidden) {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-option {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.custom-option:hover {
  background: var(--bg-elevated);
}

.custom-option.active {
  background: var(--bg-elevated);
  color: black;
  font-weight: 600;
}

/* --- NEW INPUT CONTROLS & BUTTONS --- */
.color-input-control {
  display: flex;
  align-items: center;
  margin-top: 32px; /* Gives breathing room below the wheel */
  padding: 6px 6px 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  gap: 8px;
  width: 100%; /* Stretches inside the card */
}

.input-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

#color-input-field {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  font-weight: 500;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-primary);
  width: 100%;
  background: transparent;
}

.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);
}

.format-select-wrapper {
  position: relative;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.format-select-wrapper .custom-select-trigger {
  border: none;
  background: transparent;
  padding: 6px 10px;
  min-width: 80px;
  font-size: 11px;
}

.format-select-wrapper .custom-select-trigger:hover {
  border-color: transparent;
}

.format-select-wrapper .custom-options {
  min-width: 90px;
  right: 0;
  left: auto;
  top: calc(100% + 6px);
}

.picker-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  width: 100%; /* Stretches inside the card */
}

.action-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  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;
}

/* --- 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;
}

.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;
  text-align: center;
}

.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);
}

.modal-content {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.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: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-swatch-row:hover {
  opacity: 0.9;
}

.export-swatch-row svg {
  margin-left: 8px;
  opacity: 0.7;
}

.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;
}

/* --- TOAST NOTIFICATION --- */
.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;
  }
}

/* --- GRIDS FOR COMBINATIONS/BLINDNESS --- */
.harmony-grid,
.blindness-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0px 48px;
}

/* Center the 7th Tetradic item in the 2-column harmony grid on desktop */
@media (min-width: 481px) {
  .harmony-grid .tetradic-center {
    grid-column: 1 / -1;
    max-width: calc(50% - 24px);
    margin: 0 auto;
    width: 100%;
  }
}


/* --- MOBILE RESPONSIVENESS OVERRIDES --- */

@media (max-width: 850px) {

  /* Main Dashboards collapsing to 1 column */
  .main-dashboard,
  .wheel-dashboard-layout {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 24px;
  }

  /* Wheel-specific adjustments */
  .wheel-control-panel {
    align-items: center; /* Center the wheel on mobile */
  }
  
  .color-input-control, 
  .picker-actions, 
  .value-slider-container {
    width: 100%; /* Keep controls full width under centered wheel */
    max-width: 400px;
  }
  /* Right-panel adjustments */
  .wheel-cards-panel {
    width: 100%;
    max-width: 400px;
    margin: 0 auto; /* Centers the panel under the wheel */
  }

  /* Right-panel adjustments */
  .harmony-cards-wrapper {
    min-height: 300px; /* Adjust height for mobile */
  }

  .metrics-bar {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }

  .metrics-group {
    position: static;
    transform: none;
    left: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
  }

  .metric {
    background: var(--bg-elevated);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    justify-content: space-between;
  }

  .large-preview {
    height: 200px;
    order: -1;
  }

  .modal-body {
    flex-direction: column;
    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;
    padding: 8px;
  }

  .sidebar-item {
    min-width: 140px;
    padding: 8px;
  }

  .sidebar-item span { display: none; }

  .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;
  }

  .contrast-grid { grid-template-columns: 1fr; }
  .app-container { border-radius: 0; }
  body { padding: 0; }

  .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; }
}

@media (max-width: 768px) {
  .palette-row {
    flex-direction: column;
    height: auto;
  }

  .palette-swatch {
    min-height: 56px;
    width: 100%;
    /* FIX: Switches the gap-bridge to vertical for mobile screens */
    margin-right: 0;
    margin-bottom: -1px;
  }

  .swatch-overlay {
    opacity: 1;
    background: transparent;
  }

  .palette-swatch .dot {
    position: absolute;
    left: 20px;
    width: 8px;
    height: 8px;
  }

  .hero-section h1 { font-size: 2.5rem; }
  .hero-section p { font-size: 1rem; }
  .hero-section p br { display: none; }
}

@media (min-width: 769px) {
  .app-container, .modern-footer, .modal-container { 
    zoom: 0.95; 
  }
}

@media (max-width: 480px) {
  .hero-section { margin-top: 0; }
  .hero-section h1 { font-size: 2rem; }
  .metrics-group { grid-template-columns: 1fr; }
  .picker-actions { flex-direction: column; }
  .harmony-grid, .blindness-grid { grid-template-columns: 1fr; }
  .section-header h2 { font-size: 1.1rem; }
}
@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;
  }
}
/* --- 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;
}

.faq-item {
  margin-bottom: 24px;
}

.faq-item h4 {
  margin-bottom: 8px;
  color: #111827;
}

.faq-item p {
  margin-bottom: 0;
}
/* --- PREMIUM ARTICLE CARDS & CALLOUTS --- */
.feature-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(141, 24, 231, 0.08);
  border-color: var(--border-hover);
}

.feature-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-elevated);
}

.feature-card-header h4 {
  margin: 0 !important;
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 700;
}

.feature-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-card-body p {
  margin: 0 !important;
  font-size: 1rem;
}

/* Callout Boxes */
.info-box {
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  line-height: 1.5;
}

.info-box strong {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.info-box ul {
  margin: 0 0 0 20px !important;
  padding: 0;
}

.info-box li {
  margin-bottom: 4px !important;
}

.info-box.neutral {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.info-box.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.info-box.success strong {
  color: #15803d;
}

.info-box.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.info-box.warning strong {
  color: #b45309;
}
/* --- COLOR THEORY VISUAL COMPONENTS --- */
.theory-visual-group {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  justify-content: center;
}

.t-swatch {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border: 3px solid #ffffff;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.t-swatch:hover {
  transform: scale(1.15);
}

.t-swatch.sm {
  width: 32px;
  height: 32px;
  border-width: 2px;
}

.theory-math {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.t-math-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-base);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.t-math-row span {
  font-family: "JetBrains Mono", monospace;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.theory-gradient {
  height: 12px;
  width: 100%;
  border-radius: 100px;
  margin-bottom: 20px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.warm-grad { background: linear-gradient(90deg, #ef4444, #f97316, #eab308); }
.cool-grad { background: linear-gradient(90deg, #3b82f6, #06b6d4, #22c55e); }