/* Main Styles - Country Steps */
/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  /* CSS Custom Properties - HSL Format (from spec) */
  /* Background Colors */
  --background: 30 25% 94%;        /* Warm beige background */
  --foreground: 25 35% 15%;        /* Deep brown text */
  
  /* Card Colors */
  --card: 35 30% 96%;              /* Warm beige card */
  --card-foreground: 25 35% 15%;    /* Text on cards */
  
  /* Primary Colors */
  --primary: 10 65% 50%;           /* Warm country red */
  --primary-foreground: 0 0% 100%;  /* White text on primary */
  
  /* Secondary Colors */
  --secondary: 30 35% 82%;         /* Tan/beige */
  --secondary-foreground: 25 35% 15%; /* Text on secondary */
  
  /* Muted Colors */
  --muted: 30 30% 88%;              /* Light beige */
  --muted-foreground: 25 25% 40%;   /* Muted text */
  
  /* Accent Colors */
  --accent: 200 60% 50%;           /* Denim blue */
  --accent-foreground: 0 0% 100%;  /* White text on accent */
  
  /* Semantic Colors */
  --destructive: 0 70% 55%;         /* Error red */
  --destructive-foreground: 0 0% 100%;
  
  /* Border & Input Colors */
  --border: 30 25% 80%;             /* Light brown border */
  --input: 30 25% 88%;              /* Input background */
  --ring: 10 65% 50%;               /* Focus ring (same as primary) */
  
  /* Border Radius */
  --radius: 0.75rem;                /* 12px base radius */
  
  /* Typography */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Spacing (multiples of 4px) */
  --spacing-xs: 0.5rem;   /* 8px */
  --spacing-sm: 1rem;     /* 16px */
  --spacing-md: 1.5rem;   /* 24px */
  --spacing-lg: 2rem;     /* 32px */
  --spacing-xl: 3rem;     /* 48px */
  
  /* Legacy color support (for gradual migration) */
  --color-primary: hsl(var(--primary));
  --color-primary-dark: hsl(10 65% 40%);
  --color-primary-light: hsl(10 65% 60%);
  --color-secondary: hsl(var(--secondary));
  --color-accent: hsl(var(--accent));
  --color-sand: hsl(var(--background));
  --color-sand-light: hsl(var(--card));
  --color-sand-dark: hsl(var(--muted));
  --color-white: hsl(0 0% 100%);
  --color-text: hsl(var(--foreground));
  --color-text-light: hsl(var(--muted-foreground));
  --color-text-muted: hsl(var(--muted-foreground));
  --color-border: hsl(var(--border));
  --color-border-light: hsl(var(--border) / 0.5);
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1);
  --shadow-country: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-country-lg: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  min-height: 100vh;
  height: auto;
  line-height: 1.5;
  font-size: 1rem; /* 16px base */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* Prevent horizontal scroll on mobile */
  overflow-y: hidden !important; /* Let html handle scrolling - force it */
  position: relative;
}

/* Ensure body's flex children don't get constrained heights */
body > main,
body > #main-content {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  overflow-y: hidden !important;
  overflow-x: hidden !important;
}

/* Critical: Prevent flex from constraining main's height */
html {
  height: auto !important;
  min-height: 100%;
}

body {
  height: auto !important;
  min-height: 100vh;
}

main {
  flex: 1 1 auto; /* Allow flex to grow and shrink naturally */
  position: relative;
  z-index: 20;
  width: 100%;
  max-width: 100%;
  overflow: visible !important; /* No scrolling in main - force it */
  overflow-y: hidden !important;
  overflow-x: hidden !important;
  height: auto !important;
  min-height: 0 !important; /* Critical for flex children */
  max-height: none !important;
}

/* Ensure main elements with container class have proper width constraints */
main.container,
#main-content.container {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  main.container,
  #main-content.container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Ensure main-content doesn't overflow */
.main-content,
#main-content {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden !important;
  overflow-y: hidden !important; /* Prevent nested vertical scrollbars - force it */
  overflow: visible !important; /* Force no scrolling */
  height: auto !important; /* Let content determine height */
  min-height: 0 !important; /* Allow flex shrinking */
  max-height: none !important;
}

/* Force main-content to never scroll - most specific rule */
main#main-content,
main.main-content,
#main-content.main-content,
main[id="main-content"],
main[id="main-content"].main-content {
  overflow: visible !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
}

