/* ===== RESPONSIVE CSS FRAMEWORK WITH DARK/LIGHT THEME ===== */

/* CSS Custom Properties - Mobile First Approach */
:root {
    /* Navy Blue Gradient Colors - Dark Theme (Default) */
    --primary-navy: #1a365d;
    --primary-navy-light: #2c5282;
    --primary-navy-dark: #153e75;
    --secondary-navy: #2d3748;
    --accent-blue: #3182ce;
    --accent-blue-hover: #2b6cb0;
    
    /* Background Gradients */
    --bg-gradient-primary: linear-gradient(135deg, #1a365d 0%, #2d3748 100%);
    --bg-gradient-secondary: linear-gradient(135deg, #2c5282 0%, #2d3748 100%);
    --bg-gradient-card: linear-gradient(135deg, rgba(26, 54, 93, 0.8) 0%, rgba(45, 55, 72, 0.8) 100%);
    
    /* Background Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --card-bg: rgba(26, 54, 93, 0.6);
    --card-bg-hover: rgba(26, 54, 93, 0.8);
    --input-bg: rgba(45, 55, 72, 0.8);
    --hover-bg: rgba(99, 179, 237, 0.1);
    --overlay-bg: rgba(15, 23, 42, 0.9);
    
    /* Text Colors */
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-accent: #63b3ed;
    --text-inverse: #1a202c;
    
    /* Border Colors */
    --border-primary: #4a5568;
    --border-secondary: #2d3748;
    --border-accent: #63b3ed;
    --border-light: rgba(226, 232, 240, 0.1);
    
    /* Status Colors */
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --error-color: #f56565;
    --info-color: #4299e1;
    
    /* Shadows with Navy Theme */
    --shadow-sm: 0 1px 2px 0 rgba(26, 54, 93, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(26, 54, 93, 0.1), 0 2px 4px -1px rgba(26, 54, 93, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(26, 54, 93, 0.1), 0 4px 6px -2px rgba(26, 54, 93, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(26, 54, 93, 0.1), 0 10px 10px -5px rgba(26, 54, 93, 0.04);
    --shadow-glow: 0 0 20px rgba(99, 179, 237, 0.3);
    
    /* Responsive Breakpoints */
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --breakpoint-xxl: 1400px;
    
    /* Container Sizes */
    --container-sm: 540px;
    --container-md: 720px;
    --container-lg: 960px;
    --container-xl: 1140px;
    --container-xxl: 1320px;
    --container-padding: 1rem;
    
    /* Typography Scale */
    --font-family-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    --font-family-arabic: 'Noto Sans Arabic', 'Cairo', 'Amiri', Arial, sans-serif;
    
    /* Font Sizes - Mobile First */
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 1.875rem;  /* 30px */
    --font-size-4xl: 2.25rem;   /* 36px */
    --font-size-5xl: 3rem;      /* 48px */
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Spacing Scale */
    --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 */
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
    --transition-all: all 0.2s ease;
    
    /* 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;
}

/* Light Theme Variables Override */
.theme-light {
    /* Light Background Gradients */
    --bg-gradient-primary: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    --bg-gradient-secondary: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    --bg-gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(247, 250, 252, 0.9) 100%);
    
    /* Light Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #edf2f7;
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-bg-hover: rgba(255, 255, 255, 0.95);
    --input-bg: #ffffff;
    --hover-bg: rgba(49, 130, 206, 0.05);
    --overlay-bg: rgba(255, 255, 255, 0.95);
    
    /* Light Text Colors */
    --text-primary: #1a202c;
    --text-secondary: #2d3748;
    --text-muted: #718096;
    --text-accent: #3182ce;
    --text-inverse: #ffffff;
    
    /* Light Border Colors */
    --border-primary: #e2e8f0;
    --border-secondary: #cbd5e1;
    --border-accent: #3182ce;
    --border-light: rgba(45, 55, 72, 0.1);
    
    /* Light 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), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(49, 130, 206, 0.2);
}

/* ===== BASE STYLES - MOBILE FIRST ===== */

/* CSS Reset and Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: var(--line-height-normal);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background: var(--bg-gradient-primary);
    min-height: 100vh;
    transition: var(--transition-all);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Arabic Text Support */
[lang="ar"], [dir="rtl"] {
    font-family: var(--font-family-arabic);
    text-align: right;
}

/* Focus Management */
:focus {
    outline: 2px solid var(--border-accent);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Selection Styles */
::selection {
    background-color: var(--accent-blue);
    color: var(--text-inverse);
}

/* ===== RESPONSIVE CONTAINER SYSTEM ===== */

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--container-padding);
}

/* Mobile First Container Sizes */
@media (min-width: 576px) {
    .container {
        max-width: var(--container-sm);
    }
}

@media (min-width: 768px) {
    .container {
        max-width: var(--container-md);
    }
}

@media (min-width: 992px) {
    .container {
        max-width: var(--container-lg);
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: var(--container-xl);
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: var(--container-xxl);
    }
}

/* ===== RESPONSIVE HEADER WITH ANIMATIONS ===== */

.main-header {
    background: var(--bg-gradient-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-4) 0;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    transition: var(--transition-all);
    box-shadow: var(--shadow-sm);
}

.main-header.scrolled {
    padding: var(--space-3) 0;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

.site-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin: 0;
    transition: var(--transition-all);
}

.site-title a {
    color: var(--text-primary);
    text-decoration: none;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: var(--transition-all);
}

.site-title a:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-sm);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    position: relative;
    transition: var(--transition-all);
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--hover-bg), transparent);
    transition: left 0.5s ease;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-accent);
    background: var(--hover-bg);
    transform: translateY(-1px);
}

