/**
 * PriceDepth Global Styles
 * Design tokens, reset, typography, nav, buttons, container, and utility classes.
 */

/* ── Design Tokens ── */
:root {
  /* Brand Colors */
  --color-primary: #0F3D2E;
  --color-primary-dark: #0a2a1f;
  --color-accent: #C9A24B;
  --color-accent-light: #D9C88A;
  --color-accent-border: #E8DDB8;
  --color-accent-bg: #F5EFE4;

  /* Neutrals */
  --color-text: #0f172a;
  --color-text-secondary: #334155;
  --color-text-muted: #64748b;
  --color-text-faint: #717784;
  --color-bg: #fff;
  --color-bg-alt: #f8fafc;
  --color-bg-dark: #0f172a;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;

  /* Semantic */
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --color-danger-light: #ef4444;

  /* Gold Accent System */
  --color-gold: #C9A24B;
  --color-gold-light: #D9C88A;
  --color-gold-dark: #8B6914;
  --color-gold-bg: rgba(201,162,75,0.08);
  --color-gold-border: rgba(201,162,75,0.3);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 32px;
  --text-4xl: 38px;
  --text-5xl: 48px;

  /* Spacing */
  --space-section: 80px;
  --space-section-sm: 48px;
  --space-section-lg: 120px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.1);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
  --shadow-primary: 0 4px 14px rgba(15,61,46,0.35);
  --shadow-primary-hover: 0 6px 20px rgba(15,61,46,0.45);

  /* Transitions */
  --ease-fast: 150ms ease;
  --ease-normal: 250ms ease;
  --ease-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Base Typography ── */
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg-alt);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a {
  text-decoration: none;
  color: inherit;
  transition: color var(--ease-fast);
}

/* ── Container ── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ── Nav ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.nav-logo span { color: var(--color-primary); }
.nav-links { display: flex; gap: 36px; align-items: center; }
.nav-links a {
  font-size: var(--text-base);
  font-weight: 500;
  color: #475569;
  transition: color var(--ease-fast);
}
.nav-links a:hover { color: var(--color-primary); }
.nav-links a.active { color: var(--color-primary); }
.nav-cta .btn { padding: 10px 24px; font-size: 14px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--ease-normal);
  border: none;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.btn-sm { padding: 8px 16px; font-size: var(--text-sm); }
.btn-lg { padding: 16px 36px; font-size: 17px; }
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-primary-hover);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-accent-border);
}
.btn-outline:hover {
  border-color: var(--color-primary);
  background: var(--color-accent-bg);
}
.btn-outline-gold {
  background: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}
.btn-outline-gold:hover {
  background: var(--color-accent);
  color: #fff;
}
.btn-outline-gold:active { transform: scale(0.97); }
.btn-outline-gold:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ── Cards (shared component) ── */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--ease-normal);
}
.card:hover {
  border-color: var(--color-accent-light);
  box-shadow: 0 12px 40px rgba(15,61,46,0.08);
}

