/* ==========================================================================
   SilverGuard Premium Cybernetic CSS System
   ========================================================================== */

:root {
    --bg-dark: #060913;
    --bg-card: rgba(18, 24, 43, 0.7);
    --border-color: rgba(255, 255, 255, 0.06);
    --text-primary: #f1f5f9;
    --text-muted: #94a3b8;
    
    /* Neon Branding Palettes */
    --primary-cyan: #00f0ff;
    --secondary-purple: #7000ff;
    --accent-pink: #ff2a5f;
    --success-green: #10b981;
    --warning-yellow: #fbbf24;
    
    /* Glow Effects */
    --glow-cyan: 0 0 15px rgba(0, 240, 255, 0.35);
    --glow-purple: 0 0 15px rgba(112, 0, 255, 0.35);
    --glow-pink: 0 0 15px rgba(255, 42, 95, 0.35);
}

/* --- Basic Setup & Resets --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #1e294b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-cyan);
}

/* --- Ambient Holographic Effects --- */
.mesh-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
    z-index: -3;
    pointer-events: none;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -2;
    pointer-events: none;
    opacity: 0.25;
}
.orb-1 {
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--secondary-purple), transparent 70%);
    top: -10%;
    right: -10%;
}
.orb-2 {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--primary-cyan), transparent 70%);
    bottom: -15%;
    left: -15%;
}

/* --- Glassmorphism UI Base --- */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* --- Navigation Header --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    height: 70px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(6, 9, 19, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.nav-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}
.logo-accent {
    color: var(--primary-cyan);
    text-shadow: var(--glow-cyan);
}

.nav-links {
    display: flex;
    gap: 30px;
}
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 4px;
}
.nav-links a:hover {
    color: var(--primary-cyan);
    text-shadow: var(--glow-cyan);
}
.nav-lab-link {
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--primary-cyan) !important;
}
.nav-lab-link:hover {
    background: rgba(0, 240, 255, 0.08);
    box-shadow: var(--glow-cyan);
}

.lang-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}
.lang-btn:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
    background: rgba(0, 240, 255, 0.05);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 20px 60px 20px;
    position: relative;
}

.hero-content {
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge-glow {
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.25);
    color: var(--primary-cyan);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 25px;
    text-transform: uppercase;
    box-shadow: inset 0 0 8px rgba(0, 240, 255, 0.1);
}

.hero h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.8rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 30%, var(--primary-cyan) 70%, var(--secondary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 750px;
    margin-bottom: 40px;
    font-weight: 400;
}

/* Visitor Badges */
.visitor-stats {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px 35px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    margin-bottom: 45px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.stat-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 110px;
}
.stat-badge span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}
.stat-badge strong {
    font-size: 1.7rem;
    color: var(--primary-cyan);
    font-family: 'Orbitron', sans-serif;
    text-shadow: var(--glow-cyan);
}
.stat-badge-divider {
    width: 1px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 25px;
}

/* Primary/Secondary Buttons */
.hero-buttons {
    display: flex;
    gap: 20px;
}
button, .btn-primary, .btn-secondary {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    padding: 16px 36px;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary, button:not([class*="btn-"]):not([class*="console-"]) {
    background: linear-gradient(135deg, var(--primary-cyan), var(--secondary-purple));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.25);
}
.btn-primary:hover, button:not([class*="btn-"]):not([class*="console-"]):hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 240, 255, 0.45);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.btn-cyan {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
}
.btn-cyan:hover:not(:disabled) {
    background: var(--primary-cyan);
    color: black;
    box-shadow: var(--glow-cyan);
}

