/**
 * ============================================================================
 * QENEX UNIFIED DESIGN SYSTEM - QENEX.AI THEME
 * Version: 2.0.0
 * ============================================================================
 *
 * Enhanced theme for qenex.ai - the most cutting-edge visual design.
 * Emphasizes AI/ML capabilities, neural network aesthetics, and
 * advanced computing visuals.
 *
 * This theme should be loaded AFTER the base design system files.
 */

/* ============================================================================
   QENEX.AI SPECIFIC OVERRIDES
   ============================================================================ */

:root {
    /* Text colors — inherited from tokens.css, no !important needed */

    /* Enhanced glow effects for AI emphasis */
    --ai-glow: 0 0 40px rgba(0, 240, 255, 0.5), 0 0 80px rgba(216, 59, 210, 0.3);
    --ai-glow-intense: 0 0 60px rgba(0, 240, 255, 0.6), 0 0 120px rgba(216, 59, 210, 0.4);

    /* Neural network inspired gradients */
    --gradient-neural: linear-gradient(
        135deg,
        rgba(0, 240, 255, 0.15) 0%,
        rgba(68, 49, 141, 0.3) 50%,
        rgba(216, 59, 210, 0.15) 100%
    );

    --gradient-synapse: linear-gradient(
        90deg,
        transparent,
        var(--brand-accent),
        var(--brand-magenta),
        transparent
    );

    /* AI-specific colors */
    --ai-primary: #00F0FF;
    --ai-secondary: #D83BD2;
    --ai-tertiary: #7B42F6;
}

/* Text colors — set via inheritance, not !important overrides */
body {
    color: var(--text-secondary);
}
h1, h2, h3, h4 {
    color: var(--text-primary);
}

/* ============================================================================
   NEURAL ORB - AI Brain Visualization
   ============================================================================ */

.neural-orb {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
}

.neural-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(
        circle,
        rgba(0, 240, 255, 0.8) 0%,
        rgba(68, 49, 141, 0.6) 50%,
        rgba(216, 59, 210, 0.4) 100%
    );
    border-radius: 50%;
    box-shadow: var(--ai-glow-intense);
    animation: neuralPulse 3s ease-in-out infinite;
}

@keyframes neuralPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: var(--ai-glow);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: var(--ai-glow-intense);
    }
}

.neural-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid;
    border-radius: 50%;
    opacity: 0.6;
}

.neural-ring:nth-child(2) {
    width: 120px;
    height: 120px;
    border-color: var(--ai-primary);
    animation: neuralRing 4s linear infinite;
}

.neural-ring:nth-child(3) {
    width: 180px;
    height: 180px;
    border-color: var(--ai-secondary);
    animation: neuralRing 6s linear infinite reverse;
}

.neural-ring:nth-child(4) {
    width: 240px;
    height: 240px;
    border-color: var(--ai-tertiary);
    animation: neuralRing 8s linear infinite;
}

@keyframes neuralRing {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
        opacity: 0.3;
    }
}

/* Neural nodes */
.neural-node {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--ai-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--ai-primary);
    animation: nodeFloat 3s ease-in-out infinite;
}

@keyframes nodeFloat {
    0%, 100% { opacity: 0.5; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ============================================================================
   AI DATA STREAM VISUALIZATION
   ============================================================================ */

.data-stream {
    position: relative;
    height: 200px;
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.stream-line {
    position: absolute;
    height: 2px;
    background: var(--gradient-synapse);
    animation: streamFlow 2s linear infinite;
}

@keyframes streamFlow {
    0% { left: -100%; width: 50%; }
    100% { left: 100%; width: 50%; }
}

.stream-line:nth-child(1) { top: 20%; animation-delay: 0s; animation-duration: 2s; }
.stream-line:nth-child(2) { top: 35%; animation-delay: 0.3s; animation-duration: 2.3s; }
.stream-line:nth-child(3) { top: 50%; animation-delay: 0.6s; animation-duration: 1.8s; }
.stream-line:nth-child(4) { top: 65%; animation-delay: 0.2s; animation-duration: 2.5s; }
.stream-line:nth-child(5) { top: 80%; animation-delay: 0.5s; animation-duration: 2.1s; }

/* ============================================================================
   ML MODEL CARDS
   ============================================================================ */

.ml-model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
}

.ml-model-card {
    background: var(--gradient-neural);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    position: relative;
    overflow: hidden;
    transition: var(--transition-all-base);
}

.ml-model-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 240, 255, 0.05) 100%
    );
    pointer-events: none;
}

.ml-model-card:hover {
    border-color: var(--ai-primary);
    box-shadow: var(--ai-glow);
    transform: translateY(-6px);
}

.model-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-3xl);
    margin-bottom: var(--space-6);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.model-type {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-caps);
    color: var(--ai-primary);
    margin-bottom: var(--space-2);
}

