/**
 * ZECHL Platforms - Design System
 * A professional, enterprise-grade design system
 *
 * Based on ZECHL brand colors
 */

/* ============================================
   COLOR SYSTEM
   ============================================ */
:root {
    /* Primary Brand Colors */
    --zechl-blue-primary: #0052CC;
    --zechl-blue-light: #E8F0FE;
    --zechl-blue-dark: #003D99;
    --zechl-blue-50: #F0F6FF;
    --zechl-blue-100: #DCE9FF;
    --zechl-blue-500: #0052CC;
    --zechl-blue-600: #0047B3;
    --zechl-blue-700: #003D99;

    /* Secondary Colors */
    --zechl-red-primary: #D32F2F;
    --zechl-red-light: #FFEBEE;
    --zechl-red-dark: #B71C1C;

    --zechl-green-primary: #2E7D32;
    --zechl-green-light: #E8F5E9;
    --zechl-green-dark: #1B5E20;

    /* Neutral Palette */
    --zechl-gray-50: #FAFAFA;
    --zechl-gray-100: #F5F5F5;
    --zechl-gray-200: #EEEEEE;
    --zechl-gray-300: #E0E0E0;
    --zechl-gray-400: #BDBDBD;
    --zechl-gray-500: #9E9E9E;
    --zechl-gray-600: #757575;
    --zechl-gray-700: #616161;
    --zechl-gray-800: #424242;
    --zechl-gray-900: #212121;

    /* Semantic Colors */
    --color-success: var(--zechl-green-primary);
    --color-success-light: var(--zechl-green-light);
    --color-warning: #F57C00;
    --color-warning-light: #FFF3E0;
    --color-danger: var(--zechl-red-primary);
    --color-danger-light: var(--zechl-red-light);
    --color-info: #0288D1;
    --color-info-light: #E1F5FE;

    /* Application Status Colors */
    --status-pending: #FFA726;
    --status-shortlisted: #42A5F5;
    --status-interviewing: #7E57C2;
    --status-offered: #66BB6A;
    --status-rejected: #EF5350;
    --status-withdrawn: #78909C;

    /* Background Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: var(--zechl-gray-50);
    --bg-tertiary: var(--zechl-gray-100);
    --bg-elevated: #FFFFFF;

    /* Text Colors */
    --text-primary: var(--zechl-gray-900);
    --text-secondary: var(--zechl-gray-700);
    --text-tertiary: var(--zechl-gray-600);
    --text-disabled: var(--zechl-gray-400);
    --text-inverse: #FFFFFF;

    /* Border Colors */
    --border-primary: var(--zechl-gray-300);
    --border-secondary: var(--zechl-gray-200);
    --border-focus: var(--zechl-blue-primary);

    /* Bootstrap Overrides */
    --bs-body-color: var(--text-primary);
    --bs-card-color: var(--text-primary);
    --bs-highlight-bg: var(--color-warning-light);
    --bs-paper-bg: var(--bg-primary);
    --bs-paper-bg-rgb: 255, 255, 255;

    /* Shadow System */
    --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-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Spacing Scale (8px base) */
    --space-xs: 0.25rem;    /* 4px */
    --space-sm: 0.5rem;     /* 8px */
    --space-md: 1rem;       /* 16px */
    --space-lg: 1.5rem;     /* 24px */
    --space-xl: 2rem;       /* 32px */
    --space-2xl: 3rem;      /* 48px */
    --space-3xl: 4rem;      /* 64px */

    /* Border Radius */
    --radius-sm: 0.375rem;  /* 6px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-2xl: 1.5rem;   /* 24px */
    --radius-full: 9999px;

    /* Typography Scale */
    --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-mono: 'Fira Code', 'Courier New', monospace;

    --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-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* 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;

    /* Bootstrap 5 Modal Variable Overrides (Design System Sync) */
    --bs-modal-zindex: var(--z-modal);
    --bs-backdrop-zindex: var(--z-modal-backdrop);
    --bs-modal-border-radius: var(--radius-xl);
    --bs-modal-header-border-width: 1px;
    --bs-modal-footer-border-width: 1px;
}

/* Dark Mode Colors */
[data-bs-theme="dark"] {
    --bg-primary: #1A1A1A;
    --bg-secondary: #242424;
    --bg-tertiary: #2E2E2E;
    --bg-elevated: #242424;

    --text-primary: #F5F5F5;
    --text-secondary: #BDBDBD;
    --text-tertiary: #9E9E9E;
    --text-disabled: #616161;

    --border-primary: #424242;
    --border-secondary: #2E2E2E;

    --zechl-blue-light: rgba(0, 82, 204, 0.15);
    --zechl-red-light: rgba(211, 47, 47, 0.15);
    --zechl-green-light: rgba(46, 125, 50, 0.15);

    --bs-paper-bg: #1A1A1A;
    --bs-paper-bg-rgb: 26, 26, 26;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

h1, .h1 { font-size: var(--font-size-4xl); }
h2, .h2 { font-size: var(--font-size-3xl); }
h3, .h3 { font-size: var(--font-size-2xl); }
h4, .h4 { font-size: var(--font-size-xl); }
h5, .h5 { font-size: var(--font-size-lg); }
h6, .h6 { font-size: var(--font-size-base); }

.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); }

