/**
 * SecureArk Design System
 * 
 * Premium dark theme with glassmorphism, gradients, and modern aesthetics.
 * CSS Custom Properties for easy theming and consistency.
 */

/* ============================================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================================ */

:root {
    /* Primary Colors - SecureArk Blue */
    --color-primary: #1E3A8A;
    --color-primary-dark: #172d6d;
    --color-primary-light: #3B5CB8;
    --color-primary-rgb: 30, 58, 138;

    /* Secondary Colors - SecureArk Gold */
    --color-secondary: #F5C400;
    --color-secondary-dark: #D4A900;
    --color-secondary-light: #FFD633;
    --color-secondary-rgb: 245, 196, 0;

    /* Accent Colors - Light Blue */
    --color-accent: #4A90D9;
    --color-accent-dark: #3A7BC0;
    --color-accent-light: #6BA5E7;
    --color-accent-rgb: 74, 144, 217;

    /* Success/Error/Warning */
    --color-success: #10b981;
    --color-success-light: #34d399;
    --color-error: #ef4444;
    --color-error-light: #f87171;
    --color-warning: #f59e0b;
    --color-warning-light: #fbbf24;
    --color-info: #3b82f6;
    --color-info-light: #60a5fa;

    /* Dark Theme Background Colors */
    --bg-primary: #070B14;
    --bg-secondary: #0D1321;
    --bg-tertiary: #141C2F;
    --bg-card: rgba(20, 28, 47, 0.6);
    --bg-card-hover: rgba(20, 28, 47, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-tertiary: rgba(255, 255, 255, 0.65);
    --text-muted: rgba(255, 255, 255, 0.45);
    --text-dark: #0D1321;

    /* Border Colors */
    --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);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    --gradient-primary-hover: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-secondary-light) 100%);
    --gradient-accent: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
    --gradient-dark: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    --gradient-radial: radial-gradient(ellipse at center, var(--bg-tertiary) 0%, var(--bg-primary) 70%);
    --gradient-glow: radial-gradient(ellipse at center, rgba(var(--color-primary-rgb), 0.15) 0%, transparent 70%);
    --gradient-gold: linear-gradient(135deg, var(--color-secondary) 0%, #FFE066 50%, var(--color-secondary) 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(var(--color-primary-rgb), 0.3);
    --shadow-glow-accent: 0 0 40px rgba(var(--color-accent-rgb), 0.3);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Outfit', var(--font-primary);
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;
    --text-7xl: 4.5rem;
    --text-8xl: 6rem;

    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* Letter Spacing */
    --tracking-tighter: -0.05em;
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;
    --space-40: 10rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-3xl: 2rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
    --transition-slower: 700ms ease;

    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-notification: 800;
    --z-ai-chat: 900;

    /* Container Widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1536px;

    /* Glassmorphism */
    --glass-blur: 20px;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* Responsive Overrides (Mobile First approach adjustment) */
@media (max-width: 768px) {
    :root {
        /* Reduce massive spacing on mobile */
        --space-12: 2rem;
        --space-16: 2.5rem;
        --space-20: 3rem;
        --space-24: 4rem;
        --space-32: 5rem;
        --space-40: 6rem;

        /* Adjust Typography */
        --text-5xl: 2.5rem;
        /* h1 */
        --text-4xl: 2rem;
        /* h2 */
        --text-3xl: 1.75rem;
        /* h3 */
        --text-2xl: 1.5rem;
        /* h4 */

        /* Layout */
        --container-padding: var(--space-4);
    }
}

/* Light mode overrides (optional) */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.7);

    --text-primary: #1a1a2e;
    --text-secondary: rgba(26, 26, 46, 0.8);
    --text-tertiary: rgba(26, 26, 46, 0.6);
    --text-muted: rgba(26, 26, 46, 0.4);

    --border-color: rgba(0, 0, 0, 0.1);
    --border-color-light: rgba(0, 0, 0, 0.05);
    --border-color-strong: rgba(0, 0, 0, 0.2);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   RESET & BASE STYLES
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: rgba(var(--color-primary-rgb), 0.3);
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color-strong);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Focus styles */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

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);
}

