/* ==========================================================================
   AI RESEARCH LABORATORY DESIGN SYSTEM
   Developer Identity: Abdus Sami
   Aesthetic: AI Control Room × Advanced Research Interface × 3D Digital Environment
   ========================================================================== */

:root {
    --bg-space: #02050e;
    --bg-surface: #060b18;
    --bg-panel: rgba(8, 14, 28, 0.72);
    --bg-panel-hover: rgba(12, 22, 42, 0.88);
    --bg-module: rgba(4, 9, 20, 0.75);

    --border-lab: rgba(0, 240, 255, 0.16);
    --border-lab-focus: rgba(0, 240, 255, 0.45);
    --border-blue: rgba(59, 130, 246, 0.22);
    --border-subtle: rgba(255, 255, 255, 0.07);

    --cyan-core: #00f0ff;
    --cyan-glow: rgba(0, 240, 255, 0.35);
    --blue-core: #3b82f6;
    --violet-core: #8b5cf6;
    --emerald-core: #10b981;

    --text-pure: #f8fafc;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #02050e;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.22);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.5);
}

/* Base Setup */
html {
    scroll-behavior: smooth;
    background-color: var(--bg-space);
    color: var(--text-primary);
}

body {
    background-color: var(--bg-space);
    font-family: var(--font-body);
    overflow-x: hidden;
    position: relative;
    color: var(--text-primary);
}

/* Atmospheric Laboratory Background */
.lab-background {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: 
        radial-gradient(circle at 50% 15%, rgba(0, 240, 255, 0.07) 0%, transparent 45%),
        radial-gradient(circle at 85% 55%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 15% 85%, rgba(139, 92, 246, 0.04) 0%, transparent 45%),
        #02050e;
}

/* Technical Precision Grid */
.lab-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: 
        linear-gradient(to right, rgba(0, 240, 255, 0.025) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 240, 255, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
}

/* Canvas Particle Backdrop */
#canvas-lab-particles {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
    opacity: 0.7;
}

/* Ambient Radial Lighting */
.ambient-lab-light {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 1;
}

/* Laboratory Panel (Glassmorphic) */
.lab-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-lab);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lab-panel:hover {
    border-color: var(--border-lab-focus);
    box-shadow: 0 12px 36px -10px rgba(0, 240, 255, 0.15);
}

/* HUD Corner Brackets */
.corner-brackets {
    position: relative;
}
.corner-brackets::before,
.corner-brackets::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: var(--cyan-core);
    pointer-events: none;
    opacity: 0.7;
    transition: all 0.25s ease;
}
.corner-brackets::before {
    top: 6px;
    left: 6px;
    border-top: 2px solid var(--cyan-core);
    border-left: 2px solid var(--cyan-core);
}
.corner-brackets::after {
    bottom: 6px;
    right: 6px;
    border-bottom: 2px solid var(--cyan-core);
    border-right: 2px solid var(--cyan-core);
}
.corner-brackets:hover::before,
.corner-brackets:hover::after {
    opacity: 1;
    border-color: #ffffff;
    transform: scale(1.15);
}

/* Section Header Badges */
.lab-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: rgba(0, 240, 255, 0.06);
    border: 1px solid rgba(0, 240, 255, 0.24);
    color: var(--cyan-core);
}

/* Technical Status Dot */
.status-pip {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cyan-core);
    display: inline-block;
    box-shadow: 0 0 8px var(--cyan-core);
}
.status-pip-emerald {
    background: var(--emerald-core);
    box-shadow: 0 0 8px var(--emerald-core);
}

/* Gradient Text */
.text-gradient-cyan {
    background: linear-gradient(135deg, #ffffff 15%, #00f0ff 65%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.text-gradient-silver {
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn-lab-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 26px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #02050e;
    background: var(--cyan-core);
    border: 1px solid var(--cyan-core);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.35);
}
.btn-lab-primary:hover {
    background: #4ef4ff;
    border-color: #ffffff;
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.65);
    transform: translateY(-2px);
}

.btn-lab-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-pure);
    background: rgba(8, 14, 28, 0.65);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 6px;
    transition: all 0.25s ease;
}
.btn-lab-secondary:hover {
    border-color: var(--cyan-core);
    color: var(--cyan-core);
    background: rgba(0, 240, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

/* ==========================================================================
   3D AI COMPUTATIONAL CORE (HERO COMPONENT)
   ========================================================================== */
.ai-core-container {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: 440px;
    margin: 0 auto;
    perspective: 1200px;
}

@media (max-width: 640px) {
    .ai-core-container {
        max-width: 320px;
        height: 320px;
    }
}

.ai-core-stage {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* AI Core Canvas Overlay */
#canvas-ai-core {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: auto;
}

/* Layered Orbital Rings */
.orbital-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transform-style: preserve-3d;
}

.ring-outer {
    width: 380px;
    height: 380px;
    border: 1px dashed rgba(0, 240, 255, 0.25);
    animation: rotate-cw 40s linear infinite;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.04) inset;
}
@media (max-width: 640px) {
    .ring-outer {
        width: 290px;
        height: 290px;
    }
}

