/**
 * Design System - NGO Website
 * Complete visual language and CSS variables
 * Version: 1.0
 */

/* ========================================
   CSS CUSTOM PROPERTIES (Variables)
   ======================================== */

:root {
    /* ==================
       PRIMARY COLORS
       ================== */
    --primary: #4CAF50;
    --primary-dark: #45a049;
    --primary-light: #81C784;
    --primary-lighter: #C8E6C9;
    --primary-alpha-10: rgba(76, 175, 80, 0.1);
    --primary-alpha-20: rgba(76, 175, 80, 0.2);

    /* ==================
       SECONDARY COLORS
       ================== */
    --secondary: #2271b1;
    --secondary-dark: #135e96;
    --secondary-light: #5b9dd9;

    /* ==================
       ACCENT COLORS
       ================== */
    --accent: #f0b849;
    --accent-dark: #e0a839;
    --accent-light: #f5d084;

    /* ==================
       STATUS COLORS
       ================== */
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;

    /* ==================
       NEUTRAL COLORS
       ================== */
    --gray-900: #2c3e50;
    --gray-800: #34495e;
    --gray-700: #596d7f;
    --gray-600: #7e8993;
    --gray-500: #adb5bd;
    --gray-400: #ced4da;
    --gray-300: #dee2e6;
    --gray-200: #e9ecef;
    --gray-100: #f8f9fa;
    --white: #ffffff;
    --black: #000000;

    /* ==================
       BACKGROUND COLORS
       ================== */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-dark: #2c3e50;
    --bg-overlay: rgba(0, 0, 0, 0.7);
    --bg-overlay-light: rgba(0, 0, 0, 0.5);

    /* ==================
       TYPOGRAPHY
       ================== */
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                    "Helvetica Neue", Arial, sans-serif;
    --font-heading: "Poppins", "Montserrat", sans-serif;
    --font-mono: "SF Mono", Monaco, "Cascadia Code", Consolas, monospace;

    /* Font Sizes */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 4rem;        /* 64px */

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;

    /* ==================
       SPACING SCALE
       ================== */
    --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 */
    --space-32: 8rem;        /* 128px */

    /* ==================
       BORDER RADIUS
       ================== */
    --radius-none: 0;
    --radius-sm: 0.25rem;    /* 4px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;

    /* ==================
       SHADOWS
       ================== */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    /* ==================
       Z-INDEX SCALE
       ================== */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;

    /* ==================
       TRANSITIONS
       ================== */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;

    /* ==================
       BREAKPOINTS (for reference)
       ================== */
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --breakpoint-xxl: 1400px;
}

/* ========================================
   BASE STYLES
   ======================================== */

* {
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--gray-800);
    background-color: var(--bg-primary);
    margin: 0;
    padding: 0;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--gray-900);
    margin-top: 0;
    margin-bottom: var(--space-4);
}

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-top: 0;
    margin-bottom: var(--space-4);
    line-height: var(--leading-relaxed);
}

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

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

a:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

strong, b {
    font-weight: var(--font-bold);
}

em, i {
    font-style: italic;
}

small {
    font-size: var(--text-sm);
}

/* ==================
   RESPONSIVE TYPOGRAPHY
   ================== */

@media (max-width: 768px) {
    :root {
        --text-5xl: 2.5rem;  /* 40px */
        --text-4xl: 2rem;    /* 32px */
        --text-3xl: 1.5rem;  /* 24px */
    }

    body {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

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

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

.container-fluid {
    width: 100%;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text Colors */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-muted { color: var(--gray-600); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-white { color: var(--white); }

/* Background Colors */
.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-dark { background-color: var(--bg-dark); }
.bg-white { background-color: var(--white); }

/* Spacing Utilities */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

/* Display Utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Flex Utilities */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

/* Visibility */
@media (max-width: 768px) {
    .d-md-none { display: none; }
    .d-md-block { display: block; }
}

@media (min-width: 769px) {
    .d-md-up-none { display: none; }
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: var(--space-2) var(--space-4);
    text-decoration: none;
    z-index: var(--z-tooltip);
}

.skip-link:focus {
    top: 0;
}

/* ==================
   FOCUS STATES (Accessibility)
   ================== */

*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
.button:focus-visible {
    outline: 3px solid var(--primary);
    box-shadow: 0 0 0 4px var(--primary-alpha-20);
}

/* ==================
   RESPONSIVE IMAGES
   ================== */

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

/* ==================
   SELECTION
   ================== */

::selection {
    background-color: var(--primary);
    color: white;
}

::-moz-selection {
    background-color: var(--primary);
    color: white;
}