/* ── Footer ── */
.footer { background: var(--color-bg-dark); color: var(--color-text-faint); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-bottom span {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ── Section Animations ── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* ── Accessibility ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 200;
  background: var(--color-primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* =====================================================
   CUSTOM MODAL SYSTEM (js/modal.js)
   ===================================================== */
.pd-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: background 0.2s ease, opacity 0.2s ease;
}
.pd-modal-overlay.pd-modal-open {
  background: rgba(0, 0, 0, 0.5);
  opacity: 1;
  pointer-events: auto;
}
.pd-modal-overlay.pd-modal-closing {
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  pointer-events: none;
}
.pd-modal-card {
  background: #fff;
  border-radius: var(--radius-lg, 16px);
  width: 420px;
  max-width: 90vw;
  padding: 28px 28px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.pd-modal-open .pd-modal-card {
  transform: translateY(0) scale(1);
}
.pd-modal-closing .pd-modal-card {
  transform: translateY(20px) scale(0.96);
}
.pd-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text, #0f172a);
  margin-bottom: 8px;
}
.pd-modal-message {
  font-size: 14px;
  color: var(--color-text-muted, #64748b);
  line-height: 1.5;
  margin-bottom: 20px;
}
.pd-modal-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  font-size: 14px;
  font-family: var(--font-sans, inherit);
  margin-bottom: 20px;
  outline: none;
  transition: border-color 0.15s;
}
.pd-modal-input:focus {
  border-color: var(--color-primary, #0F3D2E);
  box-shadow: 0 0 0 3px rgba(15,61,46,0.12);
}
.pd-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.pd-modal-btn {
  padding: 10px 22px;
  border-radius: var(--radius-sm, 8px);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans, inherit);
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.pd-modal-btn:focus-visible {
  outline: 2px solid var(--color-primary, #0F3D2E);
  outline-offset: 2px;
}
.pd-modal-btn-cancel {
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
  color: var(--color-text-muted, #64748b);
}
.pd-modal-btn-cancel:hover {
  background: var(--color-bg-alt, #f8fafc);
  border-color: var(--color-text-muted, #64748b);
}
.pd-modal-btn-primary {
  background: var(--color-accent, #C9A24B);
  color: #0f172a;
}
.pd-modal-btn-primary:hover {
  background: #b8903f;
}

/* =====================================================
   SKELETON LOADER SYSTEM (js/skeleton.js)
   ===================================================== */
@keyframes pd-shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.pd-skeleton-block,
.pd-skeleton-line {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 400px 100%;
  animation: pd-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}
.pd-skeleton-block {
  display: block;
}
.pd-skeleton-line {
  height: 14px;
  margin-bottom: 8px;
}
.pd-skeleton-wrapper {
  padding: 20px;
}
/* Stat cards */
.pd-skeleton-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px 32px;
}
.pd-skeleton-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 20px;
}
/* Chart */
.pd-skeleton-chart-wrap { padding: 0; }
.pd-skeleton-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
}
.pd-skeleton-chart-periods {
  display: flex;
  gap: 6px;
}
.pd-skeleton-chart-area {
  height: 200px;
  padding: 0 32px 16px;
  position: relative;
}
.pd-skeleton-chart-svg {
  width: 100%;
  height: 100%;
}
.pd-skeleton-chart-path {
  fill: #e2e8f0;
  opacity: 0.5;
  animation: pd-shimmer 1.5s ease-in-out infinite;
}
/* Table */
.pd-skeleton-table { padding: 0 32px 32px; }
.pd-skeleton-table-header {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
}
.pd-skeleton-table-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid #f1f5f9;
}
.pd-skeleton-table-info { flex: 1; }
/* Cards */
.pd-skeleton-cards { padding: 0 32px 32px; }
.pd-skeleton-card-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #f1f5f9;
}
.pd-skeleton-card-info { flex: 1; min-width: 0; }
.pd-skeleton-card-values { min-width: 80px; text-align: right; }
/* Donut */
.pd-skeleton-donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px;
}
.pd-skeleton-donut {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 400px 100%;
  animation: pd-shimmer 1.5s ease-in-out infinite;
  flex-shrink: 0;
  position: relative;
}
.pd-skeleton-donut::after {
  content: '';
  position: absolute;
  top: 35%;
  left: 35%;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: #fff;
}
.pd-skeleton-donut-legend { flex: 1; }
.pd-skeleton-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
@media (max-width: 768px) {
  .pd-skeleton-stats { grid-template-columns: repeat(2, 1fr); }
  .pd-skeleton-donut-wrap { flex-direction: column; }
}

/* =====================================================
   GLOBAL SEARCH (js/global-search.js)
   ===================================================== */
.pd-global-search {
  position: relative;
  flex: 0 1 340px;
  margin: 0 16px;
}
.pd-gs-input-wrap {
  position: relative;
}
.pd-gs-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted, #64748b);
  pointer-events: none;
}
.pd-gs-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  font-size: 14px;
  font-family: var(--font-sans, inherit);
  background: var(--color-bg-alt, #f8fafc);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.pd-gs-input:focus {
  border-color: var(--color-primary, #0F3D2E);
  box-shadow: 0 0 0 3px rgba(15,61,46,0.12);
  background: #fff;
}
.pd-gs-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  z-index: 1000;
  max-height: 360px;
  overflow-y: auto;
  display: none;
}
.pd-gs-dropdown.pd-gs-visible { display: block; }
.pd-gs-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.1s;
}
.pd-gs-result:hover,
.pd-gs-result.pd-gs-active {
  background: var(--color-bg-alt, #f8fafc);
}
.pd-gs-thumb {
  width: 36px;
  height: 50px;
  object-fit: contain;
  border-radius: 4px;
  background: #f1f5f9;
  flex-shrink: 0;
}
.pd-gs-thumb-placeholder {
  width: 36px;
  height: 50px;
  border-radius: 4px;
  background: #e2e8f0;
  flex-shrink: 0;
}
.pd-gs-info { flex: 1; min-width: 0; }
.pd-gs-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pd-gs-meta {
  font-size: 11px;
  color: var(--color-text-muted, #64748b);
  margin-top: 2px;
}
.pd-gs-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary, #0F3D2E);
  flex-shrink: 0;
}
.pd-gs-empty {
  padding: 20px 14px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted, #64748b);
}
.pd-gs-view-all {
  display: block;
  padding: 10px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary, #0F3D2E);
  border-top: 1px solid var(--color-border-light, #f1f5f9);
  transition: background 0.1s;
}
.pd-gs-view-all:hover { background: var(--color-bg-alt, #f8fafc); }

/* ── Dark-mode overrides for skeleton loaders ── */
html[data-theme="dark"] .pd-skeleton-block,
html[data-theme="dark"] .pd-skeleton-line {
  background: linear-gradient(90deg, #161b22 25%, #21262d 50%, #161b22 75%);
  background-size: 400px 100%;
}
html[data-theme="dark"] .pd-skeleton-stat-card { background: #161b22; border-color: #21262d; }
html[data-theme="dark"] .pd-skeleton-chart-path { fill: #21262d; }
html[data-theme="dark"] .pd-skeleton-table-header { border-color: #21262d; }
html[data-theme="dark"] .pd-skeleton-table-row,
html[data-theme="dark"] .pd-skeleton-card-row { border-color: #21262d; }
html[data-theme="dark"] .pd-skeleton-donut {
  background: linear-gradient(90deg, #161b22 25%, #21262d 50%, #161b22 75%);
  background-size: 400px 100%;
}
html[data-theme="dark"] .pd-skeleton-donut::after { background: #0a0e17; }

/* ── Dark-mode overrides for global search ── */
html[data-theme="dark"] .pd-gs-input {
  background: #161b22; border-color: #30363d; color: #f0f6fc;
}
html[data-theme="dark"] .pd-gs-input:focus {
  border-color: #00d4aa; box-shadow: 0 0 0 3px rgba(0,212,170,0.12); background: #161b22;
}
html[data-theme="dark"] .pd-gs-dropdown {
  background: #161b22; border-color: #30363d; box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
html[data-theme="dark"] .pd-gs-result:hover,
html[data-theme="dark"] .pd-gs-result.pd-gs-active { background: #21262d; }
html[data-theme="dark"] .pd-gs-name { color: #f0f6fc; }
html[data-theme="dark"] .pd-gs-price { color: #00d4aa; }
html[data-theme="dark"] .pd-gs-thumb-placeholder { background: #21262d; }
html[data-theme="dark"] .pd-gs-thumb { background: #21262d; }
html[data-theme="dark"] .pd-gs-view-all { color: #00d4aa; border-color: #21262d; }
html[data-theme="dark"] .pd-gs-view-all:hover { background: #21262d; }

@media (max-width: 600px) {
  .pd-global-search {
    flex: 1 1 100%;
    margin: 0 8px;
    order: 10;
  }
}

/* =====================================================
   UPGRADE BANNER
   ===================================================== */
.pd-upgrade-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md, 12px);
  margin: 16px 32px 0;
  font-size: 14px;
  color: #92400e;
}
.pd-upgrade-text { flex: 1; line-height: 1.4; }
.pd-upgrade-text strong { font-weight: 700; }
.pd-upgrade-progress {
  width: 120px;
  height: 6px;
  background: #fde68a;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.pd-upgrade-progress-fill {
  height: 100%;
  background: #f59e0b;
  border-radius: 3px;
  transition: width 0.3s;
}
.pd-upgrade-cta {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  background: #f59e0b;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  border: none;
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  font-family: var(--font-sans, inherit);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s;
}
.pd-upgrade-cta:hover { background: #d97706; }
.pd-upgrade-dismiss {
  background: none;
  border: none;
  color: #b45309;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
}
.pd-upgrade-dismiss:hover { color: #92400e; }
@media (max-width: 768px) {
  .pd-upgrade-banner {
    margin: 12px 16px 0;
    flex-wrap: wrap;
  }
  .pd-upgrade-progress { width: 100%; order: 10; }
}

/* =====================================================
   ONBOARDING CHECKLIST
   ===================================================== */
.pd-onboarding-checklist {
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-lg, 16px);
  padding: 24px;
  margin: 16px 32px 0;
  position: relative;
}
.pd-onboarding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.pd-onboarding-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text, #0f172a);
}
.pd-onboarding-dismiss {
  background: none;
  border: none;
  color: var(--color-text-muted, #64748b);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
}
.pd-onboarding-dismiss:hover { color: var(--color-text, #0f172a); }
.pd-onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pd-onboarding-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--color-border-light, #f1f5f9);
  border-radius: var(--radius-sm, 8px);
  font-size: 14px;
  color: var(--color-text-secondary, #334155);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.pd-onboarding-step:hover {
  border-color: var(--color-primary, #0F3D2E);
  background: rgba(15,61,46,0.03);
}
.pd-onboarding-step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-bg-alt, #f8fafc);
  border: 2px solid var(--color-border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted, #64748b);
}
.pd-onboarding-step.completed .pd-onboarding-step-icon {
  background: var(--color-primary, #0F3D2E);
  border-color: var(--color-primary, #0F3D2E);
  color: #fff;
}
.pd-onboarding-step.completed {
  color: var(--color-text-muted, #64748b);
  text-decoration: line-through;
}
.pd-onboarding-step-text { flex: 1; font-weight: 500; }
.pd-onboarding-step-arrow {
  color: var(--color-text-faint, #94a3b8);
  font-size: 16px;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .pd-onboarding-checklist { margin: 12px 16px 0; }
}

/* =====================================================
   GOLD ACCENT SYSTEM
   ===================================================== */

/* Gold gradient for premium elements */
.accent-gold {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
  color: var(--color-text);
}

/* Premium badge */
.badge-premium {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-gold-dark);
  background: linear-gradient(135deg, rgba(201,162,75,0.15) 0%, rgba(217,200,138,0.15) 100%);
  border: 1px solid var(--color-gold-border);
  border-radius: 20px;
}

/* Gold border/glow for highlighted cards */
.card-gold-highlight {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 1px rgba(201,162,75,0.2), 0 4px 16px rgba(201,162,75,0.1);
}

/* Price direction */
.price-up { color: var(--color-success); }
.price-down { color: var(--color-danger); }

/* Gold shimmer animation for loading states */
@keyframes goldShimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.shimmer-gold {
  background: linear-gradient(
    90deg,
    var(--color-gold) 0%,
    var(--color-gold-light) 40%,
    var(--color-gold) 60%,
    var(--color-gold-dark) 100%
  );
  background-size: 200% auto;
  animation: goldShimmer 2s linear infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =====================================================
   COMPREHENSIVE MOBILE RESPONSIVENESS
   Covers 320px (iPhone SE), 375px (iPhone 12/13/14),
   414px (iPhone Plus), 428px (iPhone Pro Max)
   ===================================================== */

/* -- Base mobile resets -- */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}
img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}
table {
  max-width: 100%;
}
pre, code {
  word-wrap: break-word;
  overflow-wrap: break-word;
}
pre {
  white-space: pre-wrap;
  word-break: break-all;
}

/* -- Container tightening for narrow screens -- */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
}
@media (max-width: 360px) {
  .container {
    padding: 0 12px;
  }
}

/* -- Nav mobile fixes -- */
@media (max-width: 768px) {
  .nav-inner {
    height: 56px;
    padding: 0 8px;
  }
  .nav-logo {
    font-size: 18px;
  }
  .nav-links {
    gap: 16px;
  }
  .nav-links a {
    font-size: 14px;
  }
}

/* -- Button touch targets (min 44x44px) -- */
@media (max-width: 768px) {
  .btn {
    min-height: 44px;
    padding: 12px 24px;
    font-size: 15px;
  }
  .btn-sm {
    min-height: 44px;
    padding: 10px 16px;
  }
  .btn-lg {
    padding: 14px 28px;
    font-size: 16px;
  }
}
@media (max-width: 360px) {
  .btn {
    padding: 12px 16px;
    font-size: 14px;
    width: 100%;
    justify-content: center;
  }
  .btn-lg {
    padding: 14px 20px;
    font-size: 15px;
  }
}

/* -- Footer mobile stacking -- */
@media (max-width: 480px) {
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 20px 16px;
  }
  .footer-bottom span {
    font-size: 12px;
  }
  .footer-bottom a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* -- Modal mobile safety -- */
@media (max-width: 480px) {
  .pd-modal-card {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    padding: 20px 16px;
    margin: 16px;
    border-radius: 12px;
  }
  .pd-modal-title {
    font-size: 16px;
  }
  .pd-modal-message {
    font-size: 13px;
  }
  .pd-modal-actions {
    flex-direction: column;
  }
  .pd-modal-btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    text-align: center;
  }
}

/* -- Skeleton loader mobile -- */
@media (max-width: 480px) {
  .pd-skeleton-stats {
    grid-template-columns: 1fr 1fr;
    padding: 16px;
    gap: 12px;
  }
  .pd-skeleton-chart-header {
    padding: 12px 16px;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  .pd-skeleton-table {
    padding: 0 16px 16px;
  }
  .pd-skeleton-cards {
    padding: 0 16px 16px;
  }
  .pd-skeleton-donut-wrap {
    flex-direction: column;
    padding: 16px;
    gap: 16px;
  }
  .pd-skeleton-donut {
    width: 140px;
    height: 140px;
  }
}

/* -- Global search mobile -- */
@media (max-width: 480px) {
  .pd-global-search {
    flex: 1 1 100%;
    margin: 8px 0;
    order: 10;
  }
  .pd-gs-dropdown {
    max-height: 280px;
  }
}

/* -- Upgrade banner mobile -- */
@media (max-width: 480px) {
  .pd-upgrade-banner {
    margin: 8px 12px 0;
    padding: 12px 14px;
    font-size: 13px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .pd-upgrade-progress {
    width: 100%;
  }
  .pd-upgrade-cta {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* -- Skip link mobile -- */
@media (max-width: 480px) {
  .skip-link {
    font-size: 13px;
    padding: 10px 16px;
  }
}

/* -- Card component mobile -- */
@media (max-width: 480px) {
  .card {
    padding: 20px 16px;
    border-radius: 12px;
  }
}

/* =====================================================
   DARK MODE OVERRIDES — html[data-theme="dark"]
   Modal, Onboarding, Upgrade Banner, Skeletons
   ===================================================== */

/* ── Modal System ── */
html[data-theme="dark"] .pd-modal-card {
  background: #161b22;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
html[data-theme="dark"] .pd-modal-title { color: #f0f6fc; }
html[data-theme="dark"] .pd-modal-message { color: #8b949e; }
html[data-theme="dark"] .pd-modal-input {
  background: #0d1117;
  border-color: #30363d;
  color: #f0f6fc;
}
html[data-theme="dark"] .pd-modal-input:focus {
  border-color: #1a8a6e;
  box-shadow: 0 0 0 3px rgba(26,138,110,0.15);
}
html[data-theme="dark"] .pd-modal-btn-cancel {
  background: #21262d;
  border-color: #30363d;
  color: #c9d1d9;
}
html[data-theme="dark"] .pd-modal-btn-cancel:hover {
  background: #30363d;
  border-color: #484f58;
}
html[data-theme="dark"] .pd-modal-btn-primary {
  background: #d4a853;
  color: #0d1117;
}
html[data-theme="dark"] .pd-modal-btn-primary:hover {
  background: #c49a48;
}

/* ── Onboarding Checklist ── */
html[data-theme="dark"] .pd-onboarding-checklist {
  background: #161b22;
  border-color: #30363d;
}
html[data-theme="dark"] .pd-onboarding-header h3 { color: #f0f6fc; }
html[data-theme="dark"] .pd-onboarding-dismiss { color: #8b949e; }
html[data-theme="dark"] .pd-onboarding-dismiss:hover { color: #f0f6fc; }
html[data-theme="dark"] .pd-onboarding-step {
  border-color: #21262d;
  color: #c9d1d9;
}
html[data-theme="dark"] .pd-onboarding-step:hover {
  border-color: #1a8a6e;
  background: rgba(26,138,110,0.05);
}
html[data-theme="dark"] .pd-onboarding-step-icon {
  background: #21262d;
  border-color: #30363d;
  color: #8b949e;
}
html[data-theme="dark"] .pd-onboarding-step.completed .pd-onboarding-step-icon {
  background: #1a8a6e;
  border-color: #1a8a6e;
  color: #fff;
}
html[data-theme="dark"] .pd-onboarding-step.completed { color: #6e7681; }
html[data-theme="dark"] .pd-onboarding-step-arrow { color: #6e7681; }

/* ── Upgrade Banner ── */
html[data-theme="dark"] .pd-upgrade-banner {
  background: linear-gradient(135deg, rgba(212,168,83,0.1) 0%, rgba(212,168,83,0.05) 100%);
  border-color: rgba(212,168,83,0.3);
  color: #d4a853;
}
html[data-theme="dark"] .pd-upgrade-progress {
  background: #21262d;
}
html[data-theme="dark"] .pd-upgrade-progress-fill {
  background: #d4a853;
}
html[data-theme="dark"] .pd-upgrade-cta {
  background: #d4a853;
  color: #0d1117;
}
html[data-theme="dark"] .pd-upgrade-cta:hover {
  background: #c49a48;
}
html[data-theme="dark"] .pd-upgrade-dismiss { color: #8b949e; }
html[data-theme="dark"] .pd-upgrade-dismiss:hover { color: #f0f6fc; }

/* ── Skeleton Loaders (mirrors html[data-theme="dark"] rules) ── */
html[data-theme="dark"] .pd-skeleton-block,
html[data-theme="dark"] .pd-skeleton-line {
  background: linear-gradient(90deg, #161b22 25%, #21262d 50%, #161b22 75%);
  background-size: 400px 100%;
}
html[data-theme="dark"] .pd-skeleton-stat-card {
  background: #161b22;
  border-color: #21262d;
}
html[data-theme="dark"] .pd-skeleton-chart-path { fill: #21262d; }
html[data-theme="dark"] .pd-skeleton-table-header { border-color: #21262d; }
html[data-theme="dark"] .pd-skeleton-table-row,
html[data-theme="dark"] .pd-skeleton-card-row { border-color: #21262d; }
html[data-theme="dark"] .pd-skeleton-donut {
  background: linear-gradient(90deg, #161b22 25%, #21262d 50%, #161b22 75%);
  background-size: 400px 100%;
}
html[data-theme="dark"] .pd-skeleton-donut::after { background: #0d1117; }