/* ============================================
   BUTTON SYSTEM
   ============================================ */
.btn {
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn:focus,
.btn:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--zechl-blue-primary);
    border-color: var(--zechl-blue-primary);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: var(--zechl-blue-dark);
    border-color: var(--zechl-blue-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Status-specific buttons */
.btn-success {
    background: var(--color-success);
    border-color: var(--color-success);
}

.btn-danger {
    background: var(--color-danger);
    border-color: var(--color-danger);
}

.btn-warning {
    background: var(--color-warning);
    border-color: var(--color-warning);
}

/* ============================================
   CARD SYSTEM
   ============================================ */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-elevated {
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-secondary);
    padding: var(--space-lg);
    font-weight: var(--font-weight-semibold);
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--border-secondary);
    padding: var(--space-lg);
}

/* Hover effect for interactive cards */
.card-hover {
    transition: all var(--transition-base);
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   BADGE SYSTEM
   ============================================ */
.badge {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Status Badges */
.badge-status-pending {
    background: var(--status-pending);
    color: white;
}

.badge-status-shortlisted {
    background: var(--status-shortlisted);
    color: white;
}

.badge-status-interviewing {
    background: var(--status-interviewing);
    color: white;
}

.badge-status-offered {
    background: var(--status-offered);
    color: white;
}

.badge-status-rejected {
    background: var(--status-rejected);
    color: white;
}

.badge-status-withdrawn {
    background: var(--status-withdrawn);
    color: white;
}

/* ============================================
   FORM CONTROLS
   ============================================ */
.form-control,
.form-select {
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--zechl-blue-light);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.form-label {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-sm);
}

/* Form validation */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--color-danger);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 3px var(--color-danger-light);
}

.invalid-feedback {
    color: var(--color-danger);
    font-size: var(--font-size-sm);
    margin-top: var(--space-xs);
}

/* ============================================
   TABLE SYSTEM
   ============================================ */
.table {
    color: var(--text-primary);
}

.table thead th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-primary);
    padding: var(--space-md);
}

.table tbody tr {
    border-bottom: 1px solid var(--border-secondary);
    transition: all var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

.table tbody td {
    padding: var(--space-md);
    vertical-align: middle;
}

.table-success { --bs-table-bg: var(--color-success-light); }
.table-info { --bs-table-bg: var(--color-info-light); }
.table-warning { --bs-table-bg: var(--color-warning-light); }
.table-danger { --bs-table-bg: var(--color-danger-light); }

/* ============================================
   NAVIGATION IMPROVEMENTS
   ============================================ */
.layout-menu {
    background: linear-gradient(180deg, #1A2332 0%, #141B26 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.layout-menu .menu-link {
    color: rgba(255, 255, 255, 0.7);
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
    margin: 0.25rem 0.5rem;
    padding: 0.75rem 1rem;
}

.layout-menu .menu-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.layout-menu .menu-link.active {
    background: var(--zechl-blue-primary);
    color: white;
}

.layout-menu .menu-header {
    color: rgba(255, 255, 255, 0.4);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 1rem 1rem 0.5rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.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); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { 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); }

/* Hover lift effect */
.hover-lift {
    transition: all var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Focus-visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */
.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 to main content link */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1rem;
    background: var(--zechl-blue-primary);
    color: white;
    text-decoration: none;
}

.skip-to-main:focus {
    left: 0;
    top: 0;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 768px) {
    :root {
        --font-size-4xl: 1.875rem;  /* 30px */
        --font-size-3xl: 1.5rem;    /* 24px */
        --font-size-2xl: 1.25rem;   /* 20px */
    }

    .card-body {
        padding: var(--space-md);
    }

    .table thead th,
    .table tbody td {
        padding: var(--space-sm);
    }
}

/* ============================================
   ANIMATION SYSTEM
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn var(--transition-base) ease-out;
}

.animate-slide-in-right {
    animation: slideInRight var(--transition-base) ease-out;
}

/* ============================================
   LOADING STATES
   ============================================ */
.skeleton {
    background: linear-gradient(
            90deg,
            var(--bg-tertiary) 25%,
            var(--bg-secondary) 50%,
            var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: pulse 2s ease-in-out infinite;
    border-radius: var(--radius-md);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .no-print {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid var(--border-primary);
    }
}