.nav-link.active {
    box-shadow: var(--shadow-sm);
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    cursor: pointer;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    transition: var(--transition-all);
    position: relative;
    overflow: hidden;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--hover-bg);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.theme-toggle:hover::before {
    width: 100px;
    height: 100px;
}

.theme-toggle:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-glow);
}

.theme-toggle:active {
    transform: translateY(0) scale(0.95);
}

.theme-icon {
    position: relative;
    z-index: 1;
    transition: var(--transition-all);
}

.theme-toggle:hover .theme-icon {
    transform: rotate(180deg);
}

/* ===== RESPONSIVE GRID SYSTEM ===== */

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(-1 * var(--space-3));
}

.col {
    flex: 1;
    padding: 0 var(--space-3);
    margin-bottom: var(--space-4);
}

/* Column Sizes - Mobile First */
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }

/* Responsive Column Classes */
@media (min-width: 576px) {
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
    .col-sm-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-sm-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-sm-9 { flex: 0 0 75%; max-width: 75%; }
    .col-sm-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-sm-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .col-sm-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
    .col-sm-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-sm-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
}

@media (min-width: 768px) {
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
}

@media (min-width: 992px) {
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
    .col-lg-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
    .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .col-lg-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-lg-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
}

/* ===== MAIN CONTENT AREA ===== */

.main-content {
    padding: var(--space-8) 0;
    min-height: calc(100vh - 200px);
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FORM ELEMENTS WITH ANIMATIONS ===== */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    transition: var(--transition-all);
}

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: inherit;
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background: var(--input-bg);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    transition: var(--transition-all);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.1);
    transform: translateY(-1px);
}

.form-control:hover {
    border-color: var(--border-accent);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Select */
select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right var(--space-3) center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: var(--space-10);
}

/* Form Validation States */
.form-control.is-valid {
    border-color: var(--success-color);
}

.form-control.is-invalid {
    border-color: var(--error-color);
}

.form-feedback {
    font-size: var(--font-size-sm);
    margin-top: var(--space-1);
}

.form-feedback.valid-feedback {
    color: var(--success-color);
}

.form-feedback.invalid-feedback {
    color: var(--error-color);
}

/* ===== BUTTON SYSTEM WITH ANIMATIONS ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: var(--line-height-tight);
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: var(--transition-all);
    position: relative;
    overflow: hidden;
    min-height: 44px; /* Touch-friendly minimum */
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Button Variants */
.btn-primary {
    color: var(--text-inverse);
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--primary-navy-light) 100%);
    border-color: var(--accent-blue);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-blue-hover) 0%, var(--primary-navy) 100%);
    border-color: var(--accent-blue-hover);
}

.btn-secondary {
    color: var(--text-primary);
    background: var(--card-bg);
    border-color: var(--border-primary);
}

.btn-secondary:hover {
    background: var(--card-bg-hover);
    border-color: var(--border-accent);
}

.btn-outline {
    color: var(--text-accent);
    background: transparent;
    border-color: var(--border-accent);
}

.btn-outline:hover {
    color: var(--text-inverse);
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.btn-ghost {
    color: var(--text-secondary);
    background: transparent;
    border-color: transparent;
}

.btn-ghost:hover {
    color: var(--text-accent);
    background: var(--hover-bg);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
    min-height: 36px;
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--font-size-lg);
    min-height: 52px;
}

/* Button with Icon */
.btn-icon {
    padding: var(--space-3);
    min-width: 44px;
}

.btn .icon {
    font-size: 1.2em;
}

.btn .icon:first-child {
    margin-left: calc(-1 * var(--space-1));
}

.btn .icon:last-child {
    margin-right: calc(-1 * var(--space-1));
}