.model-name {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

.model-desc {
    color: var(--text-muted);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-6);
}

.model-stats {
    display: flex;
    gap: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-subtle);
}

.model-stat {
    text-align: center;
}

.model-stat-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.model-stat-label {
    font-size: var(--text-xs);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

/* ============================================================================
   AI PROCESSING INDICATOR
   ============================================================================ */

.ai-processing {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-6);
    background: var(--surface-raised);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
}

.ai-brain-icon {
    position: relative;
    width: 40px;
    height: 40px;
}

.ai-brain-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 2px solid var(--ai-primary);
    border-radius: 50%;
    animation: brainPulse 1.5s ease-out infinite;
}

@keyframes brainPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.ai-brain-pulse:nth-child(2) { animation-delay: 0.5s; }
.ai-brain-pulse:nth-child(3) { animation-delay: 1s; }

.ai-processing-text {
    flex: 1;
}

.ai-processing-label {
    font-size: var(--text-sm);
    color: var(--ai-primary);
    font-weight: var(--font-semibold);
}

.ai-processing-detail {
    font-size: var(--text-xs);
    color: var(--text-dim);
}

/* ============================================================================
   INFERENCE SPEED VISUALIZER
   ============================================================================ */

.inference-speed {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
}

.speed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

.speed-title {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.speed-badge {
    background: var(--color-success-bg);
    border: 1px solid var(--color-success-border);
    color: var(--color-success);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
}

.speed-comparison {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.speed-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.speed-label {
    width: 120px;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.speed-bar-track {
    flex: 1;
    height: 32px;
    background: var(--surface-dark);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.speed-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--text-inverse);
    transition: width 1.5s ease-out;
}

.speed-bar-fill.wasm {
    background: linear-gradient(90deg, var(--ai-primary), var(--ai-tertiary));
    width: 100%;
}

.speed-bar-fill.js {
    background: linear-gradient(90deg, #f7df1e, #f0a500);
    width: 1%;
}

/* ============================================================================
   WEBGPU COMPUTE VISUALIZER
   ============================================================================ */

.gpu-compute {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    position: relative;
    overflow: hidden;
}

.gpu-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 3px;
    margin-bottom: var(--space-6);
}

.gpu-core {
    aspect-ratio: 1;
    background: var(--surface-overlay);
    border-radius: 2px;
    transition: background 0.1s, box-shadow 0.1s;
}

.gpu-core.active {
    background: var(--ai-primary);
    box-shadow: 0 0 8px var(--ai-primary);
}

.gpu-stats {
    display: flex;
    gap: var(--space-8);
    justify-content: center;
}

.gpu-stat {
    text-align: center;
}

.gpu-stat-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--ai-primary);
}

.gpu-stat-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ============================================================================
   TRAINING DATA VISUALIZATION
   ============================================================================ */

.training-viz {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.training-metric {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
}

.training-value {
    font-size: var(--text-4xl);
    font-weight: var(--font-extrabold);
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-2);
}

.training-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

/* ============================================================================
   AI FEATURE LIST
   ============================================================================ */

.ai-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

.ai-feature {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-6);
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: var(--transition-all-base);
}

.ai-feature:hover {
    border-color: var(--ai-primary);
    box-shadow: var(--glow-cyan-sm);
}

.ai-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(0, 240, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    flex-shrink: 0;
}

.ai-feature-content h4 {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.ai-feature-content p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0;
}

/* ============================================================================
   ENHANCED HERO FOR QENEX.AI
   ============================================================================ */

.hero-qenex {
    position: relative;
    padding: 180px var(--space-6) 120px;
    text-align: center;
}

.hero-qenex::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(0, 240, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 70% 70%, rgba(216, 59, 210, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(123, 66, 246, 0.08) 0%, transparent 50%);
    animation: nebulaShift 15s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes nebulaShift {
    0% {
        background-position: 0% 0%, 100% 100%, 50% 50%;
    }
    100% {
        background-position: 100% 100%, 0% 0%, 60% 40%;
    }
}

.hero-qenex-title {
    font-size: var(--text-7xl);
    font-weight: var(--font-extrabold);
    line-height: 0.95;
    margin-bottom: var(--space-8);
    background: linear-gradient(
        135deg,
        #FFFFFF 0%,
        #00F0FF 40%,
        #D83BD2 60%,
        #FFFFFF 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 6s ease infinite;
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 1024px) {
    .ai-features {
        grid-template-columns: 1fr;
    }

    .training-viz {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-qenex {
        padding: 140px var(--space-4) 80px;
    }

    .hero-qenex-title {
        font-size: var(--text-4xl);
    }

    .neural-orb {
        width: 200px;
        height: 200px;
    }

    .neural-core {
        width: 50px;
        height: 50px;
    }

    .gpu-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}
