/* ============================================
   Layout System
   Core layout components and utilities
   ============================================ */

/* ============================================
   Page Structure
   ============================================ */

.page-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}

.page-content {
  flex: 1;
  padding: var(--space-12) 0;
}

/* ============================================
   Container System
   ============================================ */

.container,
.container-narrow,
.container-wide,
.container-fluid {
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.container { max-width: var(--container-max-width); }
.container-narrow { max-width: 800px; }
.container-wide { max-width: 1400px; }
.container-fluid { width: 100%; }

/* ============================================
   Section Layouts
   ============================================ */

.section {
  padding: var(--space-12) 0;
}

.section-compact {
  padding: var(--space-8) 0;
}

.section-spacious {
  padding: var(--space-16) 0;
}

.section-alternate {
  background: var(--glass-black-20);
  padding: var(--space-12) 0;
}

/* ============================================
   Hero Section
   ============================================ */

.hero-section {
  min-height: 80vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--space-8) 0;
}

.hero-background {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* ============================================
   Page Header
   ============================================ */

.page-header {
  background: var(--bg-primary);
  padding: var(--space-12) var(--space-8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-8);
  text-align: center;
}

.page-header h1 {
  color: var(--text-primary);
  font-size: var(--text-4xl);
  margin-bottom: var(--space-2);
}

.page-header p {
  color: var(--text-muted);
  font-size: var(--text-lg);
  margin: 0;
}

/* ============================================
   Content Layouts
   ============================================ */

.content-wrapper {
  background: var(--glass-white-10);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border-radius: var(--radius-lg);
  padding: var(--space-12);
  border: 1px solid var(--glass-white-10);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 10;
}

.content-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-8);
}

.content-block {
  margin-bottom: var(--space-8);
}

.content-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.content-body {
  line-height: var(--leading-relaxed);
}

/* ============================================
   Grid Systems
   ============================================ */

.grid-layout {
  display: grid;
  gap: var(--space-8);
}

.grid-two-column {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.grid-three-column {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-four-column {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Card Grids */
.card-grid {
  display: grid;
  gap: var(--space-6);
}

.card-grid-pricing {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  max-width: 1000px;
  margin: 0 auto;
}

.card-grid-features {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-8);
}

/* Feature Grids */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-8);
  margin-top: var(--space-8);
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.feature-row {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

/* ============================================
   Navigation Layouts
   ============================================ */

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* ============================================
   Footer Layouts
   ============================================ */

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-12);
  padding: var(--space-12) 0;
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-bottom {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

/* ============================================
   Form Layouts
   ============================================ */

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

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-6);
}

.form-actions {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

/* ============================================
   Split Layouts
   ============================================ */

.split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.split-content {
  padding: var(--space-8);
}

.split-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

/* Buttons display inline naturally with their own spacing */

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet and below */
@media (max-width: 768px) {
  /* Containers */
  .container,
  .container-narrow,
  .container-wide {
    padding: 0 var(--space-4);
  }
  
  /* Sections */
  .section {
    padding: var(--space-8) 0;
  }
  
  .section-spacious {
    padding: var(--space-10) 0;
  }
  
  /* Content */
  .content-wrapper {
    padding: var(--space-6);
  }
  
  .page-header {
    padding: var(--space-8) var(--space-4);
  }
  
  .page-header h1 {
    font-size: var(--text-3xl);
  }
  
  /* Grids - Stack on tablet */
  .grid-two-column,
  .grid-three-column,
  .grid-four-column,
  .card-grid-pricing,
  .card-grid-features,
  .split-layout {
    grid-template-columns: 1fr;
  }
  
  /* Navigation */
  .nav-menu {
    display: none; /* Use mobile menu instead */
  }
  
  /* Footer */
  .footer-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-8);
  }
}

/* Mobile only */
@media (max-width: 480px) {
  /* Smaller padding on mobile */
  .container,
  .container-narrow,
  .container-wide {
    padding: 0 var(--space-3);
  }
  
  /* Compact sections */
  .section {
    padding: var(--space-6) 0;
  }
  
  .content-wrapper {
    padding: var(--space-4);
    border-radius: var(--radius-md);
  }
  
  .page-header h1 {
    font-size: var(--text-2xl);
  }
  
  .page-header p {
    font-size: var(--text-base);
  }
  
  /* Stack everything on mobile */
  .feature-row,
  .form-actions {
    flex-direction: column;
  }
  
  .feature-row {
    text-align: center;
  }
  
  /* Full width buttons on mobile */
  .form-actions button {
    width: 100%;
  }
  
  /* Smaller gaps */
  .grid-layout,
  .card-grid {
    gap: var(--space-4);
  }
}

/* Large screens */
@media (min-width: 1440px) {
  /* Larger containers on wide screens */
  .container { max-width: 1280px; }
  .container-wide { max-width: 1600px; }
  
  /* More spacious sections */
  .section-spacious {
    padding: var(--space-20) 0;
  }
}