/* ===== CARD COMPONENTS WITH ANIMATIONS ===== */

.card {
    background: var(--bg-gradient-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: var(--transition-all);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
    opacity: 0;
    transition: var(--transition-all);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-accent);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-gradient-secondary);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.card-text {
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

/* Card Variants */
.card-elevated {
    box-shadow: var(--shadow-lg);
}

.card-elevated:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-6px);
}

.card-interactive {
    cursor: pointer;
    transition: var(--transition-all);
}

.card-interactive:hover {
    transform: translateY(-2px) scale(1.02);
}

.card-interactive:active {
    transform: translateY(0) scale(0.98);
}

/* ===== LINKS AND TYPOGRAPHY ===== */

a {
    color: var(--text-accent);
    text-decoration: none;
    transition: var(--transition-all);
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--text-accent);
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

a:hover {
    color: var(--accent-blue-hover);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: var(--line-height-tight);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

/* Paragraphs */
p {
    margin-bottom: var(--space-4);
    line-height: var(--line-height-relaxed);
    color: var(--text-secondary);
}

/* Lists */
ul, ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
}

li {
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
}

/* ===== PROFESSIONAL ANIMATIONS ===== */

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slide-left {
    animation: slideInFromLeft 0.5s ease-out;
}

.animate-slide-right {
    animation: slideInFromRight 0.5s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Loading Shimmer Effect */
.loading-shimmer {
    background: linear-gradient(90deg, var(--card-bg) 25%, var(--hover-bg) 50%, var(--card-bg) 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* ===== UTILITY CLASSES ===== */

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--accent-blue);
    color: var(--text-inverse);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    text-decoration: none;
    z-index: var(--z-tooltip);
    transition: var(--transition-all);
}

.skip-link:focus {
    top: 6px;
}

/* 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-accent { color: var(--text-accent); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-error { color: var(--error-color); }
.text-info { color: var(--info-color); }

/* Font Weights */
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Font Sizes */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }
.text-5xl { font-size: var(--font-size-5xl); }

/* Spacing - Margin */
.m-0 { margin: 0; }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-5 { margin: var(--space-5); }
.m-6 { margin: var(--space-6); }
.m-8 { margin: var(--space-8); }
.m-10 { margin: var(--space-10); }
.m-12 { margin: var(--space-12); }

.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); }
.mt-8 { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mt-12 { margin-top: var(--space-12); }

.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); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }
.mb-12 { margin-bottom: var(--space-12); }

.ml-0 { margin-left: 0; }
.ml-1 { margin-left: var(--space-1); }
.ml-2 { margin-left: var(--space-2); }
.ml-3 { margin-left: var(--space-3); }
.ml-4 { margin-left: var(--space-4); }
.ml-5 { margin-left: var(--space-5); }
.ml-6 { margin-left: var(--space-6); }

.mr-0 { margin-right: 0; }
.mr-1 { margin-right: var(--space-1); }
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }
.mr-4 { margin-right: var(--space-4); }
.mr-5 { margin-right: var(--space-5); }
.mr-6 { margin-right: var(--space-6); }

/* Spacing - Padding */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: var(--space-1); }
.pt-2 { padding-top: var(--space-2); }
.pt-3 { padding-top: var(--space-3); }
.pt-4 { padding-top: var(--space-4); }
.pt-5 { padding-top: var(--space-5); }
.pt-6 { padding-top: var(--space-6); }
.pt-8 { padding-top: var(--space-8); }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: var(--space-1); }
.pb-2 { padding-bottom: var(--space-2); }
.pb-3 { padding-bottom: var(--space-3); }
.pb-4 { padding-bottom: var(--space-4); }
.pb-5 { padding-bottom: var(--space-5); }
.pb-6 { padding-bottom: var(--space-6); }
.pb-8 { padding-bottom: var(--space-8); }

.pl-0 { padding-left: 0; }
.pl-1 { padding-left: var(--space-1); }
.pl-2 { padding-left: var(--space-2); }
.pl-3 { padding-left: var(--space-3); }
.pl-4 { padding-left: var(--space-4); }
.pl-5 { padding-left: var(--space-5); }
.pl-6 { padding-left: var(--space-6); }

.pr-0 { padding-right: 0; }
.pr-1 { padding-right: var(--space-1); }
.pr-2 { padding-right: var(--space-2); }
.pr-3 { padding-right: var(--space-3); }
.pr-4 { padding-right: var(--space-4); }
.pr-5 { padding-right: var(--space-5); }
.pr-6 { padding-right: var(--space-6); }

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-grid { display: grid; }

/* Flexbox */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.align-stretch { align-items: stretch; }

