/**
 * Reggae Kenya Design System
 * 
 * Core CSS variables and design tokens
 *
 * @package ReggaeKenya
 * @version 1.0.0
 */

/* ============================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================ */

:root {
    /* Rasta Colors - Primary Palette */
    --rasta-red: #E8000D;
    --rasta-gold: #FCD116;
    --rasta-green: #078930;
    
    /* Rasta Color Variations */
    --rasta-red-dark: #B80000;
    --rasta-red-light: #FF1A2A;
    --rasta-gold-dark: #E0B800;
    --rasta-gold-light: #FFE14D;
    --rasta-green-dark: #056620;
    --rasta-green-light: #0AA945;
    
    /* Dark Mode Base Colors */
    --dark-base: #0A0A0A;
    --dark-layer-1: #121212;
    --dark-layer-2: #1A1A1D;
    --dark-layer-3: #2D2D30;
    --dark-border: #3D3D40;
    --dark-border-light: #4D4D50;
    
    /* Neon Accents */
    --neon-green: #39FF14;
    --neon-gold: #FFD700;
    --neon-red: #FF073A;
    --neon-blue: #00E0FF;
    
    /* Gradients */
    --rasta-gradient: linear-gradient(135deg, var(--rasta-red) 0%, var(--rasta-gold) 50%, var(--rasta-green) 100%);
    --rasta-gradient-vertical: linear-gradient(180deg, var(--rasta-red) 0%, var(--rasta-gold) 50%, var(--rasta-green) 100%);
    --dark-gradient: linear-gradient(180deg, var(--dark-base) 0%, var(--dark-layer-2) 100%);
    --dark-gradient-radial: radial-gradient(circle at top center, var(--dark-layer-2) 0%, var(--dark-base) 100%);
    
    /* Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: #B3B3B3;
    --text-muted: #808080;
    --text-disabled: #4D4D4D;
    --text-inverse: #0A0A0A;
    
    /* Semantic Colors */
    --success: var(--rasta-green);
    --success-light: var(--rasta-green-light);
    --warning: var(--rasta-gold);
    --warning-light: var(--rasta-gold-light);
    --error: var(--rasta-red);
    --error-light: var(--rasta-red-light);
    --info: #00A8E8;
    --info-light: #33BFFF;
    
    /* Spacing Scale (8px base) */
    --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 */
    
    /* Typography */
    --font-display: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Arial', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Courier New', monospace;
    
    /* Font Sizes */
    --font-xs: 0.75rem;      /* 12px */
    --font-sm: 0.875rem;     /* 14px */
    --font-base: 1rem;       /* 16px */
    --font-lg: 1.125rem;     /* 18px */
    --font-xl: 1.25rem;      /* 20px */
    --font-2xl: 1.5rem;      /* 24px */
    --font-3xl: 1.875rem;    /* 30px */
    --font-4xl: 2.25rem;     /* 36px */
    --font-5xl: 3rem;        /* 48px */
    --font-6xl: 3.75rem;     /* 60px */
    --font-7xl: 4.5rem;      /* 72px */
    
    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-black: 900;
    
    /* Line Heights */
    --line-tight: 1.25;
    --line-normal: 1.5;
    --line-relaxed: 1.75;
    --line-loose: 2;
    
    /* Letter Spacing */
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.4);
    
    /* Rasta Glow Effects */
    --glow-red: 0 0 20px rgba(232, 0, 13, 0.5);
    --glow-gold: 0 0 20px rgba(252, 209, 22, 0.5);
    --glow-green: 0 0 20px rgba(7, 137, 48, 0.5);
    --glow-rasta: 0 0 30px rgba(232, 0, 13, 0.3), 0 0 40px rgba(252, 209, 22, 0.3), 0 0 50px rgba(7, 137, 48, 0.3);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Easing Functions */
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Z-Index Scale */
    --z-negative: -1;
    --z-base: 0;
    --z-dropdown: 1000;
    --z-sticky: 1100;
    --z-fixed: 1200;
    --z-modal-backdrop: 1300;
    --z-modal: 1400;
    --z-popover: 1500;
    --z-tooltip: 1600;
    
    /* Container Widths */
    --container-xs: 480px;
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1400px;
    
    /* Breakpoints (for reference in JS) */
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;
}

/* ============================================
   GLOBAL RESETS & BASE STYLES
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-body);
    font-size: var(--font-base);
    font-weight: var(--font-normal);
    line-height: var(--line-normal);
    color: var(--text-primary);
    background: var(--dark-base);
    overflow-x: hidden;
}

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

::-moz-selection {
    background: var(--rasta-gold);
    color: var(--text-inverse);
}

/* Focus Styles */
:focus {
    outline: 2px solid var(--rasta-gold);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--rasta-gold);
    outline-offset: 2px;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    line-height: var(--line-tight);
    letter-spacing: var(--tracking-tight);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--font-5xl);
    font-weight: var(--font-black);
}

h2 {
    font-size: var(--font-4xl);
}

h3 {
    font-size: var(--font-3xl);
}

h4 {
    font-size: var(--font-2xl);
}

h5 {
    font-size: var(--font-xl);
}

h6 {
    font-size: var(--font-lg);
}

p {
    margin-bottom: var(--space-4);
}

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

a:hover {
    color: var(--neon-gold);
}

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

em, i {
    font-style: italic;
}

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

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--dark-layer-3);
    padding: 0.125em 0.375em;
    border-radius: var(--radius-sm);
}

pre {
    font-family: var(--font-mono);
    font-size: var(--font-sm);
    background: var(--dark-layer-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: var(--space-4);
}

blockquote {
    border-left: 4px solid var(--rasta-gold);
    padding-left: var(--space-4);
    margin-left: 0;
    margin-bottom: var(--space-4);
    font-style: italic;
    color: var(--text-secondary);
}

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

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

/* Text Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-rasta-red { color: var(--rasta-red); }
.text-rasta-gold { color: var(--rasta-gold); }
.text-rasta-green { color: var(--rasta-green); }

/* Font Weights */
.font-light { font-weight: var(--font-light); }
.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }
.font-black { font-weight: var(--font-black); }

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

/* Visibility */
.invisible { visibility: hidden; }
.visible { visibility: visible; }

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

/* Truncate Text */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Line Clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Spacing Utilities */
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* ============================================
   CONTAINER
   ============================================ */

.rk-container {
    width: 100%;
    max-width: var(--container-2xl);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

@media (min-width: 640px) {
    .rk-container {
        padding-left: var(--space-6);
        padding-right: var(--space-6);
    }
}

@media (min-width: 1024px) {
    .rk-container {
        padding-left: var(--space-8);
        padding-right: var(--space-8);
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--dark-layer-1);
}

::-webkit-scrollbar-thumb {
    background: var(--dark-layer-3);
    border-radius: var(--radius-full);
    border: 2px solid var(--dark-layer-1);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--rasta-gold);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--dark-layer-3) var(--dark-layer-1);
}

/* ============================================
   LOADING STATE
   ============================================ */

.rk-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.rk-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid var(--dark-border);
    border-top-color: var(--rasta-gold);
    border-radius: 50%;
    animation: rk-spin 0.8s linear infinite;
}

@keyframes rk-spin {
    to { transform: rotate(360deg); }
}