/* Even more specific - target by attribute */
main[role="main"],
main[role="main"][id="main-content"],
main[role="main"].main-content {
  overflow: visible !important;
  overflow-y: hidden !important;
  overflow-x: hidden !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
}

/* For pages without container, ensure they don't overflow */
main:not(.container) {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Prevent content from breaking out */
main * {
  max-width: 100%;
  box-sizing: border-box;
}

/* Force all elements inside main to not create scrollbars */
main *,
#main-content *,
.main-content * {
  overflow-y: hidden !important;
  max-height: none !important;
}

/* Specifically target main-content and its direct children */
#main-content,
.main-content {
  overflow: visible !important;
  overflow-y: hidden !important;
  overflow-x: hidden !important;
}

#main-content > *,
.main-content > * {
  overflow: visible !important;
  overflow-y: hidden !important;
  max-height: none !important;
}

/* Exception: only allow horizontal scrolling for filters section */
.filters-section {
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

/* Cards and content should respect container */
.card, .admin-item, .step-card, .move-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Background Layers - From Spec */
.background-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-gradient-base {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    hsl(30 25% 94%),
    hsl(30 28% 92%),
    hsl(30 30% 88%)
  );
}

.sand-dunes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Decorative Pattern Overlay */
.country-pattern {
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    hsl(var(--border)) 10px,
    hsl(var(--border)) 11px
  );
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

/* Decorative Icons */
.decorative-icon {
  position: fixed;
  width: 6rem;  /* 96px */
  height: 6rem;
  opacity: 0.15;
  pointer-events: none;
  filter: brightness(0.4) sepia(1) hue-rotate(15deg) saturate(0.8);
  z-index: 0;
}

/* Example positioning for decorative icons */
.icon-top-left {
  top: 5%;
  left: 2%;
  transform: rotate(15deg);
}

.icon-top-right {
  top: 5%;
  right: 2%;
  transform: rotate(-15deg);
}

.icon-bottom-left {
  bottom: 5%;
  left: 2%;
  transform: rotate(-15deg);
}

.icon-bottom-right {
  bottom: 5%;
  right: 2%;
  transform: rotate(15deg);
}

/* Page wrapper for z-index layering */
.page-wrapper {
  position: relative;
  min-height: 100vh;
  z-index: 0;
}

/* Typography - From Spec */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: hsl(var(--foreground));
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
}

h1 {
  font-size: 1.875rem;  /* 30px - mobile */
  font-weight: 700;
}

h2 {
  font-size: 1.5rem;     /* 24px - mobile */
  font-weight: 600;
  line-height: 1.3;
}

h3 {
  font-size: 1.25rem;   /* 20px - mobile */
  font-weight: 600;
  line-height: 1.4;
}

h4 {
  font-size: 1.125rem;   /* 18px - mobile */
  font-weight: 600;
  line-height: 1.4;
}

/* Responsive Typography */
@media (min-width: 640px) {
  h1 { font-size: 2.25rem; }  /* 36px - sm */
  h2 { font-size: 1.875rem; } /* 30px - sm */
  h3 { font-size: 1.5rem; }   /* 24px - sm */
}

@media (min-width: 768px) {
  h1 { font-size: 3rem; }     /* 48px - md */
  h2 { font-size: 2rem; }    /* 32px - md */
  h3 { font-size: 1.75rem; } /* 28px - md */
}

@media (min-width: 1024px) {
  h1 { font-size: 3.75rem; }  /* 60px - lg */
  h2 { font-size: 2.25rem; }  /* 36px - lg */
  h3 { font-size: 2rem; }     /* 32px - lg */
}

p {
  margin-bottom: var(--spacing-sm);
  color: hsl(var(--foreground));
  font-size: 1rem; /* 16px */
  line-height: 1.5;
}

small {
  font-size: 0.875rem; /* 14px */
  line-height: 1.5;
}

a {
  color: hsl(var(--primary));
  text-decoration: none;
  transition: all 200ms;
  font-weight: 500;
}

a:hover {
  color: hsl(var(--primary) / 0.9);
  text-decoration: underline;
}

/* Layout - From Spec */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;   /* 16px */
  padding-right: 1rem;
  max-width: 1400px;    /* 2xl breakpoint */
}

