/* ============================================
   TEMPLATE CSS - Main Styles
   ============================================ */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  /* Colors - Primary Palette */
  --color-primary: #2563eb;
  --color-secondary: #475569;
  --color-accent: #0ea5e9;
  
  /* Background Colors */
  --color-bg-light: #ffffff;
  --color-bg-dark: #1e293b;
  --color-bg-gray: #f1f5f9;
  
  /* Text Colors */
  --color-text-dark: #0f172a;
  --color-text-light: #ffffff;
  --color-text-muted: #64748b;
  
  /* Border & Lines */
  --color-border: #e2e8f0;
  
  /* Fonts */
  --font-primary: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-heading: var(--font-primary);
  --font-mono: 'Courier New', monospace;
  
  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  
  /* Container Widths */
  --container-narrow: 48rem;
  --container-medium: 64rem;
  --container-wide: 80rem;
  --container-full: 100%;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text-dark);
  background-color: var(--color-bg-light);
  overflow-x: hidden;
}

/* Background Options */
body.bg-fixed {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body.bg-parallax {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5em;
  color: inherit;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin-bottom: 1em;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  margin-bottom: 1em;
  padding-left: 1.5em;
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

/* Containers */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-sm);
  padding-right: var(--space-sm);
}

.container-narrow { max-width: var(--container-narrow); }
.container-medium { max-width: var(--container-medium); }
.container-wide { max-width: var(--container-wide); }
.container-full { max-width: var(--container-full); }

/* Sections */
section {
  position: relative;
}

.section-padding-sm { padding: var(--space-md) 0; }
.section-padding-md { padding: var(--space-lg) 0; }
.section-padding-lg { padding: var(--space-xl) 0; }

/* Partial-width section - content doesn't go edge-to-edge */
.section-contained {
  max-width: var(--container-wide);
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--radius-lg);
}

/* Background Variants */
.bg-light { background-color: var(--color-bg-light); color: var(--color-text-dark); }
.bg-dark { background-color: var(--color-bg-dark); color: var(--color-text-light); }
.bg-gray { background-color: var(--color-bg-gray); color: var(--color-text-dark); }
.bg-primary { background-color: var(--color-primary); color: var(--color-text-light); }

/* Background Image with Overlay */
.bg-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.bg-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.bg-image > * {
  position: relative;
  z-index: 2;
}

/* Overlay opacity variants */
.overlay-light::before { background-color: rgba(0, 0, 0, 0.3); }
.overlay-medium::before { background-color: rgba(0, 0, 0, 0.5); }
.overlay-dark::before { background-color: rgba(0, 0, 0, 0.7); }

/* ============================================
   FLEXBOX GRID SYSTEM
   ============================================ */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

/* Column Widths - Let flexbox handle proportions naturally */
.col { flex: 1 1 0; min-width: 0; }
.col-auto { flex: 0 0 auto; }

/* Equal columns - stack below min-width */
.col-33 { flex: 1 1 250px; }  /* 3 equal columns, stack below 250px */
.col-50 { flex: 1 1 300px; }  /* 2 equal columns, stack below 300px */

/* Proportional columns - use flex-grow ratios */
.col-66 { flex: 2 1 400px; }  /* 2 parts (pair with .col-33 for 66/33 split) */
.col-70 { flex: 7 1 400px; }  /* 7 parts (pair with .col-30 for 70/30 split) */
.col-30 { flex: 3 1 200px; }  /* 3 parts (pair with .col-70 for 70/30 split) */

/* Full width */
.col-100 { flex: 0 0 100%; }

/* Alignment */
.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Gap Utilities - Override default row gap */
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Reverse column order on desktop (keeps image on top for mobile) */
@media (max-width: 768px) {
  .row-reverse {
    flex-direction: column-reverse;
  }
}

