/* AI Wedding Calc - Main Stylesheet */
/* Design: Modern, clean, wedding-appropriate with blush/gold/ivory palette */
/* Mobile-first responsive design optimized for Core Web Vitals */

:root {
  /* Primary Colors */
  --primary: #b76e79;
  --primary-light: #d4a0a7;
  --primary-dark: #8f4f5a;
  --primary-bg: #fdf6f7;

  /* Accent Colors */
  --accent: #c9a96e;
  --accent-light: #e8d5a8;
  --accent-dark: #a68b4b;

  /* Neutral Colors */
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;

  /* Semantic */
  --success: #4caf50;
  --warning: #ff9800;
  --error: #e53935;
  --info: #2196f3;

  /* AI Feature */
  --ai-gradient: linear-gradient(135deg, #b76e79 0%, #c9a96e 100%);
  --ai-glow: 0 0 20px rgba(183, 110, 121, 0.15);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Borders */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); line-height: 1.3; color: var(--gray-900); }

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* =================== HEADER =================== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  gap: var(--space-lg);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--ai-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
}

/* Navigation */
.main-nav { display: none; }
.main-nav.active { display: flex; }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-xl);
  align-items: center;
}

.main-nav a {
  color: var(--gray-600);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.main-nav a:hover { color: var(--primary); }

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--gray-700);
  transition: var(--transition-base);
  border-radius: 2px;
}

/* Mobile Nav */
@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
  }
  .main-nav.active { display: block; }
  .main-nav ul { flex-direction: column; gap: var(--space-md); }
  .nav-toggle { display: flex; }
}

@media (min-width: 769px) {
  .nav-toggle { display: none; }
  .main-nav { display: flex !important; }
}

/* =================== HERO =================== */
.hero {
  background: var(--primary-bg);
  padding: var(--space-3xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(183,110,121,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(201,169,110,0.06) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content { position: relative; z-index: 1; }

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: var(--space-md);
  color: var(--gray-900);
}

.hero h1 .highlight {
  background: var(--ai-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--gray-600);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--ai-gradient);
  color: white;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

/* =================== TOOL CARDS =================== */
.tools-section {
  padding: var(--space-3xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-header h2 {
  font-size: 1.8rem;
  margin-bottom: var(--space-sm);
}

.section-header p {
  color: var(--gray-500);
  font-size: 1rem;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.category-tab {
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.category-tab:hover,
.category-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 640px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .tools-grid { grid-template-columns: repeat(3, 1fr); } }

.tool-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.tool-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  color: inherit;
}

.tool-card-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-bg);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: var(--space-md);
}

.tool-card h3 {
  font-size: 1.05rem;
  margin-bottom: var(--space-sm);
  font-family: var(--font-primary);
  font-weight: 600;
}

.tool-card p {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: var(--space-md);
  flex: 1;
}

.tool-card .arrow {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.tool-card .arrow::after {
  content: '→';
  transition: transform var(--transition-fast);
}

.tool-card:hover .arrow::after {
  transform: translateX(4px);
}

/* =================== CALCULATOR TOOL PAGE =================== */
.tool-hero {
  background: var(--primary-bg);
  padding: var(--space-2xl) 0 var(--space-xl);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--gray-400); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep::before { content: '/'; }

.tool-hero h1 {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.tool-hero .subtitle {
  color: var(--gray-500);
  font-size: 1rem;
}

/* Calculator Layout */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  padding: var(--space-2xl) 0;
}

@media (min-width: 960px) {
  .calc-layout {
    grid-template-columns: 1fr 380px;
  }
}

/* Calculator Form */
.calc-form {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.calc-form h2 {
  font-size: 1.2rem;
  margin-bottom: var(--space-lg);
  font-family: var(--font-primary);
  font-weight: 600;
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-xs);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: var(--font-primary);
  color: var(--gray-800);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  background: var(--white);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(183,110,121,0.1);
}

.form-group input::placeholder {
  color: var(--gray-400);
}

.calc-btn {
  width: 100%;
  padding: 1rem;
  background: var(--ai-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.calc-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.calc-btn:active {
  transform: translateY(0);
}

/* Results Panel */
.calc-results {
  position: relative;
}

.results-panel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  position: sticky;
  top: 80px;
}

.results-panel h2 {
  font-size: 1.2rem;
  margin-bottom: var(--space-lg);
  font-family: var(--font-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.result-total {
  text-align: center;
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: var(--space-lg);
}

.result-total .amount {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
}

.result-total .label {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-top: var(--space-xs);
}

/* Breakdown Items */
.breakdown-list {
  list-style: none;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--gray-100);
}

.breakdown-item:last-child { border-bottom: none; }

.breakdown-item .name {
  font-size: 0.9rem;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.breakdown-item .name .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-light);
}

.breakdown-item .value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-800);
}

.breakdown-item .pct {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-left: var(--space-xs);
}

/* Progress bar for breakdown */
.breakdown-bar {
  height: 6px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  margin-top: var(--space-xs);
  overflow: hidden;
}

.breakdown-bar-fill {
  height: 100%;
  background: var(--ai-gradient);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* AI Suggestions Box */
.ai-suggestion {
  background: linear-gradient(135deg, rgba(183,110,121,0.05) 0%, rgba(201,169,110,0.05) 100%);
  border: 1px solid rgba(183,110,121,0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
}

.ai-suggestion-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-dark);
}

.ai-suggestion-header .ai-icon {
  width: 28px;
  height: 28px;
  background: var(--ai-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
}

.ai-suggestion ul {
  list-style: none;
  padding: 0;
}

.ai-suggestion li {
  font-size: 0.85rem;
  color: var(--gray-600);
  padding: var(--space-xs) 0;
  padding-left: var(--space-lg);
  position: relative;
  line-height: 1.5;
}

.ai-suggestion li::before {
  content: '💡';
  position: absolute;
  left: 0;
  font-size: 0.75rem;
}

/* =================== FAQ SECTION =================== */
.faq-section {
  padding: var(--space-2xl) 0;
}

.faq-section h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-xl);
  text-align: center;
}

.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: var(--space-lg);
  background: var(--gray-50);
  border: none;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-800);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-primary);
  transition: background var(--transition-fast);
}