.btn-green {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-green);
    color: var(--success-green);
}
.btn-green:hover:not(:disabled) {
    background: var(--success-green);
    color: black;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* --- Section Formatting --- */
section {
    max-width: 1240px;
    margin: 0 auto;
    padding: 100px 20px;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.3rem;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.section-subtitle {
    text-align: center;
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 60px auto;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.card {
    padding: 40px;
    border-radius: 24px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    transition: all 0.3s ease;
}
.card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 240, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Unique Neon Borders */
.border-cyan:hover { border-color: var(--primary-cyan); box-shadow: 0 0 25px rgba(0, 240, 255, 0.15); }
.border-purple:hover { border-color: var(--secondary-purple); box-shadow: 0 0 25px rgba(112, 0, 255, 0.15); }
.border-pink:hover { border-color: var(--accent-pink); box-shadow: 0 0 25px rgba(255, 42, 95, 0.15); }

.border-cyan::before { background: var(--primary-cyan); }
.border-purple::before { background: var(--secondary-purple); }
.border-pink::before { background: var(--accent-pink); }

.card-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    color: var(--primary-cyan);
}
.card-icon {
    width: 28px;
    height: 28px;
}
.card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}
.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Tech Tags */
.card-header-row {
    margin-bottom: 20px;
}
.tech-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.tag-cyan { background: rgba(0, 240, 255, 0.1); color: var(--primary-cyan); border: 1px solid rgba(0, 240, 255, 0.2); }
.tag-purple { background: rgba(112, 0, 255, 0.1); color: #a855f7; border: 1px solid rgba(112, 0, 255, 0.2); }
.tag-pink { background: rgba(255, 42, 95, 0.1); color: var(--accent-pink); border: 1px solid rgba(255, 42, 95, 0.2); }

/* --- Achievements Portfolio Section --- */
.timeline {
    position: relative;
    max-width: 850px;
    margin: 0 auto;
    padding: 40px 20px;
    border-radius: 24px;
}
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 40px;
    width: 2px;
    background: linear-gradient(180deg, var(--primary-cyan), var(--secondary-purple), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    padding-left: 70px;
}
.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-badge {
    position: absolute;
    left: 31px;
    top: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 3px solid var(--primary-cyan);
    box-shadow: var(--glow-cyan);
    z-index: 2;
    transition: all 0.3s ease;
}
.timeline-item:hover .timeline-badge {
    background: var(--primary-cyan);
    transform: scale(1.2);
}

.timeline-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 25px 30px;
    border-radius: 16px;
    transition: all 0.3s ease;
}
.timeline-panel:hover {
    border-color: rgba(0, 240, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.timeline-panel h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}
.timeline-date {
    display: inline-block;
    color: var(--primary-cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    margin: 5px 0 12px 0;
}
.timeline-panel p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- About Me / Team Section --- */
.about-container {
    display: flex;
    gap: 40px;
    padding: 50px;
    border-radius: 28px;
    max-width: 950px;
    margin: 0 auto;
}

.about-avatar-col {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.about-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-cyan), var(--secondary-purple));
    padding: 3px;
    margin-bottom: 20px;
    box-shadow: var(--glow-purple);
}
.avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary-cyan);
}

.about-meta h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.about-meta p {
    font-size: 0.75rem;
    color: var(--primary-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.about-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.about-info-col h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-primary);
}
.about-info-col p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.about-socials {
    display: flex;
    gap: 15px;
}
.social-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 30px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}
.social-badge:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
    background: rgba(0, 240, 255, 0.05);
}

/* --- Reflex Simulation Lab --- */
.lab-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.cyber-header {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-cyan);
    letter-spacing: 1.5px;
    border-left: 3px solid var(--primary-cyan);
    padding-left: 12px;
    margin-bottom: 25px;
}