@media (min-width: 640px) {
  .container {
    padding-left: 2rem;  /* 32px */
    padding-right: 2rem;
  }
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Header - From Spec */
header {
  border-bottom: 2px solid hsl(var(--primary) / 0.3);
  background-color: hsl(var(--card) / 0.8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-country);
  min-height: 4rem; /* 64px mobile */
}

@media (min-width: 768px) {
  header {
    min-height: 5rem; /* 80px desktop */
  }
}

header .container,
.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 5rem;  /* 80px desktop, 64px mobile */
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Mobile Navigation */
@media (max-width: 767px) {
  header .container,
  .nav-container {
    height: 4rem;  /* 64px */
  }
}

.keyboard-shortcuts-btn {
  position: absolute;
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  z-index: 101;
}

.auth-hidden {
  display: none !important;
  visibility: hidden;
}

.admin-hidden {
  display: none !important;
  visibility: hidden;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  width: 100%;
  position: relative;
}

/* Logo on left */
.logo {
  flex-shrink: 0;
}

/* Navigation tabs in the middle */
.desktop-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}

/* User info on right */
.desktop-user-info {
  flex-shrink: 0;
  margin-left: auto;
}

@media (max-width: 767px) {
  .desktop-nav {
    position: static;
    transform: none;
  }
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: hsl(var(--primary));
  font-weight: 700;
  transition: transform 200ms;
}

.logo:hover {
  transform: scale(1.02);
}

.logo-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}

nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-weight: 500;
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: background-color 200ms;
}

nav a:hover {
  background-color: hsl(var(--accent) / 0.5);
  text-decoration: none;
}

nav a.active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem; /* 14px */
}

.user-info .admin-link.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-weight: 500;
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: background-color 200ms;
}

.user-info .admin-link.nav-link:hover {
  background-color: hsl(var(--accent) / 0.5);
  text-decoration: none;
}

/* Mobile Menu - Hidden on Desktop */
.mobile-menu-toggle {
  display: none !important;
  position: relative;
  z-index: 102;
}

.mobile-menu-toggle .close-icon {
  display: none;
}

.mobile-menu {
  display: none !important;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: hsl(var(--card) / 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid hsl(var(--border));
  box-shadow: var(--shadow-country-lg);
  z-index: 101;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 var(--spacing-md);
}

.mobile-nav a {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: calc(var(--radius) - 2px);
  color: hsl(var(--foreground));
  font-weight: 500;
  transition: background-color 200ms;
  min-height: 48px;
}

.mobile-nav a:hover,
.mobile-nav a:active {
  background-color: hsl(var(--accent) / 0.5);
  text-decoration: none;
}

.mobile-menu-divider {
  height: 1px;
  background: hsl(var(--border));
  margin: var(--spacing-sm) var(--spacing-md);
}

.mobile-user-section {
  padding: 0 var(--spacing-md);
}

.mobile-user-info {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.mobile-user-name {
  padding: var(--spacing-sm) var(--spacing-md);
  color: hsl(var(--foreground));
  font-weight: 500;
  font-size: 0.95rem;
}

/* Buttons - From Spec */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px);  /* 10px */
  font-size: 0.875rem;  /* 14px */
  font-weight: 600;
  font-family: var(--font-sans);
  transition: all 200ms;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.btn:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

/* Primary (Default) */
.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Outline */
.btn-secondary {
  border: 2px solid hsl(var(--primary) / 0.4);
  background-color: hsl(var(--background));
  color: hsl(var(--primary));
}

.btn-secondary:hover {
  background-color: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary) / 0.6);
}

/* Ghost */
.btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground));
  box-shadow: none;
}

.btn-ghost:hover {
  background-color: hsl(var(--accent) / 0.5);
  color: hsl(var(--accent-foreground));
}

/* Destructive */
.btn-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

/* Button Sizes */
.btn-sm {
  height: 2.25rem;  /* 36px */
  padding: 0 0.75rem;  /* 12px */
  font-size: 0.875rem;
}

.btn-md,
.btn {
  height: 2.5rem;   /* 40px */
  padding: 0 1rem;   /* 16px */
  font-size: 0.875rem;
}

.btn-lg {
  height: 2.75rem;  /* 44px */
  padding: 0 2rem;   /* 32px */
  font-size: 1rem;
}

.btn-icon {
  padding: var(--spacing-xs);
  background: transparent;
  border: none;
  color: hsl(var(--primary));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
  transition: all 200ms;
  box-shadow: none;
}

.btn-icon:hover {
  background-color: hsl(var(--accent) / 0.5);
  transform: scale(1.05);
}

