/**
 * Gold Saving & Redemption — Premium Fintech Theme
 * โทนสีทองพรีเมียม + Charcoal + Off-white, Glassmorphism, Soft Shadows
 */

:root {
  /* Premium Gold Palette */
  --gold-light: #F6E7C1;
  --gold: #E8C547;
  --gold-mid: #D4A84B;
  --gold-deep: #B8860B;
  --gold-gradient: linear-gradient(135deg, #F6E7C1 0%, #E8C547 35%, #D4A84B 70%, #B8860B 100%);
  --gold-gradient-dark: linear-gradient(145deg, #1F2937 0%, #374151 40%, #4B5563 100%);
  --gold-gradient-card: linear-gradient(160deg, rgba(184, 134, 11, 0.15) 0%, rgba(31, 41, 55, 0.95) 60%);

  /* Brand (คง ID เดิม) */
  --primary: #E8C547;
  --primary-dark: #D4A84B;
  --primary-hover: #B8860B;
  --soft-gold: #F6E7C1;
  --soft-gold-bg: rgba(246, 231, 193, 0.25);

  /* Neutrals — Off-white + Charcoal */
  --charcoal: #1F2937;
  --charcoal-light: #374151;
  --off-white: #FAFAF9;
  --light-bg: #F5F5F4;
  --border: #E7E5E4;
  --white: #FFFFFF;

  /* Status */
  --success: #22C55E;
  --success-light: rgba(34, 197, 94, 0.15);
  --danger: #EF4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --warning: #F59E0B;
  --warning-light: rgba(245, 158, 11, 0.15);
  --info: #3B82F6;
  --info-light: rgba(59, 130, 246, 0.15);
  --price-up: #22C55E;
  --price-down: #EF4444;

  /* Typography — 2025 premium hierarchy (Sarabun) */
  --font-sans: "Sarabun", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-primary: var(--charcoal);
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --text-subtle: #9CA3AF;
  --line-tight: 1.25;
  --line-normal: 1.5;
  --line-relaxed: 1.6;
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  /* Scale */
  --text-display: clamp(1.75rem, 4vw, 2.25rem);
  --text-h1: 1.5rem;
  --text-h2: 1.25rem;
  --text-h3: 1.125rem;
  --text-h4: 1rem;
  --text-body: 0.9375rem;
  --text-body-sm: 0.875rem;
  --text-caption: 0.8125rem;
  --text-overline: 0.75rem;
  /* Legacy aliases */
  --h1-size: var(--text-h1);
  --h2-size: var(--text-h2);
  --h3-size: var(--text-h3);

  /* Spacing */
  --navbar-height: 56px;
  --bottom-nav-height: 64px;
  --sidebar-width: 272px;

  /* Navigation design system — premium app shell */
  --nav-bg: #FDFBF8;
  --nav-border: rgba(231, 229, 228, 0.8);
  --nav-item-height: 44px;
  --nav-item-px: 1.25rem;
  --nav-item-gap: 0.75rem;
  --nav-icon-size: 20px;
  --nav-text: #4B5563;
  --nav-text-hover: #1F2937;
  --nav-active-bg: rgba(246, 231, 193, 0.45);
  --nav-active-border: 3px solid var(--gold-mid);
  --nav-active-text: var(--gold-deep);
  --nav-hover-bg: rgba(246, 231, 193, 0.2);
  --nav-radius: var(--radius);
  --nav-transition: 0.2s ease;
  --sidebar-header-border: rgba(212, 168, 75, 0.12);
  --topbar-bg: #FFFFFF;
  --topbar-border: var(--border);
  --breadcrumb-link: var(--text-muted);
  --breadcrumb-active: var(--charcoal);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-blur: 12px;
  --glass-shadow: 0 8px 32px rgba(31, 41, 55, 0.08);

  /* Shadow scale — 2025 layered quality (luxury fintech) */
  --shadow-xs: 0 1px 2px rgba(31, 41, 55, 0.04);
  --shadow-sm: 0 2px 6px rgba(31, 41, 55, 0.05), 0 1px 2px rgba(31, 41, 55, 0.03);
  --shadow-soft: 0 4px 12px rgba(31, 41, 55, 0.06), 0 2px 4px rgba(31, 41, 55, 0.04);
  --shadow-soft-md: 0 12px 28px rgba(31, 41, 55, 0.08), 0 4px 8px rgba(31, 41, 55, 0.04);
  --shadow-soft-lg: 0 20px 44px rgba(31, 41, 55, 0.1), 0 8px 16px rgba(31, 41, 55, 0.05);
  --shadow-elevation: 0 16px 48px rgba(31, 41, 55, 0.1), 0 6px 12px rgba(31, 41, 55, 0.06);
  --shadow-premium: 0 32px 64px rgba(31, 41, 55, 0.12), 0 12px 24px rgba(184, 134, 11, 0.06);
  --shadow-gold: 0 8px 24px rgba(184, 134, 11, 0.18);
  /* Legacy */
  --shadow: var(--shadow-soft);
  --shadow-md: var(--shadow-soft-md);
  --shadow-lg: var(--shadow-soft-lg);

  /* Border radius — consistent scale (2025) */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Section & layout spacing — white space rhythm */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 2.5rem;
  --space-3xl: 3rem;
  --space-4xl: 4rem;
  --section-gap: var(--space-2xl);
  --section-gap-sm: var(--space-lg);
  --content-max: 1200px;
  --content-narrow: 720px;
}

/* Typography Hierarchy — 2025 premium */
h1, .h1 {
  font-size: var(--text-h1);
  font-weight: 700;
  color: var(--text-primary);
  line-height: var(--line-tight);
  letter-spacing: var(--tracking-tight);
}
h2, .h2 {
  font-size: var(--text-h2);
  font-weight: 600;
  color: var(--text-primary);
  line-height: var(--line-tight);
  letter-spacing: var(--tracking-tight);
}
h3, .h3 {
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--text-primary);
  line-height: var(--line-tight);
}
h4, .h4 {
  font-size: var(--text-h4);
  font-weight: 600;
  color: var(--text-primary);
}
p, .text-body {
  font-size: var(--text-body);
  line-height: var(--line-normal);
  color: var(--text-secondary);
}
small, .text-caption {
  font-size: var(--text-caption);
  color: var(--text-muted);
  line-height: var(--line-normal);
}
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-display {
  font-size: var(--text-display);
  font-weight: 700;
  line-height: var(--line-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}
.text-lead {
  font-size: var(--text-body);
  line-height: var(--line-relaxed);
  color: var(--text-secondary);
}
body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  color: var(--text-primary);
  background-color: var(--off-white);
  line-height: var(--line-normal);
  -webkit-font-smoothing: antialiased;
}

/* Buttons — premium 2025 */
.btn {
  font-weight: 600;
  letter-spacing: var(--tracking-normal);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.btn-primary {
  background: var(--gold-gradient);
  border: none;
  color: var(--charcoal);
  font-weight: 600;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0.625rem 1.25rem;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #E8C547 0%, #D4A84B 100%);
  color: var(--charcoal);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}
.btn-outline-primary {
  border-radius: var(--radius);
  border-width: 1.5px;
  font-weight: 600;
}
.btn-outline-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}
.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: var(--text-caption);
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: var(--text-body);
  border-radius: var(--radius);
}