/* Sidebar Controls */
.lab-sidebar {
    border-radius: 24px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.serial-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-offline {
    background-color: var(--accent-pink);
    box-shadow: 0 0 8px var(--accent-pink);
}
.status-online {
    background-color: var(--success-green);
    box-shadow: 0 0 8px var(--success-green);
    animation: flash 1s infinite alternate;
}

.w-full {
    width: 100%;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Custom Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #1e294b;
    transition: .3s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
}
input:checked + .slider {
    background-color: var(--primary-cyan);
}
input:checked + .slider:before {
    transform: translateX(20px);
}
.slider.round {
    border-radius: 34px;
}
.slider.round:before {
    border-radius: 50%;
}

/* Live Terminal Output */
.console-wrapper {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.console-header {
    background: #0f1628;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}
.console-clear {
    background: transparent;
    border: none;
    color: var(--accent-pink);
    font-size: 0.65rem;
    cursor: pointer;
    font-weight: 700;
}
.console-body {
    background: #090e1a;
    height: 120px;
    padding: 12px;
    font-family: monospace;
    font-size: 0.7rem;
    color: #38bdf8;
    overflow-y: auto;
    white-space: pre-line;
    line-height: 1.4;
}

/* Workspace Canvas */
.lab-workspace {
    border-radius: 28px;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mode-tabs {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: 12px;
    display: flex;
    gap: 4px;
}
.mode-tab {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    box-shadow: none !important;
}
.mode-tab.active {
    background: #1e294b;
    color: var(--primary-cyan);
}

.audio-control-row {
    font-size: 0.8rem;
}
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    user-select: none;
}
.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0; width: 0;
}
.checkmark {
    height: 16px;
    width: 16px;
    background-color: #1e294b;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: 0.2s;
}
.checkbox-container:hover input ~ .checkmark {
    background-color: #334155;
}
.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-cyan);
}
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}
.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}
.checkbox-container .checkmark:after {
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid black;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.checkbox-label {
    color: var(--text-muted);
    font-weight: 600;
}

#game-canvas {
    width: 100%;
    height: 380px;
    background-color: #050811;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    cursor: crosshair;
}

/* Targets */
#target {
    width: 44px;
    height: 44px;
    background: radial-gradient(circle, var(--accent-pink) 30%, #b91c1c 100%);
    border-radius: 50%;
    position: absolute;
    display: none;
    box-shadow: 0 0 18px var(--accent-pink);
    z-index: 10;
    cursor: pointer;
    transition: transform 0.05s ease;
}
#target:active {
    transform: scale(0.85);
}
.target-pulse {
    position: absolute;
    top: -6px; left: -6px; right: -6px; bottom: -6px;
    border: 2px solid var(--accent-pink);
    border-radius: 50%;
    animation: scale-up-pulse 1s infinite linear;
    opacity: 0.6;
}

/* Dynamic Particle Explosion */
.burst-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99;
    box-shadow: 0 0 8px currentColor;
}

/* Beanbag / Catcher Hand (Mode B) */
#beanbag {
    width: 36px;
    height: 36px;
    background: radial-gradient(circle, var(--warning-yellow) 30%, #d97706 100%);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; /* irregular organic beanbag shape */
    position: absolute;
    display: none;
    box-shadow: 0 0 15px var(--warning-yellow);
    z-index: 10;
    animation: spin-slow 2s infinite linear;
}

#hand-catcher {
    width: 110px;
    height: 25px;
    background: rgba(0, 240, 255, 0.06);
    border: 2px dashed var(--primary-cyan);
    border-radius: 6px;
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    z-index: 9;
    box-shadow: var(--glow-cyan);
    pointer-events: none;
    transition: left 0.08s cubic-bezier(0.1, 0.8, 0.2, 1);
}
.hand-label {
    display: block;
    text-align: center;
    font-size: 0.55rem;
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-cyan);
    line-height: 21px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Idle Screen Overlays */
.canvas-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 8, 17, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    padding: 30px;
    text-align: center;
    transition: opacity 0.3s ease;
}
.canvas-overlay h4 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-cyan);
    margin-bottom: 10px;
}
.canvas-overlay p {
    color: var(--text-muted);
    font-size: 0.85rem;
    max-width: 420px;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
}

.stats-box {
    display: flex;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px 25px;
}
.stats-box-item {
    display: flex;
    flex-direction: column;
    min-width: 100px;
}
.stats-box-item span {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.stats-box-item strong {
    font-size: 1.3rem;
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-cyan);
}
.stats-box-divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 20px;
    align-self: center;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

/* --- Lower Grid (Waveforms & Diagnostics) --- */
.lab-lower-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.panel {
    border-radius: 24px;
    padding: 30px;
    display: flex;
    flex-direction: column;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}
.panel-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-cyan);
    letter-spacing: 1.5px;
}

.graph-legend {
    display: flex;
    gap: 15px;
    font-size: 0.65rem;
    font-weight: 700;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.legend-item::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.text-red::before { background-color: var(--accent-pink); }
.text-green::before { background-color: var(--success-green); }
.text-blue::before { background-color: var(--primary-cyan); }

.graph-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-grow: 1;
}