/* Cards - From Spec */
.card {
  border-radius: 0.75rem;  /* 12px */
  border: 2px solid hsl(var(--primary) / 0.25);
  background-color: hsl(var(--card) / 0.5);
  color: hsl(var(--card-foreground));
  box-shadow: var(--shadow-country);
  position: relative;
  transition: box-shadow 200ms;
}

.card:hover {
  box-shadow: var(--shadow-country-lg);
}

/* Standard Card */
.country-card {
  padding: 1.5rem;  /* 24px */
  background: linear-gradient(
    to bottom,
    hsl(var(--card) / 0.5),
    hsl(var(--card) / 0.5) 98%,
    hsl(var(--border) / 0.5)
  );
}

/* Card with Background Gradient */
.country-card-bg {
  background: linear-gradient(
    135deg,
    hsl(35 30% 96% / 0.5) 0%,
    hsl(30 28% 94% / 0.5) 100%
  );
  border: 2px solid hsl(var(--border));
}

/* Card Header */
.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;  /* 6px */
  padding: 1.5rem;
  padding-bottom: 0.75rem;  /* Responsive: 0.75rem on mobile, 1.5rem on desktop */
}

@media (min-width: 768px) {
  .card-header {
    padding-bottom: 1.5rem;
  }
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;  /* 24px */
  font-weight: 600;
  color: hsl(var(--primary));
  line-height: 1.2;
}

.card-description {
  font-size: 0.875rem;  /* 14px */
  color: hsl(var(--muted-foreground));
}

.card-content {
  padding: 1.5rem;
  padding-top: 0;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.badge-syllabus {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white);
  box-shadow: 0 2px 4px rgba(139, 69, 19, 0.2);
}

.badge-level {
  background-color: var(--color-sand-dark);
  color: var(--color-primary-dark);
}

.badge-difficulty {
  background-color: var(--color-sand);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.badge-dance {
  background: var(--color-white);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem; /* 24px - better spacing */
}

.form-label {
  display: block;
  margin-bottom: 0.5rem; /* 8px */
  font-weight: 500;
  color: hsl(var(--foreground));
  font-size: 0.875rem; /* 14px */
}

/* Input Fields - From Spec */
.input,
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 2.5rem;  /* 40px */
  padding: 0 0.75rem;  /* 12px */
  border-radius: calc(var(--radius) - 2px);
  border: 2px solid hsl(var(--input));
  background-color: hsl(var(--background));
  font-size: 1rem;  /* 16px - prevents iOS zoom */
  font-family: var(--font-sans);
  color: hsl(var(--foreground));
  transition: border-color 200ms;
}

.form-textarea {
  height: auto;
  min-height: 100px;
  padding: 0.75rem;
  resize: vertical;
}

.input:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.input::placeholder,
.form-input::placeholder {
  color: hsl(var(--muted-foreground));
}

/* Grid */
.grid {
  display: grid;
  gap: var(--spacing-sm);
}

/* Empty state in grid should span all columns */
.grid > .empty-state {
  grid-column: 1 / -1;
}

.grid-2 {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

/* Utilities */
.text-center {
  text-align: center;
}

.text-muted {
  color: hsl(var(--muted-foreground));
}

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

.hidden {
  display: none !important;
}

/* Loading */
.loading {
  text-align: center;
  padding: var(--spacing-xl);
  color: hsl(var(--muted-foreground));
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--spacing-xl);
  color: hsl(var(--muted-foreground));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  width: 100%;
  grid-column: 1 / -1;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-sm);
  opacity: 0.5;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.empty-state-icon svg {
  width: 48px;
  height: 48px;
  color: var(--color-text-muted);
  opacity: 0.5;
  margin: 0 auto;
}

.empty-state p {
  margin: var(--spacing-sm) 0;
  text-align: center;
  width: 100%;
}

/* Footer - From Spec */
footer,
.footer {
  position: relative;
  z-index: 30;
  border-top: 2px solid hsl(var(--primary) / 0.2);
  padding: var(--spacing-lg) 0;
  margin-top: var(--spacing-xl);
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem; /* 14px */
  background-color: hsl(var(--card) / 0.5);
  backdrop-filter: blur(8px);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.footer-column {
  display: flex;
  flex-direction: column;
}

.footer-heading {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--primary));
  margin: 0 0 var(--spacing-sm) 0;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links li {
  margin: 0;
}

.footer-links a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 0.875rem;
  display: inline-block;
}

.footer-links a:hover {
  color: hsl(var(--primary));
}