@media (max-width: 768px) {
    h1 {
        font-size: var(--text-4xl);
    }

    h2 {
        font-size: var(--text-3xl);
    }

    h3 {
        font-size: var(--text-2xl);
    }

    h4 {
        font-size: var(--text-xl);
    }
}

p {
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-light);
}

strong,
b {
    font-weight: var(--font-semibold);
}

small {
    font-size: var(--text-sm);
}

/* Text utilities */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-accent {
    color: var(--color-accent);
}

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* Display text classes */
.display-1 {
    font-size: var(--text-8xl);
    font-weight: var(--font-extrabold);
    letter-spacing: var(--tracking-tighter);
    line-height: var(--leading-none);
}

.display-2 {
    font-size: var(--text-7xl);
    font-weight: var(--font-bold);
    letter-spacing: var(--tracking-tight);
}

.lead {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

/* ============================================================
   LAYOUT
   ============================================================ */

.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-sm {
    max-width: var(--container-sm);
}

.container-md {
    max-width: var(--container-md);
}

.container-lg {
    max-width: var(--container-lg);
}

.container-2xl {
    max-width: var(--container-2xl);
}

.section {
    padding: var(--space-16) 0;
    /* Reduced from 24 for better default, scales down on mobile */
    position: relative;
}

.section-sm {
    padding: var(--space-8) 0;
}

.section-lg {
    padding: var(--space-24) 0;
}

/* Flexbox utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

/* Grid utilities */
.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .lg\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .md\:grid-cols-1 {
        grid-template-columns: 1fr;
    }

    .md\:flex-col {
        flex-direction: column;
    }
}

/* ============================================================
   GLASSMORPHISM COMPONENTS
   ============================================================ */

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    transition: all var(--transition-base);
}

.glass-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-strong);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.glass-panel {
    background: rgba(var(--color-primary-rgb), 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(var(--color-primary-rgb), 0.1);
    border-radius: var(--radius-2xl);
}

/* ============================================================
   BACKGROUND EFFECTS
   ============================================================ */

.bg-gradient {
    background: var(--gradient-dark);
}

.bg-gradient-radial {
    background: var(--gradient-radial);
}

.bg-glow {
    position: relative;
}

.bg-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: var(--gradient-glow);
    filter: blur(100px);
    pointer-events: none;
    z-index: -1;
}

/* Animated gradient background */
.bg-animated-gradient {
    background: linear-gradient(-45deg, #667eea, #764ba2, #00d4ff, #667eea);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Grid pattern background */
.bg-grid {
    background-image:
        linear-gradient(rgba(var(--color-primary-rgb), 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--color-primary-rgb), 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Dot pattern background */
.bg-dots {
    background-image: radial-gradient(rgba(var(--color-primary-rgb), 0.15) 1px, transparent 1px);
    background-size: 30px 30px;
}

/* ============================================================
   SPACING UTILITIES
   ============================================================ */

.m-0 {
    margin: 0;
}

.m-auto {
    margin: auto;
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mt-12 {
    margin-top: var(--space-12);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.mb-12 {
    margin-bottom: var(--space-12);
}

.my-8 {
    margin-top: var(--space-8);
    margin-bottom: var(--space-8);
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

.p-8 {
    padding: var(--space-8);
}

.px-4 {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

.px-6 {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.py-4 {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
}

.py-8 {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
}

/* ============================================================
   VISIBILITY & DISPLAY
   ============================================================ */

.hidden {
    display: none !important;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.overflow-hidden {
    overflow: hidden;
}

@media (max-width: 768px) {
    .md\:hidden {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .md\:block {
        display: block;
    }
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */

.section-header {
    text-align: center;
    margin-bottom: var(--space-16);
}

.section-header .badge {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    background: rgba(var(--color-primary-rgb), 0.1);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-primary-light);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    margin-bottom: var(--space-4);
}

.section-header h2 {
    margin-bottom: var(--space-4);
}

.section-header p {
    max-width: 600px;
    margin: 0 auto;
    color: var(--text-tertiary);
}

/* ============================================================
   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 to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: var(--space-2) var(--space-4);
    z-index: 1000;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

/* Reduced motion */
@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;
    }
}