/* ============================================================
   SchoolAir Design System - Foundation CSS
   ============================================================
   Premium, Educational Non-Profit Aesthetic
   Deep Forest Green + Vibrant Teal + Warm Accents
   ============================================================ */

:root {
  /* PRIMARY BRAND COLORS */
  --color-deep-forest: #0F5132;      /* Premium dark green - headings, primary CTAs */
  --color-vibrant-teal: #20B2AA;     /* Fresh, trust-inspiring accent */
  --color-warm-lime: #9ACD32;        /* Secondary accent, energy/growth */
  --color-soft-cream: #FFFBF0;       /* Warm white, premium feel */
  --color-light-sage: #E8F5E9;       /* Backgrounds, card overlays */

  /* EDUCATIONAL/WARMTH PALETTE */
  --color-ocean-blue: #1565C0;       /* Trust, learning */
  --color-coral-pink: #FF7043;       /* Energy, community */
  --color-amber-gold: #FFA726;       /* Warmth, achievement */

  /* NEUTRALS */
  --color-charcoal: #2C3E50;         /* Primary text */
  --color-silver: #F8F9FA;           /* Backgrounds */
  --color-stone: #BDBDBD;            /* Secondary text */
  --color-white: #FFFFFF;
  --color-black: #000000;

  /* STATUS COLORS */
  --color-success: #4CAF50;
  --color-warning: #FF9800;
  --color-danger: #F44336;
  --color-info: #2196F3;

  /* TYPOGRAPHY */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Sora', 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-accent: 'Roboto Slab', Georgia, serif;

  /* FONT WEIGHTS */
  --fw-light: 300;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* SPACING SYSTEM (8px base) */
  --space-xs: 0.5rem;      /* 8px */
  --space-sm: 0.75rem;     /* 12px */
  --space-md: 1rem;        /* 16px */
  --space-lg: 1.5rem;      /* 24px */
  --space-xl: 2rem;        /* 32px */
  --space-2xl: 2.5rem;     /* 40px */
  --space-3xl: 3rem;       /* 48px */
  --space-4xl: 4rem;       /* 64px */
  --space-5xl: 5rem;       /* 80px */
  --space-6xl: 6rem;       /* 96px */

  /* BORDER RADIUS */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* SHADOWS */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 10px 24px rgba(0, 0, 0, 0.12);
  --shadow-2xl: 0 15px 35px rgba(0, 0, 0, 0.15);

  /* TRANSITIONS */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.35s ease;

  /* LAYOUT */
  --container-max-width: 1280px;
  --container-padding: var(--space-3xl);
}

/* ============================================================
   TYPOGRAPHY SYSTEM
   ============================================================ */

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  color: var(--color-charcoal);
  background-color: var(--color-white);
  line-height: 1.6;
  font-weight: var(--fw-normal);
  text-rendering: optimizeLegibility;
}

/* Headings */
h1, .h1 {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: var(--fw-bold);
  color: var(--color-deep-forest);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
}

h2, .h2 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: var(--fw-bold);
  color: var(--color-deep-forest);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-md);
}

h3, .h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: var(--fw-semibold);
  color: var(--color-vibrant-teal);
  line-height: 1.3;
  margin-bottom: var(--space-sm);
}

h4, .h4 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: var(--fw-semibold);
  color: var(--color-deep-forest);
  line-height: 1.4;
  margin-bottom: var(--space-sm);
}

h5, .h5 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: var(--fw-semibold);
  color: var(--color-charcoal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

p, .p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.text-sm {
  font-size: 0.875rem;
  color: var(--color-stone);
}

.text-accent {
  color: var(--color-vibrant-teal);
  font-weight: var(--fw-semibold);
}

.text-primary {
  color: var(--color-deep-forest);
  font-weight: var(--fw-semibold);
}

/* ============================================================
   CONTAINER & LAYOUT
   ============================================================ */

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  width: 100%;
}

.section {
  padding: var(--space-6xl) var(--container-padding);
}

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

.section-title {
  font-size: 2.2rem;
  font-weight: var(--fw-bold);
  color: var(--color-deep-forest);
  margin-bottom: var(--space-md);
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--color-vibrant-teal);
  font-weight: var(--fw-semibold);
}

/* ============================================================
   BUTTON STYLES
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
  font-family: var(--font-primary);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.95);
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, var(--color-deep-forest) 0%, var(--color-vibrant-teal) 100%);
  color: var(--color-white);
  box-shadow: var(--shadow-md);
}

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

.btn-primary:focus {
  outline: 2px solid var(--color-vibrant-teal);
  outline-offset: 2px;
}

/* Secondary Button */
.btn-secondary {
  background: transparent;
  color: var(--color-vibrant-teal);
  border: 2px solid var(--color-vibrant-teal);
}

.btn-secondary:hover {
  background: var(--color-light-sage);
  border-color: var(--color-deep-forest);
  color: var(--color-deep-forest);
}

/* Tertiary Button */
.btn-tertiary {
  background: var(--color-light-sage);
  color: var(--color-deep-forest);
  border: 1px solid var(--color-vibrant-teal);
}

.btn-tertiary:hover {
  background: var(--color-vibrant-teal);
  color: var(--color-white);
}

/* Danger Button */
.btn-danger {
  background: var(--color-coral-pink);
  color: var(--color-white);
  box-shadow: var(--shadow-md);
}

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

/* Button Sizes */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
}

.btn-block {
  width: 100%;
}

/* Icon Button */
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   CARD STYLES
   ============================================================ */