.footer-text {
  margin: 0 0 0.5rem 0;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

.footer-support-text {
  margin: 0;
  font-size: 0.8125rem; /* 13px */
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}

.footer-sister-site {
  margin-top: 0.75rem;
}

.sister-site-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 0.875rem;
}

.sister-site-link:hover {
  color: hsl(var(--primary));
}

.sister-site-link svg {
  flex-shrink: 0;
  color: hsl(var(--primary));
}

.footer-copyright-section {
  border-top: 1px solid hsl(var(--primary) / 0.2);
  padding-top: var(--spacing-md);
  text-align: center;
}

.footer-copyright {
  margin: 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

.footer-author {
  color: hsl(var(--primary));
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-author:hover {
  color: hsl(var(--primary) / 0.8);
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  /* Typography */
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  /* Container */
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  main {
    padding: 0 var(--spacing-sm) !important;
    margin-top: var(--spacing-sm) !important;
  }
  
  #main-content {
    padding: 0 var(--spacing-sm) !important;
  }
  
  /* Header */
  header {
    padding: var(--spacing-xs) 0;
  }
  
  .header-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xs);
  }
  
  .logo {
    font-size: 1.25rem;
    flex-shrink: 0;
  }
  
  .logo-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
  }
  
  /* Hide desktop nav and user info on mobile */
  .desktop-nav,
  .desktop-user-info {
    display: none !important;
  }
  
  /* Show mobile menu toggle on mobile */
  .mobile-menu-toggle {
    display: flex !important;
  }
  
  .mobile-menu-toggle.active .menu-icon {
    display: none;
  }

  .mobile-menu-toggle.active .close-icon {
    display: block;
  }
  
  /* Show mobile menu when active on mobile */
  .mobile-menu {
    display: block !important;
  }
  
  .mobile-menu.active {
    max-height: 600px;
    padding: var(--spacing-md) 0;
  }
  
  .mobile-nav a {
    font-size: 1rem;
  }
  
  .mobile-nav a svg {
    width: 20px;
    height: 20px;
  }
  
  /* Buttons */
  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
    min-height: 44px; /* Touch target size */
    -webkit-tap-highlight-color: rgba(139, 69, 19, 0.2);
    touch-action: manipulation;
    user-select: none;
  }
  
  /* Ensure page can scroll normally - only html should scroll */
  html {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    height: auto;
    min-height: 100%;
  }
  
  body {
    touch-action: pan-y pan-x;
    overflow-y: hidden !important; /* Don't scroll body, let html scroll - force it */
    overflow-x: hidden !important;
    height: auto !important;
  }
  
  /* Main content should NOT scroll - force it */
  main, #main-content, .main-content {
    touch-action: pan-y pan-x;
    overflow: visible !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    height: auto !important;
    max-height: none !important;
  }
  
  /* Search layout should never scroll - force it */
  .search-layout {
    overflow: visible !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    height: auto !important;
    max-height: none !important;
  }
  
  /* Steps grid should never scroll - force it */
  #steps-grid {
    overflow: visible !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    height: auto !important;
    max-height: none !important;
  }
  
  /* Force all nested containers to not scroll */
  #main-content > * {
    overflow: visible !important;
    overflow-y: hidden !important;
    height: auto !important;
    max-height: none !important;
  }
  
  .btn:active {
    transform: scale(0.98);
  }
  
  .btn-icon {
    min-width: 44px;
    min-height: 44px;
    padding: var(--spacing-xs);
    -webkit-tap-highlight-color: rgba(139, 69, 19, 0.2);
    touch-action: manipulation;
    user-select: none;
  }
  
  .btn-icon:active {
    transform: scale(0.95);
  }
  
  /* Links */
  a {
    -webkit-tap-highlight-color: rgba(139, 69, 19, 0.1);
    touch-action: manipulation;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  
  /* Grids */
  .grid {
    gap: var(--spacing-sm);
  }
  
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Cards */
  .step-card-content,
  .move-card-content {
    padding: var(--spacing-xs);
  }
  
  .step-card-title,
  .move-card-title {
    font-size: 0.85rem;
  }
  
  /* Footer */
  footer,
  .footer {
    padding: var(--spacing-lg) var(--spacing-md);
    margin-top: var(--spacing-lg);
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
  }
  
  .footer-column {
    align-items: flex-start;
  }
  
  .footer-column:first-child {
    border-bottom: 1px solid hsl(var(--primary) / 0.1);
    padding-bottom: var(--spacing-md);
  }
  
  .footer-column:nth-child(2) {
    border-bottom: 1px solid hsl(var(--primary) / 0.1);
    padding-bottom: var(--spacing-md);
  }
  
  .footer-heading {
    margin-bottom: var(--spacing-sm);
    font-size: 0.9375rem;
    color: hsl(var(--primary));
  }
  
  .footer-links {
    align-items: flex-start;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem 1rem;
    width: 100%;
  }
  
  .footer-links li {
    width: 100%;
  }
  
  .footer-links a {
    display: block;
    padding: 0.375rem 0;
    min-height: 44px;
    line-height: 1.4;
    font-size: 0.875rem;
  }
  
  .footer-text {
    text-align: left;
    font-size: 0.8125rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-xs);
  }
  
  .footer-support-text {
    text-align: left;
    font-size: 0.75rem;
    margin-bottom: var(--spacing-sm);
  }
  
  .footer-sister-site {
    margin-top: var(--spacing-xs);
  }
  
  .sister-site-link {
    justify-content: flex-start;
    padding: 0.5rem 0;
    min-height: 44px;
  }
  
  .footer-copyright-section {
    padding-top: var(--spacing-md);
    border-top: 1px solid hsl(var(--primary) / 0.1);
  }
  
  .footer-copyright {
    font-size: 0.75rem;
    line-height: 1.6;
    text-align: left;
  }
  
  .footer-author {
    display: inline-block;
    margin-top: 0.25rem;
  }
  
  /* Empty State */
  .empty-state {
    padding: var(--spacing-lg);
    min-height: 200px;
  }
  
  .empty-state-icon svg {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  h1 {
    font-size: 1.5rem;
  }
  
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5 {
    grid-template-columns: 1fr;
  }
  
  .logo {
    font-size: 1.1rem;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Footer - Extra small screens */
  footer,
  .footer {
    padding: var(--spacing-md) var(--spacing-sm);
  }
  
  .footer-grid {
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
  }
  
  .footer-column {
    padding-bottom: var(--spacing-sm);
  }
  
  .footer-links {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .footer-links a {
    padding: 0.5rem 0;
  }
  
  .footer-copyright {
    font-size: 0.6875rem;
  }
}

/* FAQ Page Styles */
.faq-container {
  max-width: 900px;
  margin: 0 auto;
}

.faq-section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: hsl(var(--primary));
  margin: 3rem 0 1.5rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid hsl(var(--primary) / 0.2);
}

.faq-section-title:first-of-type {
  margin-top: 2rem;
}

.faq-item {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.faq-question {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.faq-question h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.faq-answer {
  padding: 1.25rem 1.5rem;
  background: hsl(var(--background));
}

.faq-answer p {
  margin: 0;
  line-height: 1.8;
  color: hsl(var(--muted-foreground));
}

.faq-answer p + p {
  margin-top: 1rem;
}

/* Privacy Policy & Terms of Use Page Styles */
.policy-container,
.terms-container {
  max-width: 800px;
  margin: 0 auto;
}

.policy-header,
.terms-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid hsl(var(--primary) / 0.2);
}

.policy-header h1,
.terms-header h1 {
  margin-bottom: 0.5rem;
}

.policy-meta,
.terms-meta {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

.policy-section,
.terms-section {
  margin: 2.5rem 0;
  padding: 1.5rem;
  background: hsl(var(--card) / 0.5);
  border-radius: var(--radius-md);
  border-left: 3px solid hsl(var(--primary) / 0.3);
}

.policy-section h2,
.terms-section h2 {
  color: hsl(var(--primary));
  font-size: 1.5rem;
  margin: 0 0 1rem 0;
  font-weight: 600;
}

.policy-section h3,
.terms-section h3 {
  color: hsl(var(--foreground));
  font-size: 1.125rem;
  margin: 1.5rem 0 0.75rem 0;
  font-weight: 600;
}

.policy-section p,
.terms-section p {
  line-height: 1.8;
  color: hsl(var(--muted-foreground));
  margin: 0.75rem 0;
}

.policy-section ul,
.terms-section ul {
  margin: 1rem 0;
  padding-left: 1.75rem;
  line-height: 1.9;
}

.policy-section li,
.terms-section li {
  margin: 0.5rem 0;
  color: hsl(var(--muted-foreground));
}

.policy-section li strong,
.terms-section li strong {
  color: hsl(var(--foreground));
  font-weight: 600;
}

.policy-section:first-of-type,
.terms-section:first-of-type {
  margin-top: 2rem;
}
