/* ============================================================================
   MODERN 2026 DESIGN SYSTEM - Complete Theme
   Glassmorphism + Soft 3D + Premium SaaS UI
   ============================================================================ */

:root {
    /* PRIMARY COLOR PALETTE (2026 SaaS) */
    --primary-dark: #0B1F3B;        /* Dark blue - main brand */
    --primary-light: #1a3a5c;       /* Lighter variant */
    --secondary-maroon: #7A1F2B;    /* Secondary accent */
    --accent-red: #E53935;           /* Call-to-action red */
    --accent-red-light: #ff6b5b;    /* Lighter red */
    --accent-red-dark: #c62828;     /* Darker red */
    
    /* BACKGROUND & SURFACES */
    --bg-primary: #050812;           /* Deep dark background */
    --bg-secondary: #0a1525;         /* Secondary bg */
    --bg-tertiary: #0f1f3b;          /* Tertiary */
    --bg-card: rgba(15, 31, 59, 0.7); /* Card with glass effect */
    --bg-card-hover: rgba(15, 31, 59, 0.85);
    --bg-overlay: rgba(5, 8, 18, 0.6);
    
    /* TEXT COLORS */
    --text-primary: #f0f4f8;         /* Main text - light */
    --text-secondary: #a0b0c8;       /* Secondary text */
    --text-tertiary: #7a8fa6;        /* Tertiary text */
    --text-muted: #5a6f88;           /* Muted/disabled */
    --text-light: #e0e8f0;           /* Lightest */
    
    /* SEMANTIC COLORS */
    --success-green: #10B981;        /* Success state */
    --success-light: #6ee7b7;        /* Light success */
    --warning-amber: #F59E0B;        /* Warning state */
    --warning-light: #fcd34d;        /* Light warning */
    --error-red: #EF4444;            /* Error state */
    --error-light: #fca5a5;          /* Light error */
    --info-blue: #3B82F6;            /* Info state */
    --info-light: #93c5fd;           /* Light info */
    
    /* BORDERS & DIVIDERS */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-color-light: rgba(255, 255, 255, 0.05);
    --border-color-strong: rgba(255, 255, 255, 0.2);
    
    /* SHADOWS */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.3);
    --shadow-2xl: 0 20px 60px rgba(0, 0, 0, 0.4);
    
    /* GLOWS */
    --glow-red: 0 0 20px rgba(229, 57, 53, 0.3);
    --glow-red-bright: 0 0 30px rgba(229, 57, 53, 0.5);
    --glow-primary: 0 0 20px rgba(11, 31, 59, 0.3);
    --glow-accent: 0 0 20px rgba(16, 185, 129, 0.2);
    
    /* GRADIENTS */
    --gradient-primary: linear-gradient(135deg, #0B1F3B 0%, #1a3a5c 100%);
    --gradient-accent: linear-gradient(135deg, #E53935 0%, #ff6b5b 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #6ee7b7 100%);
    --gradient-warning: linear-gradient(135deg, #F59E0B 0%, #fcd34d 100%);
    --gradient-bg: linear-gradient(135deg, #050812 0%, #0a1525 50%, #0f1f3b 100%);
    
    /* TYPOGRAPHY */
    --font-family-sans: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-mono: 'Menlo', 'Monaco', '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-size-5xl: 3rem;          /* 48px */
    
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
    /* SPACING (8px grid) */
    --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 */
    
    /* BORDER RADIUS */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;
    
    /* TRANSITIONS */
    --transition-fast: 100ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* LAYOUT */
    --sidebar-width: 280px;
    --sidebar-width-collapsed: 80px;
    --topbar-height: 70px;
    --container-max: 1400px;
    
    /* Z-INDEX SCALE */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-tooltip: 600;
    --z-notification: 700;
}

/* ============================================================================
   BASE STYLES
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family-sans);
    background: var(--gradient-bg);
    background-attachment: fixed;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Remove scrollbar on iOS */
@supports (-webkit-touch-callout: none) {
    body {
        position: fixed;
        width: 100%;
    }
}

/* Selection */
::selection {
    background: var(--accent-red);
    color: white;
}

::-moz-selection {
    background: var(--accent-red);
    color: white;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    margin-bottom: var(--space-4);
    color: var(--text-light);
    letter-spacing: -0.02em;
}

h1 {
    font-size: var(--font-size-5xl);
}

h2 {
    font-size: var(--font-size-4xl);
}

h3 {
    font-size: var(--font-size-3xl);
}

h4 {
    font-size: var(--font-size-2xl);
}

h5 {
    font-size: var(--font-size-xl);
}

h6 {
    font-size: var(--font-size-lg);
}

p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

small {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

a {
    color: var(--accent-red);
    text-decoration: none;
    transition: all var(--transition-base);
}

a:hover {
    color: var(--accent-red-light);
}

code {
    font-family: var(--font-family-mono);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
    color: var(--info-light);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family-sans);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    padding: var(--space-3) var(--space-6);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    text-transform: capitalize;
    white-space: nowrap;
    gap: var(--space-2);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width var(--transition-base), height var(--transition-base);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* PRIMARY BUTTON */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    color: white;
    border-color: var(--accent-red);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--glow-red), var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

/* ACCENT BUTTON (Red CTA) */
.btn-accent {
    background: var(--gradient-accent);
    color: white;
    box-shadow: var(--glow-red);
}

.btn-accent:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--glow-red-bright), var(--shadow-xl);
}

.btn-accent:active {
    transform: translateY(0) scale(0.98);
}

/* SECONDARY BUTTON */
.btn-secondary {
    background: transparent;
    color: var(--accent-red);
    border-color: var(--accent-red);
}

.btn-secondary:hover {
    background: rgba(229, 57, 53, 0.1);
    transform: scale(1.02);
}

/* GHOST BUTTON */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--accent-red);
}