.ring-mid {
    width: 300px;
    height: 300px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-top: 2px solid var(--cyan-core);
    border-bottom: 2px solid var(--violet-core);
    animation: rotate-ccw 26s linear infinite;
}
@media (max-width: 640px) {
    .ring-mid {
        width: 230px;
        height: 230px;
    }
}

.ring-inner {
    width: 220px;
    height: 220px;
    border: 1px dotted rgba(0, 240, 255, 0.4);
    animation: rotate-cw 18s linear infinite;
}
@media (max-width: 640px) {
    .ring-inner {
        width: 170px;
        height: 170px;
    }
}

/* Central Nucleus Pulse */
.core-nucleus {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffffff 0%, rgba(0, 240, 255, 0.8) 40%, rgba(59, 130, 246, 0.3) 70%, transparent 100%);
    box-shadow: 
        0 0 50px rgba(0, 240, 255, 0.6),
        0 0 100px rgba(0, 240, 255, 0.3);
    animation: pulse-core 4s ease-in-out infinite alternate;
}
@media (max-width: 640px) {
    .core-nucleus {
        width: 70px;
        height: 70px;
    }
}

/* HUD System Connectors Around Hero */
.hero-hud-card {
    position: absolute;
    z-index: 10;
    padding: 8px 12px;
    background: rgba(4, 9, 20, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

@keyframes rotate-cw {
    from { transform: rotateZ(0deg); }
    to { transform: rotateZ(360deg); }
}

@keyframes rotate-ccw {
    from { transform: rotateZ(360deg); }
    to { transform: rotateZ(0deg); }
}

@keyframes pulse-core {
    0% { transform: scale(0.92); opacity: 0.8; filter: brightness(1); }
    100% { transform: scale(1.08); opacity: 1; filter: brightness(1.25); }
}

/* ==========================================================================
   DEFECTX ACTIVE WORKFLOW PIPELINE
   ========================================================================== */
.pipeline-flow {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    position: relative;
}

@media (max-width: 1024px) {
    .pipeline-flow {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.pipeline-step {
    background: rgba(6, 12, 24, 0.8);
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: 8px;
    padding: 16px 12px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.pipeline-step.active,
.pipeline-step:hover {
    border-color: var(--cyan-core);
    background: rgba(0, 240, 255, 0.08);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.15);
    transform: translateY(-3px);
}

.pipeline-step-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan-core);
    font-size: 1.25rem;
    opacity: 0.5;
}

@keyframes pulse-stream {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.stream-line {
    position: absolute;
    bottom: -1px;
    left: 0;
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, transparent, var(--cyan-core), transparent);
    animation: pulse-stream 3s linear infinite;
}

/* ==========================================================================
   TECH CORE (INTERACTIVE MODULES)
   ========================================================================== */
.tech-module {
    background: var(--bg-module);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 16px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
}

.tech-module:hover {
    border-color: var(--cyan-core);
    background: rgba(0, 240, 255, 0.05);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 10px 30px -10px rgba(0, 240, 255, 0.25);
}

.tech-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: #cbd5e1;
    transition: all 0.2s ease;
}

.tech-module:hover .tech-pill {
    border-color: rgba(0, 240, 255, 0.25);
    color: #ffffff;
}

.tech-pill:hover {
    background: rgba(0, 240, 255, 0.12);
    border-color: var(--cyan-core);
    color: var(--cyan-core);
}

/* ==========================================================================
   AI LAB MODULES (SUBSYSTEM CARDS)
   ========================================================================== */
.lab-subsystem-card {
    background: rgba(5, 10, 22, 0.7);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 10px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lab-subsystem-card:hover {
    border-color: var(--cyan-core);
    background: rgba(8, 16, 34, 0.9);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px -8px rgba(0, 240, 255, 0.2);
}

.lab-subsystem-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: var(--cyan-core);
    transition: height 0.3s ease;
}

.lab-subsystem-card:hover::before {
    height: 100%;
}

/* ==========================================================================
   SYSTEM TIMELINE (EXPERIENCE)
   ========================================================================== */
.timeline-track {
    position: relative;
    padding-left: 32px;
}

.timeline-track::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 10px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--cyan-core) 0%, rgba(0, 240, 255, 0.1) 80%, transparent 100%);
}

.timeline-node {
    position: absolute;
    left: 4px;
    top: 14px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #02050e;
    border: 2px solid var(--cyan-core);
    box-shadow: 0 0 12px var(--cyan-core);
}

/* ==========================================================================
   COMMUNICATION TERMINAL (CONTACT CONSOLE)
   ========================================================================== */
.terminal-input {
    width: 100%;
    background: rgba(3, 7, 16, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 12px 16px;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.terminal-input:focus {
    outline: none;
    border-color: var(--cyan-core);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
    background: rgba(5, 12, 26, 0.95);
}

/* ==========================================================================
   FLOATING AI ASSISTANT CONSOLE
   ========================================================================== */
#ai-chat-btn {
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.35);
    transition: all 0.3s ease;
}

#ai-chat-btn:hover {
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.65);
    transform: scale(1.08);
}

#ai-chat-window {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.18);
}

/* Subtle Scanline Texture */
.scanline-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0, 0, 0, 0.18) 50%, rgba(0, 0, 0, 0.18));
    background-size: 100% 4px;
    opacity: 0.5;
}