.faq-question:hover { background: var(--gray-100); }

.faq-question .icon {
  font-size: 1.2rem;
  color: var(--primary);
  transition: transform var(--transition-base);
  flex-shrink: 0;
  margin-left: var(--space-md);
}

.faq-item.active .faq-question .icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

.faq-answer-inner {
  padding: var(--space-lg);
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.6;
}

/* =================== RELATED TOOLS =================== */
.related-tools {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--gray-200);
}

.related-tools h2 {
  font-size: 1.3rem;
  margin-bottom: var(--space-lg);
}

/* =================== FOOTER =================== */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }

.footer-about .logo {
  color: white;
  margin-bottom: var(--space-md);
}

.footer-about p {
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer-col h4 {
  color: white;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: var(--space-sm);
}

.footer-col a {
  color: var(--gray-400);
  font-size: 0.85rem;
  transition: color var(--transition-fast);
}

.footer-col a:hover { color: var(--primary-light); }

.footer-bottom {
  border-top: 1px solid var(--gray-700);
  padding-top: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 0.8rem;
}

/* =================== AD SLOTS (Hidden by default) =================== */
.ad-slot {
  display: none; /* Hidden until ads are enabled */
  background: var(--gray-50);
  border: 1px dashed var(--gray-200);
  border-radius: var(--radius-md);
  min-height: 90px;
  margin: var(--space-lg) 0;
  text-align: center;
  line-height: 90px;
  color: var(--gray-300);
  font-size: 0.8rem;
}

/* When ads are enabled via JS, this class is added */
.ads-enabled .ad-slot {
  display: block;
}

.ad-slot-sidebar {
  min-height: 250px;
  line-height: 250px;
}

.ad-slot-content {
  min-height: 90px;
  line-height: 90px;
}

.ad-slot-footer {
  min-height: 90px;
  line-height: 90px;
}

/* =================== LOADING STATE =================== */
.calc-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-xl);
  color: var(--primary);
  font-size: 0.9rem;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =================== PRINT STYLES =================== */
@media print {
  .site-header, .site-footer, .ad-slot, .ai-suggestion, .nav-toggle { display: none !important; }
  .calc-results { position: static; }
  body { font-size: 12pt; }
}

/* =================== ACCESSIBILITY =================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* =================== HOME PAGE SPECIFIC =================== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  padding: var(--space-xl) 0;
}

@media (min-width: 640px) { .stats-bar { grid-template-columns: repeat(4, 1fr); } }

.stat-item {
  text-align: center;
  padding: var(--space-lg);
}

.stat-item .number {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-item .label {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: var(--space-xs);
}

/* CTA Section */
.cta-section {
  background: var(--primary-bg);
  padding: var(--space-3xl) 0;
  text-align: center;
}

.cta-section h2 {
  font-size: 1.8rem;
  margin-bottom: var(--space-md);
}

.cta-section p {
  color: var(--gray-500);
  margin-bottom: var(--space-xl);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* =================== ANIMATIONS =================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.5s ease forwards;
}

/* =================== SCHEMA-DRIVEN RICH RESULTS =================== */
.schema-only { display: none; }