.canvas-chart-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.chart-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}
.canvas-chart-wrapper canvas {
    width: 100%;
    height: 100px;
    background: #050811;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

/* Neural Network Map */
.neural-flex {
    display: flex;
    gap: 30px;
    flex-grow: 1;
}

.neural-net-visualizer {
    flex: 1;
    background: #050811;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}
.neural-net-visualizer canvas {
    width: 100%;
    height: 100%;
    min-height: 220px;
}

.neural-outputs {
    width: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}

.neural-state {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
}
.neural-state.active {
    background: rgba(0, 240, 255, 0.05);
    border-color: var(--primary-cyan);
    box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.1);
}
.ns-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #334155;
    transition: all 0.3s ease;
}
.neural-state.active .ns-dot {
    background-color: var(--primary-cyan);
    box-shadow: 0 0 8px var(--primary-cyan);
}
.ns-label {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.ns-name {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
}
.neural-state.active .ns-name {
    color: var(--text-primary);
}
.ns-probability {
    font-size: 0.8rem;
    font-family: 'Orbitron', sans-serif;
    color: var(--text-muted);
    font-weight: 700;
}
.neural-state.active .ns-probability {
    color: var(--primary-cyan);
}

.bg-cyan { background-color: var(--primary-cyan) !important; }

/* --- Diagnostic Report Modal --- */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(4, 6, 12, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}
.modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    width: 100%;
    max-width: 750px;
    border-radius: 28px;
    padding: 40px;
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.modal-backdrop.show .modal {
    transform: scale(1);
}

.modal h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--primary-cyan);
    margin-bottom: 30px;
    text-align: center;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.report-stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 18px 22px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
}
.report-stat-card span {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.report-stat-card strong {
    font-size: 1.5rem;
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-cyan);
}

.report-analysis {
    background: rgba(0, 240, 255, 0.03);
    border: 1px solid rgba(0, 240, 255, 0.1);
    padding: 20px 25px;
    border-radius: 16px;
    margin-bottom: 25px;
}
.report-analysis h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-cyan);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.report-analysis p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.report-chart-container {
    width: 100%;
    margin-bottom: 30px;
}
.report-chart-container canvas {
    width: 100%;
    height: 120px;
    background: #050811;
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 60px 20px;
    border-top: 1px solid var(--border-color);
    background: #04060d;
}
footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- Animations --- */
@keyframes flash {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

@keyframes scale-up-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0; }
}

@keyframes spin-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Historical Tables Styles --- */
.history-tables-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.history-table-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-table-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-left: 3px solid;
    padding-left: 10px;
}

.history-table-title.text-blue {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.history-table-title.text-red {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.history-table th {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 12px;
    font-weight: 700;
    color: var(--text-muted);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.history-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* --- Responsive Adaptations --- */
@media (max-width: 1024px) {
    .history-tables-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .lab-grid {
        grid-template-columns: 1fr;
    }
    .lab-lower-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    nav {
        padding: 12px 20px;
        height: auto;
        flex-direction: column;
        gap: 12px;
    }
    .nav-logo {
        font-size: 1.25rem;
    }
    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px 10px;
    }
    .nav-links a {
        font-size: 0.72rem;
        padding: 4px 8px;
    }
    .nav-actions {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    .hero {
        padding-top: 170px;
    }
    .portfolio-header-margin {
        padding-top: 170px;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .about-container {
        flex-direction: column;
        padding: 30px;
    }
    .about-avatar-col {
        flex: 1;
        margin-bottom: 20px;
    }
    .report-grid {
        grid-template-columns: 1fr;
    }
    .timeline::before {
        left: 20px;
    }
    .timeline-item {
        padding-left: 45px;
    }
    .timeline-badge {
        left: 11px;
    }
    .controls-row {
        flex-direction: column;
        gap: 20px;
    }
    .stats-box {
        width: 100%;
        justify-content: space-around;
    }
    .action-buttons {
        width: 100%;
        justify-content: center;
    }
}