@media (min-width: 769px) {
  .row-reverse {
    flex-direction: row-reverse;
  }
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--color-bg-dark);
  color: var(--color-text-light);
  z-index: 1000;
  transition: background-color var(--transition-base);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm);
  max-width: var(--container-wide);
  margin: 0 auto;
}

.navbar-brand {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-light);
}

.navbar-nav {
  display: flex;
  list-style: none;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
}

.navbar-nav a {
  color: var(--color-text-light);
  padding: 0.5rem 1rem;
  transition: color var(--transition-fast);
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--color-accent);
}

/* Mobile Menu Toggle */
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text-light);
  font-size: var(--text-2xl);
  cursor: pointer;
  padding: 0.5rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl) var(--space-sm);
  position: relative;
}

.hero-content {
  max-width: var(--container-medium);
  z-index: 2;
}

.hero h1 {
  font-size: var(--text-6xl);
  margin-bottom: var(--space-sm);
}

.hero p {
  font-size: var(--text-xl);
  margin-bottom: var(--space-md);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-size: var(--text-base);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  line-height: 1;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text-light);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: var(--color-text-light);
}

.btn-light {
  background-color: var(--color-text-light);
  color: var(--color-text-dark);
  border-color: var(--color-text-light);
}

.btn-light:hover {
  background-color: transparent;
  color: var(--color-text-light);
  border-color: var(--color-text-light);
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: var(--text-lg);
}

.btn-sm {
  padding: 0.5rem 1.5rem;
  font-size: var(--text-sm);
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background-color: var(--color-bg-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  flex-shrink: 0;
}

.card-content {
  padding: var(--space-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-xs);
}

.card-text {
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
  flex-grow: 1;
}

/* Card Grid - Flexible wrapping system */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}

.card-grid > * {
  flex: 1 1 300px;
  max-width: 400px;
  min-width: 280px;
}

/* ============================================
   IMAGE FIT UTILITIES
   ============================================ */
.image-cover { object-fit: cover; }
.image-contain { object-fit: contain; }
.image-fill { object-fit: fill; }

.image-fit {
  width: 100%;
  height: auto;
}

/* ============================================
   QUOTE/TESTIMONIAL BLOCK
   ============================================ */
.quote-block {
  padding: var(--space-lg);
  text-align: center;
  font-size: var(--text-2xl);
  font-style: italic;
  position: relative;
}

.quote-block::before {
  content: '"';
  font-size: var(--text-6xl);
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.2;
}

.quote-author {
  font-size: var(--text-lg);
  font-style: normal;
  font-weight: 600;
  margin-top: var(--space-sm);
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
  text-align: center;
  padding: var(--space-xl) var(--space-sm);
}

.cta-title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-sm);
}

.cta-text {
  font-size: var(--text-xl);
  margin-bottom: var(--space-md);
  color: var(--color-text-muted);
}

.cta-buttons {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   ICON LIST/FEATURE BLOCKS
   ============================================ */
.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.feature-item {
  flex: 1;
  min-width: 250px;
  text-align: center;
}

.feature-icon {
  font-size: var(--text-5xl);
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.feature-title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-xs);
}

.feature-text {
  color: var(--color-text-muted);
}

/* ============================================
   ACCORDION/FAQ
   ============================================ */
.accordion {
  max-width: var(--container-medium);
  margin: 0 auto;
}

.accordion-item {
  border-bottom: 1px solid var(--color-border);
}

.accordion-header {
  width: 100%;
  padding: var(--space-sm);
  background: none;
  border: none;
  text-align: left;
  font-size: var(--text-lg);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color var(--transition-fast);
}

.accordion-header:hover {
  background-color: var(--color-bg-gray);
}

.accordion-icon {
  transition: transform var(--transition-base);
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.accordion-item.active .accordion-content {
  max-height: 500px;
}

.accordion-body {
  padding: var(--space-sm);
  color: var(--color-text-muted);
}

/* ============================================
   VIDEO EMBED
   ============================================ */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.video-container iframe,
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================================
   GALLERY
   ============================================ */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
  flex: 1 1 250px;
  max-width: 350px;
  min-width: 200px;
}

