/* Shared aesthetic enhancements for QuantLens */

:root {
  --accent-2: #00c2ff;
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.25);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.45);
  --easing: cubic-bezier(.215,.61,.355,1);
  /* gradient tokens */
  --bg-grad-1: rgba(0,113,227,0.08);
  --bg-grad-2: rgba(0,194,255,0.06);
  /* glossy title tokens (dark default) */
  --glossy-1: #f5f5f7;
  --glossy-2: #d1d1d6;
}

/* Subtle background gradient across pages */
body {
  background:
    radial-gradient(1200px 600px at -10% -10%, var(--bg-grad-1), transparent 60%),
    radial-gradient(800px 400px at 110% 10%, var(--bg-grad-2), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* Theme overrides */
html[data-theme="light"] {
  /* Apple-like light theme tokens */
  --bg: #fbfbfd !important;            /* Apple page background */
  --text: #1d1d1f !important;          /* Apple gray 6 */
  --text-secondary: #6e6e73 !important;/* Apple gray 4 */
  --card-bg: #ffffff !important;       /* Crisp white surfaces */
  --border: #d2d2d7 !important;        /* Apple hairline gray */
  --accent: #0071e3 !important;        /* Apple blue */
  --accent-hover: #0077ed !important;  /* Apple blue hover */
  --bg-grad-1: rgba(0,0,0,0.02) !important; /* very soft neutral falloff */
  --bg-grad-2: rgba(0,0,0,0.015) !important;
  --glossy-1: #1d1d1f !important;      /* Apple title gradient start */
  --glossy-2: #6e6e73 !important;      /* Apple title gradient end */
}
html[data-theme="dark"] {
  /* keeps current dark values; color-scheme hint */
}

/* Sticky toolbar (catalog filters/search) */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(0,0,0,0.75);
  -webkit-backdrop-filter: saturate(160%) blur(6px);
  backdrop-filter: saturate(160%) blur(6px);
  border-bottom: 1px solid var(--border);
}
html[data-theme="light"] .toolbar { background: rgba(255,255,255,0.88); box-shadow: 0 6px 20px rgba(2,6,23,0.06); }

/* Filter chips: category color wires via --chip-fg/--chip-bg */
.filters .filter-btn {
  background: var(--chip-bg, var(--card-bg));
  color: var(--chip-fg, var(--text));
  border-color: color-mix(in srgb, var(--chip-fg, var(--text)) 30%, transparent);
}
.filters .filter-btn[aria-pressed="true"] {
  background: var(--chip-fg, var(--accent));
  border-color: var(--chip-fg, var(--accent));
  color: #fff;
}
.filters .filter-btn .chip-icon { display: inline-flex; vertical-align: -2px; margin-right: 6px; opacity: .9; }
.filters .filter-btn .chip-icon svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }

/* Meta icons inside pack chips */
.pack-meta .meta-icon { display: inline-flex; vertical-align: -3px; margin-right: 6px; }
.pack-meta .meta-icon svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }

/* Tooltip styling for trust badges */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0; bottom: 125%;
  transform: translateY(6px);
  opacity: 0; pointer-events: none;
  background: #0b0b0b;
  color: #f5f5f7;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: 12px; line-height: 1.2;
  padding: 8px 10px; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: opacity .15s var(--easing), transform .15s var(--easing);
  z-index: 60;
}
[data-tooltip]:hover::after { opacity: 1; transform: translateY(0); }
html[data-theme="light"] [data-tooltip]::after { background: #111; color: #f8fafc; border-color: rgba(2,6,23,0.15); }

/* Pagination */
.pagination { display: flex; gap: .5rem; justify-content: center; align-items: center; margin: 0 0 2rem; }
.pagination .page-btn {
  padding: .5rem .8rem; border-radius: 8px;
  background: var(--card-bg); color: var(--text);
  border: 1px solid var(--border); cursor: pointer; font-size: .9rem;
}
.pagination .page-btn[aria-current="page"], .pagination .page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .page-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Compare tray */
.compare-tray {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(0,0,0,0.85);
  -webkit-backdrop-filter: saturate(160%) blur(6px);
  backdrop-filter: saturate(160%) blur(6px);
  border-top: 1px solid var(--border);
  padding: .75rem 1rem;
}
html[data-theme="light"] .compare-tray { background: rgba(255,255,255,0.92); box-shadow: 0 -8px 24px rgba(2,6,23,0.08); }
.compare-tray .inner { max-width: 1280px; margin: 0 auto; display: flex; gap: .75rem; align-items: center; padding: 0 .5rem; }
.compare-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .6rem; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); font-size: .85rem; }
.compare-chip button { background: transparent; color: inherit; border: none; cursor: pointer; font-size: 1rem; line-height: 1; }
.compare-actions { margin-left: auto; display: flex; gap: .5rem; }
.compare-actions .primary { padding: .6rem .9rem; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }
.compare-actions .ghost { padding: .6rem .9rem; background: var(--card-bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.compare-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.8); display: none; align-items: center; justify-content: center; z-index: 60; padding: 1rem;
}
.compare-modal.open { display: flex; }
.compare-modal .panel { background: #0f0f10; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 1rem; max-width: 1000px; width: 100%; box-shadow: var(--shadow-lg); }
.compare-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.compare-table th, .compare-table td { border-bottom: 1px solid rgba(255,255,255,.08); padding: .6rem .5rem; text-align: left; }
.compare-table th { color: var(--text-secondary); font-weight: 600; }

/* Category hues */
.filters .filter-btn[data-cat-key="finance"] { --chip-fg: #10b981; --chip-bg: rgba(16,185,129,.15); }
.filters .filter-btn[data-cat-key="healthcare"] { --chip-fg: #06b6d4; --chip-bg: rgba(6,182,212,.15); }
.filters .filter-btn[data-cat-key="legal"] { --chip-fg: #8b5cf6; --chip-bg: rgba(139,92,246,.15); }
.filters .filter-btn[data-cat-key="government"] { --chip-fg: #f59e0b; --chip-bg: rgba(245,158,11,.15); }
.filters .filter-btn[data-cat-key="research"],
.filters .filter-btn[data-cat-key="rd"] { --chip-fg: #6366f1; --chip-bg: rgba(99,102,241,.15); }
.filters .filter-btn[data-cat-key="climate"] { --chip-fg: #22c55e; --chip-bg: rgba(34,197,94,.15); }

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .35s var(--easing), transform .35s var(--easing); }
.reveal.reveal-in { opacity: 1; transform: none; }

/* Skeleton loaders */
.skeleton-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  animation: shimmer 1.2s infinite;
}
.skeleton-line { height: 12px; background: rgba(255,255,255,.08); border-radius: 6px; margin: 10px 0; }
.skeleton-line.lg { height: 18px; width: 70%; }
.skeleton-line.sm { height: 10px; width: 40%; }

@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }

/* Microinteractions for buttons/cards */
.pack-card { transition: transform .25s var(--easing), box-shadow .25s var(--easing); }
.pack-card:hover { box-shadow: 0 20px 40px rgba(0, 113, 227, 0.2); }
.action-btn { transition: transform .15s var(--easing), filter .2s var(--easing); }
.action-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.action-btn:active { transform: translateY(0); filter: brightness(.98); }
/* Touch target min sizes */
.action-btn, .filter-btn, .pagination .page-btn, .cta, .json-btn { min-height: 44px; }

/* Motion safety */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Theme toggle removed (dark-only) */

/* Glossy title utility */
.glossy-title {
  background: linear-gradient(90deg, var(--glossy-1), var(--glossy-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ========================= */
/* Light theme accessibility */
/* ========================= */

/* Stronger default text contrast on light */
html[data-theme="light"] body, html[data-theme="light"] p, html[data-theme="light"] li {
  color: var(--text);
}
html[data-theme="light"] .section-subtitle,
html[data-theme="light"] .stat-label,
html[data-theme="light"] small { color: var(--text-secondary); }

/* Form controls: inputs/selects/textarea */
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] input[type="url"],
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: .7rem .85rem;
  box-shadow: 0 0 0 0 transparent;
  transition: border-color .15s var(--easing), box-shadow .15s var(--easing), background-color .15s var(--easing);
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: #6e6e73; opacity: .9; }
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.18);
}

/* Buttons */
html[data-theme="light"] .action-btn,
html[data-theme="light"] button:not(.theme-toggle) {
  background: #f6f7f8;
  color: var(--text);
  border: 2px solid var(--border);
}
html[data-theme="light"] .action-btn:hover,
html[data-theme="light"] button:not(.theme-toggle):hover {
  background: #eceff3;
  border-color: #c2c2c7;
  box-shadow: 0 2px 8px rgba(33,33,33,0.06);
}
html[data-theme="light"] .action-btn:focus-visible,
html[data-theme="light"] button:not(.theme-toggle):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,113,227,0.18);
}

/* Checkboxes/radios get accent color for clear on-state */
html[data-theme="light"] input[type="checkbox"],
html[data-theme="light"] input[type="radio"] { accent-color: var(--accent); }

/* Cards and key groupings */
html[data-theme="light"] .pack-card,
html[data-theme="light"] .coverage-card,
html[data-theme="light"] .stat-badge {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
html[data-theme="light"] .pack-card:hover,
html[data-theme="light"] .coverage-card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
html[data-theme="light"] .integrity-stats .stat-badge { border-radius: 12px; padding: .75rem 1rem; }

/* Clearer grouping for big sections */
html[data-theme="light"] .coverage-section { background: linear-gradient(180deg, #fbfbfd, #f5f7fb 70%, #fbfbfd); border-top: 1px solid #eceff3; border-bottom: 1px solid #eceff3; }

/* Emphasize selected/active states */
html[data-theme="light"] .filter-btn[aria-pressed="true"],
.filter-btn.active { filter: saturate(110%); box-shadow: 0 2px 8px rgba(0,113,227,0.12); }

/* Pricing/plan cards (AI CORE / DOMAIN PRO) */
html[data-theme="light"] .pricing-card { background: #fff !important; border: 1px solid var(--border) !important; box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
html[data-theme="light"] .pricing-title { color: var(--text) !important; }
html[data-theme="light"] .pricing-subtitle { color: var(--text-secondary) !important; }
html[data-theme="light"] .pricing-amount { color: var(--text) !important; }
html[data-theme="light"] .pricing-badge { background: linear-gradient(135deg, var(--accent), var(--accent-hover)) !important; color: #fff !important; }
html[data-theme="light"] .pricing-badge.best-value { background: linear-gradient(135deg, #10b981, #059669) !important; }

/* KPI/stat badges */
html[data-theme="light"] .kpi-badge, html[data-theme="light"] .audit-badge, html[data-theme="light"] .one-time-badge, html[data-theme="light"] .temporal-badge { background: #fff; border: 1px solid var(--border); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }

/* Pack selection (Domain Pro) */
html[data-theme="light"] .pack-checkbox-label { border: 1px solid var(--border) !important; background: #fff !important; }
html[data-theme="light"] .pack-checkbox-label:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
html[data-theme="light"] .pack-checkbox-label[aria-pressed="true"], html[data-theme="light"] .pack-checkbox-label.selected { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(0,113,227,0.18); }

/* Testimonial/blockquote containers */
html[data-theme="light"] blockquote, html[data-theme="light"] .testimonial { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: 1rem 1.25rem; border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }

/* Striped section backgrounds (opt-in) */
html[data-theme="light"] section.alt-strip { background: linear-gradient(180deg, #fafbfc 0%, #f6f8fa 100%); border-top: 1px solid #eceff3; border-bottom: 1px solid #eceff3; }

/* Primary/secondary CTA styles */
.cta { display: inline-flex; align-items: center; gap: .4rem; padding: .8rem 1.1rem; border-radius: 12px; text-decoration: none; font-weight: 600; border: 1px solid transparent; transition: background-color .15s var(--easing), border-color .15s var(--easing), box-shadow .15s var(--easing), color .15s var(--easing); }
html[data-theme="light"] .cta-primary, html[data-theme="light"] .email-submit { background: var(--accent); color: #fff; border-color: #0052a3; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
html[data-theme="light"] .cta-primary:hover, html[data-theme="light"] .email-submit:hover { background: var(--accent-hover); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
html[data-theme="light"] .cta-secondary { background: #fff; color: var(--accent); border-color: var(--accent); }
html[data-theme="light"] .cta-secondary:hover { background: #f6f9ff; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
/* JSON download button styled like secondary CTA */
html[data-theme="light"] .json-btn { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
html[data-theme="light"] .json-btn:hover { background: #f6f9ff; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

/* Disabled states */
button:disabled, .cta[aria-disabled="true"], .email-submit:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; filter: grayscale(10%); }

/* Error states for inputs */
input[aria-invalid="true"], textarea[aria-invalid="true"], .is-invalid input, .is-invalid textarea { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220,38,38,0.15) !important; }

/* Current nav link */
.nav a[aria-current="page"], .nav a.active { color: var(--text) !important; border-bottom: 2px solid var(--accent); }

/* --------------------- */
/* Mobile friendliness   */
/* --------------------- */
/* Nav wraps and gains clearer pills on mobile */
.nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
/* Hamburger toggle hidden on desktop */
.menu-toggle { display: none; }
@media (max-width: 768px) {
  .nav { gap: .5rem .75rem; }
  .nav a { padding: .35rem .6rem; border: 1px solid var(--border); border-radius: 10px; }
  /* Collapse nav by default on mobile */
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); color: var(--text); min-height: 44px; }
  .nav { display: none; flex-direction: column; width: 100%; margin-top: .75rem; }
  .nav.open { display: flex; }
}

/* Containers tighten horizontal padding on small screens */
@media (max-width: 640px) {
  .container { padding-left: 1rem !important; padding-right: 1rem !important; }
}

/* Grids: single column on narrow viewports */
@media (max-width: 640px) {
  .catalog-grid, .coverage-grid { grid-template-columns: 1fr !important; }
  .integrity-stats { gap: 1.5rem; }
}

/* Logo size on smaller screens */
@media (max-width: 640px) {
  .logo-img { width: 56px !important; height: 56px !important; }
}

/* Modal submit button adopts primary CTA style */
.modal-submit-btn { background: var(--accent); color: #fff; border: 1px solid #0052a3; border-radius: 12px; padding: .8rem 1.1rem; font-weight: 600; min-height: 44px; }
.modal-submit-btn:hover { background: var(--accent-hover); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

/* Fluid type scale for headings */
.hero h1 { font-size: clamp(2rem, 4vw + 1rem, 3.5rem); }
.section-title { font-size: clamp(1.5rem, 2.5vw + .5rem, 2.25rem); }
.page-title { font-size: clamp(1.75rem, 3vw + .75rem, 3rem); }

/* Hero padding tightening on mobile */
@media (max-width: 640px) { .hero { padding-top: 2.5rem !important; padding-bottom: 2rem !important; } }

/* Generic cards, grids, lists and code blocks */
.section-subtitle { text-align: center; color: var(--text-secondary); font-size: 1.1rem; margin: .5rem auto 2rem; max-width: 900px; }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
@media (max-width: 768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.list-clean { margin-left: 1.25rem; }
.list-clean li { margin: .35rem 0; padding-left: .2rem; color: var(--text-secondary); }
pre.code { background: #0b0b0c; color: #e5e7eb; border: 1px solid var(--border); border-radius: 10px; padding: .9rem; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: .9rem; }

/* Feature items */
.features-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
@media (max-width: 1024px) { .features-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .features-grid { grid-template-columns: 1fr; } }
.feature { display: flex; gap: .9rem; align-items: flex-start; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; }
.feature-icon { display: inline-flex; width: 36px; height: 36px; border-radius: 8px; align-items: center; justify-content: center; color: var(--accent); background: rgba(0,113,227,0.12); border: 1px solid rgba(0,113,227,0.25); }
.feature-icon svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }
.feature h3 { margin: .1rem 0 .25rem 0; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--text-secondary); font-size: .95rem; }

.divider { height: 1px; background: var(--border); margin: 2rem 0; }
.cta-row { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; margin: 2rem 0; }
.note { color: var(--text-secondary); font-size: .95rem; }