/* SUCCESS BUTTON */
.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--glow-accent), var(--shadow-lg);
}

/* DANGER BUTTON */
.btn-danger {
    background: var(--gradient-accent);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--glow-red), var(--shadow-lg);
}

/* DISABLED STATE */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* SIZE VARIANTS */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-lg);
}

.btn-xl {
    padding: var(--space-5) var(--space-10);
    font-size: var(--font-size-xl);
}

/* FULL WIDTH */
.btn-block {
    width: 100%;
    display: flex;
}

/* ICON BUTTON */
.btn-icon {
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    color: var(--accent-red);
}

/* ============================================================================
   CARDS & CONTAINERS
   ============================================================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(229, 57, 53, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.card:hover {
    border-color: var(--border-color-strong);
    box-shadow: var(--shadow-lg);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
}

.card-compact {
    padding: var(--space-4);
}

.card-bordered {
    border: 2px solid var(--border-color-strong);
}

/* GLASS CARD (Enhanced Glass Effect) */
.card-glass {
    background: rgba(15, 31, 59, 0.5);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ============================================================================
   FORMS & INPUTS
   ============================================================================ */

.form-group {
    margin-bottom: var(--space-6);
}

label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    text-transform: capitalize;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    transition: all var(--transition-base);
    appearance: none;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-red);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: var(--glow-red);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a0b0c8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    padding-right: var(--space-10);
}

/* CHECKBOX & RADIO */
input[type="checkbox"],
input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent-red);
}

/* FILE INPUT */
input[type="file"] {
    cursor: pointer;
}

/* FORM ERROR */
.form-error {
    color: var(--error-red);
    font-size: var(--font-size-sm);
    margin-top: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

input.is-error {
    border-color: var(--error-red);
    background: rgba(239, 68, 68, 0.05);
}

input.is-error:focus {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

/* SUCCESS STATE */
input.is-success {
    border-color: var(--success-green);
}

input.is-success:focus {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

/* ============================================================================
   BADGES & TAGS
   ============================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: rgba(229, 57, 53, 0.2);
    color: var(--accent-red);
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-green);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-amber);
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-red);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info-blue);
}

/* ============================================================================
   TABLES
   ============================================================================ */

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: rgba(0, 0, 0, 0.3);
    padding: var(--space-4);
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-color-light);
    color: var(--text-secondary);
}

tbody tr {
    transition: all var(--transition-base);
}

tbody tr:hover {
    background: rgba(0, 0, 0, 0.2);
}

tbody tr:hover td {
    color: var(--text-primary);
}

/* ============================================================================
   ALERTS & MESSAGES
   ============================================================================ */

.alert {
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    border-left: 4px solid;
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
    animation: slideInDown 300ms ease-out;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-green);
    color: var(--success-green);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning-amber);
    color: var(--warning-amber);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error-red);
    color: var(--error-red);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info-blue);
    color: var(--info-blue);
}

.alert-icon {
    font-size: var(--font-size-xl);
    flex-shrink: 0;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(229, 57, 53, 0.3);
    }
    50% {
        text-shadow: 0 0 40px rgba(229, 57, 53, 0.6);
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.grid {
    display: grid;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.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); }

.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); }

.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.text-center { text-align: center; }
.text-right { text-align: right; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    :root {
        --font-size-5xl: 2rem;
        --font-size-4xl: 1.5rem;
        --font-size-3xl: 1.25rem;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    h1 { font-size: var(--font-size-4xl); }
    h2 { font-size: var(--font-size-3xl); }
    
    .btn {
        width: 100%;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

:focus-visible {
    outline: 3px solid var(--accent-red);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent-red);
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-red);
    color: white;
    padding: var(--space-4);
    text-decoration: none;
    z-index: var(--z-tooltip);
}

.skip-to-main:focus {
    top: 0;
}

/* ============================================================================
   END OF MODERN THEME
   ============================================================================ */