.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-group {
  margin-bottom: var(--space-sm);
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  font-size: var(--text-base);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

/* ============================================
   SOCIAL ICONS
   ============================================ */
.social-icons {
  display: flex;
  gap: var(--space-sm);
  list-style: none;
  padding: 0;
  margin: 0;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  color: var(--color-text-light);
  font-size: var(--text-xl);
  transition: all var(--transition-base);
}

.social-icons a:hover {
  background-color: var(--color-accent);
  transform: translateY(-2px);
}

/* ============================================
   ALERT/BANNER
   ============================================ */
.alert {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}

.alert-info {
  background-color: #dbeafe;
  color: #1e40af;
  border-left: 4px solid #3b82f6;
}

.alert-success {
  background-color: #dcfce7;
  color: #166534;
  border-left: 4px solid #22c55e;
}

.alert-warning {
  background-color: #fef3c7;
  color: #92400e;
  border-left: 4px solid #f59e0b;
}

.alert-error {
  background-color: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background-color: var(--color-primary);
  color: var(--color-text-light);
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--text-xl);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--color-accent);
  transform: translateY(-4px);
}

/* ============================================
   COUNTDOWN TIMER
   ============================================ */
.countdown-container {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin: var(--space-md) 0;
}

.countdown-item {
  background-color: var(--color-bg-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  min-width: 100px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.countdown-item.dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-light);
}

.countdown-value {
  display: block;
  font-size: var(--text-5xl);
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--space-xs);
  font-family: var(--font-heading);
}

.countdown-label {
  display: block;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.countdown-item.dark .countdown-label {
  color: rgba(255, 255, 255, 0.7);
}

.countdown-message {
  text-align: center;
  font-size: var(--text-2xl);
  font-weight: 600;
  padding: var(--space-md);
}

.countdown-expired {
  display: none;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background-color: var(--color-bg-dark);
  color: var(--color-text-light);
  padding: var(--space-lg) var(--space-sm);
}

.footer a {
  color: var(--color-text-light);
}

.footer a:hover {
  color: var(--color-accent);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* ============================================
   RESPONSIVE DESIGN
   Mobile-First Approach
   
   Base styles work on all devices.
   @media (max-width: 768px) = Tablet and below
   @media (max-width: 480px) = Mobile only
   @media (min-width: 769px) = Desktop only overrides
   ============================================ */

/* Tablet (768px and below) */
@media (max-width: 768px) {
  :root {
    --text-5xl: 2.5rem;
    --text-6xl: 3rem;
  }
  
  .hero h1 {
    font-size: var(--text-5xl);
  }
  
  /* Mobile Navigation */
  .navbar-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background-color: var(--color-bg-dark);
    flex-direction: column;
    padding: var(--space-sm);
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
  }
  
  .navbar-nav.active {
    max-height: 500px;
  }
  
  .navbar-nav li {
    width: 100%;
  }
  
  .navbar-nav a {
    display: block;
    padding: var(--space-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .navbar-toggle {
    display: block;
  }
  
  /* Stack columns on mobile */
  .col-33, .col-50, .col-66, .col-70, .col-30 {
    flex: 0 0 100%;
    max-width: 100%;
    min-width: 100%;
  }
  .btn, .btn-special{
    width: 100%;
  }
  /* Adjust spacing */
  .section-padding-sm { padding: var(--space-sm) 0; }
  .section-padding-md { padding: var(--space-md) 0; }
  .section-padding-lg { padding: var(--space-lg) 0; }
  
  /* Card grid adjustments */
  .card-grid > * {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
  :root {
    --text-4xl: 1.875rem;
    --text-5xl: 2rem;
  }
  
  .btn {
    width: 100%;
  }
  
  .cta-buttons {
    flex-direction: column;
  }
}