.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border: 1px solid transparent;
}

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

.card-accent {
  border-left: 4px solid var(--color-vibrant-teal);
}

.card-header {
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-light-sage);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-vibrant-teal);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.card-icon-lg {
  width: 64px;
  height: 64px;
  font-size: 2rem;
}

.card-title {
  font-size: 1.3rem;
  font-weight: var(--fw-semibold);
  color: var(--color-deep-forest);
  margin-bottom: var(--space-sm);
}

.card-subtitle {
  font-size: 0.95rem;
  color: var(--color-stone);
  margin-bottom: var(--space-md);
}

.card-content {
  line-height: 1.6;
}

.card-footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-light-sage);
}

/* ============================================================
   BADGE STYLES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}

.badge-primary {
  background: var(--color-deep-forest);
  color: var(--color-white);
}

.badge-teal {
  background: var(--color-vibrant-teal);
  color: var(--color-white);
}

.badge-success {
  background: var(--color-success);
  color: var(--color-white);
}

.badge-warning {
  background: var(--color-warning);
  color: var(--color-white);
}

.badge-danger {
  background: var(--color-danger);
  color: var(--color-white);
}

.badge-info {
  background: var(--color-info);
  color: var(--color-white);
}

/* ============================================================
   FORM STYLES
   ============================================================ */

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

label {
  display: block;
  font-weight: var(--fw-semibold);
  color: var(--color-deep-forest);
  margin-bottom: var(--space-sm);
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
  width: 100%;
  padding: 1rem;
  font-family: var(--font-primary);
  font-size: 1rem;
  border: 2px solid var(--color-vibrant-teal);
  border-radius: var(--radius-md);
  background-color: var(--color-white);
  color: var(--color-charcoal);
  transition: all var(--transition-base);
  appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-deep-forest);
  background-color: var(--color-light-sage);
  box-shadow: 0 0 0 3px rgba(32, 178, 170, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-stone);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2320B2AA' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-group.error input,
.form-group.error textarea {
  border-color: var(--color-coral-pink);
}

.error-message {
  color: var(--color-coral-pink);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.success-message {
  background: var(--color-light-sage);
  color: var(--color-deep-forest);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-success);
  margin-bottom: var(--space-lg);
}

/* ============================================================
   GRID UTILITIES
   ============================================================ */

.grid {
  display: grid;
  gap: var(--space-2xl);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

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

.grid-auto-lg {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

/* ============================================================
   FLEX UTILITIES
   ============================================================ */

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  flex-direction: column;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }

/* ============================================================
   SPACING UTILITIES
   ============================================================ */

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mt-3xl { margin-top: var(--space-3xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mb-3xl { margin-bottom: var(--space-3xl); }

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.p-2xl { padding: var(--space-2xl); }

/* ============================================================
   ANIMATION & TRANSITION
   ============================================================ */

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

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fadeInLeft {
  animation: fadeInLeft 0.6s ease-out;
}

.animate-fadeInRight {
  animation: fadeInRight 0.6s ease-out;
}

.animate-slideDown {
  animation: slideDown 0.3s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

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

.text-muted { color: var(--color-stone); }
.text-light { color: var(--color-silver); }
.text-dark { color: var(--color-charcoal); }

.bg-light { background-color: var(--color-light-sage); }
.bg-cream { background-color: var(--color-soft-cream); }
.bg-forest { background-color: var(--color-deep-forest); }
.bg-teal { background-color: var(--color-vibrant-teal); }

.border-top-teal {
  border-top: 4px solid var(--color-vibrant-teal);
}

.border-left-teal {
  border-left: 4px solid var(--color-vibrant-teal);
}

.border-bottom-teal {
  border-bottom: 2px solid var(--color-vibrant-teal);
}

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 1024px) {
  :root {
    --space-6xl: 4rem;
    --container-max-width: 1024px;
  }

  h1, .h1 {
    font-size: 2.8rem;
  }

  h2, .h2 {
    font-size: 2rem;
  }

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --space-6xl: 3rem;
    --space-5xl: 2.5rem;
    --container-padding: 1.5rem;
  }

  body {
    font-size: 15px;
  }

  h1, .h1 {
    font-size: 2rem;
    margin-bottom: var(--space-md);
  }

  h2, .h2 {
    font-size: 1.5rem;
  }

  h3, .h3 {
    font-size: 1.2rem;
  }

  .section {
    padding: var(--space-5xl) var(--container-padding);
  }

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

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-auto { grid-template-columns: 1fr; }
  .grid-auto-lg { grid-template-columns: 1fr; }

  .btn {
    width: 100%;
    max-width: 100%;
  }

  .hide-mobile {
    display: none;
  }
}

@media (max-width: 480px) {
  :root {
    --space-3xl: 1.5rem;
    --space-4xl: 2rem;
    --space-6xl: 2rem;
  }

  h1, .h1 {
    font-size: 1.75rem;
  }

  h2, .h2 {
    font-size: 1.3rem;
  }

  h3, .h3 {
    font-size: 1.1rem;
  }

  .grid-4 { grid-template-columns: 1fr; }

  .card {
    padding: var(--space-lg);
  }

  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
  }

  label {
    font-size: 0.9rem;
  }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-color-scheme: dark) {
  /* Dark mode support can be added here if needed */
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a, a:visited {
    text-decoration: underline;
  }

  img {
    max-width: 100%;
  }

  button, input[type="button"] {
    border: 1px solid #999;
  }

  .no-print {
    display: none;
  }
}