/* Position */
.position-static { position: static; }
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }

/* Border Radius */
.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadows */
.shadow-none { box-shadow: none; }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-fit { width: fit-content; }

/* Height */
.h-full { height: 100%; }
.h-auto { height: auto; }
.h-screen { height: 100vh; }

/* Visibility */
.visible { visibility: visible; }
.invisible { visibility: hidden; }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* ===== RESPONSIVE DESIGN - MOBILE FIRST ===== */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .site-title {
        font-size: var(--font-size-2xl);
    }
    
    .main-nav {
        gap: var(--space-8);
    }
    
    .main-content {
        padding: var(--space-10) 0;
    }
    
    /* Responsive utilities */
    .d-sm-none { display: none; }
    .d-sm-block { display: block; }
    .d-sm-flex { display: flex; }
    
    .text-sm-left { text-align: left; }
    .text-sm-center { text-align: center; }
    .text-sm-right { text-align: right; }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    :root {
        --container-padding: 1.5rem;
    }
    
    .header-content {
        gap: var(--space-6);
    }
    
    .main-content {
        padding: var(--space-12) 0;
    }
    
    .card {
        border-radius: var(--radius-2xl);
    }
    
    .btn {
        padding: var(--space-4) var(--space-6);
    }
    
    /* Responsive utilities */
    .d-md-none { display: none; }
    .d-md-block { display: block; }
    .d-md-flex { display: flex; }
    
    .text-md-left { text-align: left; }
    .text-md-center { text-align: center; }
    .text-md-right { text-align: right; }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .site-title {
        font-size: var(--font-size-3xl);
    }
    
    .main-content {
        padding: var(--space-16) 0;
    }
    
    .card:hover {
        transform: translateY(-6px);
    }
    
    /* Responsive utilities */
    .d-lg-none { display: none; }
    .d-lg-block { display: block; }
    .d-lg-flex { display: flex; }
    
    .text-lg-left { text-align: left; }
    .text-lg-center { text-align: center; }
    .text-lg-right { text-align: right; }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    :root {
        --container-padding: 2rem;
    }
    
    .main-header {
        padding: var(--space-5) 0;
    }
    
    .main-content {
        padding: var(--space-20) 0;
    }
    
    /* Responsive utilities */
    .d-xl-none { display: none; }
    .d-xl-block { display: block; }
    .d-xl-flex { display: flex; }
    
    .text-xl-left { text-align: left; }
    .text-xl-center { text-align: center; }
    .text-xl-right { text-align: right; }
}

/* Mobile-specific optimizations */
@media (max-width: 575px) {
    :root {
        --container-padding: var(--space-4);
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
    
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-4);
    }
    
    .nav-link {
        padding: var(--space-3) var(--space-4);
        min-width: 44px;
        min-height: 44px;
    }
    
    .theme-toggle {
        order: -1;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-sm {
        width: auto;
    }
    
    .card {
        margin-bottom: var(--space-4);
    }
    
    .card-body {
        padding: var(--space-4);
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Mobile-only utilities */
    .mobile-hidden { display: none; }
    .mobile-only { display: block; }
}

/* Tablet-specific optimizations */
@media (min-width: 576px) and (max-width: 991px) {
    .tablet-hidden { display: none; }
    .tablet-only { display: block; }
}

/* Desktop-specific optimizations */
@media (min-width: 992px) {
    .desktop-hidden { display: none; }
    .desktop-only { display: block; }
    
    .mobile-only,
    .tablet-only {
        display: none;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .main-header {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    
    .card {
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .animate-fade-in,
    .animate-slide-left,
    .animate-slide-right,
    .animate-scale-in,
    .animate-pulse {
        animation: none;
    }
}

/* Dark mode preferences */
@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) {
        color-scheme: dark;
    }
}

/* Light mode preferences */
@media (prefers-color-scheme: light) {
    :root.theme-light {
        color-scheme: light;
    }
}
/* ===== FOOTER STYLES ===== */

.main-footer {
    background: var(--bg-gradient-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-light);
    margin-top: var(--space-16);
    padding: var(--space-12) 0 var(--space-6) 0;
    position: relative;
}

.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
    opacity: 0.5;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.footer-section h3,
.footer-section h4 {
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.footer-section p {
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-3);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: var(--space-2);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-all);
    padding: var(--space-1) 0;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--text-accent);
    transform: translateX(4px);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.footer-bottom p {
    margin: 0;
    opacity: 0.8;
}

/* Social Links in Footer */
.social-links {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    margin-top: var(--space-4);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-all);
}

.social-link:hover {
    background: var(--hover-bg);
    border-color: var(--border-accent);
    color: var(--text-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}