/* ============================================
   AL-HIRA PUBLIC SCHOOL — Design System
   Version: 1.0
   Theme: Faith • Knowledge • Excellence
   ============================================ */

/* === CSS Layers === */
@layer base, layout, components, pages, utilities;

/* === Google Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@500;600;700&display=swap');

/* === Design Tokens === */
@layer base {
  :root {
    /* --- Brand Colors --- */
    --color-primary: #0B4D44;
    --color-primary-hover: #0A4039;
    --color-primary-light: #0E5F54;
    --color-primary-lighter: #e8f5f2;
    --color-dark-emerald: #063A34;
    --color-darkest: #042B27;

    --color-gold: #C89B3C;
    --color-gold-hover: #B8892F;
    --color-gold-light: #E5C27A;
    --color-gold-lighter: #FBF5E6;
    --color-gold-glow: rgba(200, 155, 60, 0.15);

    /* --- Semantic Colors --- */
    --color-success: #22C55E;
    --color-success-light: #DCFCE7;
    --color-success-dark: #16A34A;
    --color-warning: #F59E0B;
    --color-warning-light: #FEF3C7;
    --color-warning-dark: #D97706;
    --color-danger: #EF4444;
    --color-danger-light: #FEE2E2;
    --color-danger-dark: #DC2626;
    --color-info: #3B82F6;
    --color-info-light: #DBEAFE;

    /* --- Neutral Colors --- */
    --color-bg: #F8F6F1;
    --color-bg-warm: #F5F2EC;
    --color-surface: #FFFFFF;
    --color-surface-hover: #FAFAF8;
    --color-surface-active: #F5F3EE;
    --color-border: #E8E5DE;
    --color-border-light: #F0EDE7;
    --color-border-dark: #D4D0C8;

    /* --- Text Colors --- */
    --color-text: #1B1B1B;
    --color-text-secondary: #4A4A4A;
    --color-text-muted: #6B7280;
    --color-text-light: #9CA3AF;
    --color-text-inverse: #FFFFFF;
    --color-text-gold: #A07D2F;

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

    --text-xs: 0.6875rem;    /* 11px */
    --text-sm: 0.75rem;      /* 12px */
    --text-base: 0.8125rem;  /* 13px */
    --text-md: 0.875rem;     /* 14px */
    --text-lg: 1rem;         /* 16px */
    --text-xl: 1.125rem;     /* 18px */
    --text-2xl: 1.375rem;    /* 22px */
    --text-3xl: 1.75rem;     /* 28px */
    --text-4xl: 2.25rem;     /* 36px */

    --weight-light: 300;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;

    --leading-tight: 1.2;
    --leading-normal: 1.5;
    --leading-relaxed: 1.7;

    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --tracking-wide: 0.02em;
    --tracking-wider: 0.05em;

    /* --- Spacing (4px base unit) --- */
    --space-0: 0;
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */

    /* --- Border Radius --- */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-3xl: 24px;
    --radius-full: 9999px;

    /* --- Shadows --- */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 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);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-gold: 0 4px 14px rgba(200, 155, 60, 0.15);
    --shadow-emerald: 0 4px 14px rgba(11, 77, 68, 0.12);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-card-hover: 0 8px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);

    /* --- Transitions --- */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* --- Z-Index Scale --- */
    --z-base: 0;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-sidebar: 300;
    --z-overlay: 400;
    --z-modal: 500;
    --z-toast: 600;
    --z-tooltip: 700;
    --z-max: 9999;

    /* --- Layout --- */
    --sidebar-width: 272px;
    --sidebar-collapsed: 72px;
    --topbar-height: 68px;
    --content-max-width: 1400px;
    --mobile-nav-height: 64px;
  }

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

  html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
  }

  body {
    font-family: var(--font-primary);
    font-size: var(--text-md);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    overflow-x: hidden;
    min-height: 100vh;
  }

  /* --- Typography Reset --- */
  h1, h2, h3, h4, h5, h6 {
    font-weight: var(--weight-semibold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--color-text);
  }

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

  p {
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
  }

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

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

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

  button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    font-size: inherit;
    color: inherit;
  }

  input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
  }

  ul, ol {
    list-style: none;
  }

  table {
    border-collapse: collapse;
    width: 100%;
  }

  /* --- Selection --- */
  ::selection {
    background: var(--color-gold-light);
    color: var(--color-text);
  }

  /* --- Scrollbar --- */
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    background: var(--color-border-dark);
    border-radius: var(--radius-full);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-light);
  }

  /* --- Focus Visible --- */
  :focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
  }
}