.bg-primary { background: var(--gold-gradient) !important; color: var(--charcoal) !important; }
.text-primary { color: var(--primary-dark) !important; }
.border-primary { border-color: var(--gold-mid) !important; }

.bg-soft-gold { background-color: var(--soft-gold-bg); }
.bg-charcoal { background-color: var(--charcoal) !important; }
.text-charcoal { color: var(--charcoal); }
.object-fit-cover { object-fit: cover; }

.badge.bg-success { background-color: var(--success) !important; }
.badge.bg-danger { background-color: var(--danger) !important; }
.badge.bg-warning { background-color: var(--warning) !important; }

/* Customer layout */
body.customer-layout {
  padding-bottom: var(--bottom-nav-height);
  background-color: var(--off-white);
}

/* Premium form controls — fintech */
.form-control:focus, .form-select:focus {
  border-color: var(--gold-mid);
  box-shadow: 0 0 0 3px rgba(212, 168, 75, 0.25);
}
.form-control-lg, .form-select-lg {
  border-radius: var(--radius);
  font-weight: 500;
}
.form-label { font-weight: 600; color: var(--charcoal); }
.input-group .btn-outline-secondary { border-radius: 0 var(--radius) var(--radius) 0; }
.input-group .form-control:first-child { border-radius: var(--radius) 0 0 var(--radius); }
