/* ==========================================
   GLOBAL VARIABLES & BASE
   ========================================== */
:root {
    --bg-color: #0a0e14;
    --accent-green: #9fef00;
    --text-primary: #e6edf3;
    --text-muted: #7d8590;
    --border-subtle: rgba(169, 183, 198, 0.15);
    --font-mono: 'JetBrains Mono', monospace; 
}

body {
    margin: 0; padding: 0; background-color: var(--bg-color); color: var(--text-primary); font-family: var(--font-mono);
}

/* ==========================================
   GLOBAL COMPONENTS & BUTTON EFFECTS
   ========================================== */
.data-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.data-value { font-size: 1rem; color: var(--text-primary); }

.btn-cyber {
    background: transparent; border: 1px solid var(--accent-green); color: var(--accent-green);
    padding: 10px 20px; font-family: var(--font-mono); text-transform: uppercase; cursor: pointer;
    border-radius: 4px; transition: all 0.3s ease; position: relative; overflow: hidden;
}
.btn-cyber::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(159, 239, 0, 0.4), transparent);
    transform: skewX(-25deg); transition: 0.5s ease-in-out;
}
.btn-cyber:hover::before { left: 150%; }
.btn-cyber:hover, .btn-cyber.active-glow {
    box-shadow: 0 0 15px rgba(159, 239, 0, 0.4), inset 0 0 8px rgba(159, 239, 0, 0.2); background: rgba(159, 239, 0, 0.05);
}
.btn-cyber:active { transform: scale(0.95); box-shadow: inset 0 0 15px rgba(159, 239, 0, 0.6); background: rgba(159, 239, 0, 0.15); }

.btn-cyber.danger { border-color: #ff4444; color: #ff4444; }
.btn-cyber.danger::before { background: linear-gradient(90deg, transparent, rgba(255, 68, 68, 0.4), transparent); }
.btn-cyber.danger:hover { box-shadow: 0 0 15px rgba(255, 68, 68, 0.4), inset 0 0 8px rgba(255, 68, 68, 0.2); background: rgba(255, 68, 68, 0.05); }
.btn-cyber.danger:active { box-shadow: inset 0 0 15px rgba(255, 68, 68, 0.6); background: rgba(255, 68, 68, 0.15); }

/* ==========================================
   LANDING PAGE SPECIFIC STYLES (SPLIT LAYOUT)
   ========================================== */
.landing-body {
    height: 100vh; display: flex; flex-direction: column; overflow: hidden; position: relative;
    background-image: linear-gradient(rgba(169, 183, 198, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(169, 183, 198, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.bg-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 800px; height: 800px; background: radial-gradient(circle, rgba(159,239,0,0.05) 0%, rgba(0,0,0,0) 60%); z-index: 0; pointer-events: none; }
.initialize-module { flex: 1; display: flex; justify-content: center; align-items: center; position: relative; z-index: 50; width: 100%; }

/* SPLIT LAYOUT & BOX SIZING */
.split-layout { 
    display: flex; gap: 30px; width: 100%; max-width: 1200px; padding: 0 40px; 
    align-items: stretch; height: 500px; 
}

.hero-box {
    flex: 1; height: 100%; box-sizing: border-box;
    background: rgba(10, 15, 20, 0.85); border: 1px solid var(--border-subtle);
    padding: 40px; border-radius: 8px; box-shadow: 0 0 40px rgba(0,0,0,0.9);
    text-align: center; position: relative; backdrop-filter: blur(15px);
    overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center;
}

.terminal-box {
    flex: 1; height: 100%; cursor: text; box-sizing: border-box;
    background: rgba(5, 8, 12, 0.95); border: 1px solid var(--border-subtle);
    border-radius: 8px; box-shadow: 0 0 30px rgba(0,0,0,0.9);
    display: flex; flex-direction: column; overflow: hidden; backdrop-filter: blur(10px);
}

.terminal-header { background: rgba(255, 255, 255, 0.03); padding: 12px 15px; display: flex; align-items: center; border-bottom: 1px solid var(--border-subtle); }
.window-controls { display: flex; gap: 6px; margin-right: 15px; }
.window-controls .dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f56; } .dot.yellow { background: #ffbd2e; } .dot.green { background: #27c93f; }
.terminal-title { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.75rem; flex: 1; text-align: center; margin-left: -40px; }

/* TERMINAL BODY & INPUT */
.terminal-body {
    flex: 1; padding: 20px 20px 0 20px; font-family: var(--font-mono); font-size: 0.85rem; color: #a9b7c6;
    line-height: 1.6; overflow-y: auto; display: flex; flex-direction: column; gap: 5px;
    justify-content: flex-start;
}
.terminal-body::-webkit-scrollbar { width: 8px; }
.terminal-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.terminal-body::-webkit-scrollbar-thumb { background: rgba(159, 239, 0, 0.3); border-radius: 4px; }
.terminal-body::-webkit-scrollbar-thumb:hover { background: rgba(159, 239, 0, 0.6); }

.terminal-input { padding: 5px 0 20px 0; font-family: var(--font-mono); font-size: 0.85rem; display: flex; align-items: center; }
.prompt { color: var(--accent-green); margin-right: 8px; white-space: nowrap; }
#term-input { background: transparent; border: none; color: var(--text-primary); font-family: var(--font-mono); font-size: 0.85rem; flex: 1; outline: none; caret-color: var(--accent-green); }

.term-line { margin: 0; word-break: break-all; }
.term-success { color: var(--accent-green); }
.term-warning { color: #ffbd2e; }
.term-error { color: #ff4444; }

/* INTERACTIVE LINKS */
.term-link { color: #58a6ff; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(88, 166, 255, 0.4); transition: all 0.2s; padding: 2px 4px; }
.term-link:hover { color: #fff; background: rgba(88, 166, 255, 0.2); text-shadow: 0 0 5px #58a6ff; }
.term-link.exe { color: var(--accent-green); text-decoration-color: rgba(159, 239, 0, 0.4); }
.term-link.exe:hover { background: rgba(159, 239, 0, 0.2); text-shadow: 0 0 5px var(--accent-green); }
.term-link.log { color: #ffbd2e; text-decoration-color: rgba(255, 189, 46, 0.4); }
.term-link.log:hover { background: rgba(255, 189, 46, 0.2); text-shadow: 0 0 5px #ffbd2e; }

/* REDIRECT OVERLAY */
.redirect-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95); backdrop-filter: blur(10px); z-index: 9999; 
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.5s ease;
}
.redirect-overlay.active { opacity: 1; pointer-events: all; }
.redirect-content { text-align: center; }
.spinner {
    width: 50px; height: 50px; border: 3px solid rgba(159, 239, 0, 0.2);
    border-top-color: var(--accent-green); border-radius: 50%;
    animation: spin 1s linear infinite; margin: 0 auto 20px auto;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* DECORS, HEADERS & FOOTERS */
.decorative-corner { position: absolute; width: 25px; height: 25px; border: 2px solid var(--accent-green); opacity: 0.2; z-index: 100; }
.corner-top-left { top: 20px; left: 20px; border-right: none; border-bottom: none; }
.corner-top-right { top: 20px; right: 20px; border-left: none; border-bottom: none; }
.corner-bottom-left { bottom: 20px; left: 20px; border-right: none; border-top: none; }
.corner-bottom-right { bottom: 20px; right: 20px; border-left: none; border-top: none; }
.hero-box::before, .hero-box::after { content: ''; position: absolute; width: 15px; height: 15px; border: 2px solid var(--accent-green); opacity: 0.5; z-index: 2; }
.hero-box::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.hero-box::after { bottom: -2px; right: -2px; border-left: none; border-top: none; }
.side-terminal { position: absolute; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 15px; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); opacity: 0.15; z-index: 10; }
.side-terminal.left-terminal { left: 20px; align-items: flex-start; }
.side-terminal.right-terminal { right: 20px; align-items: flex-end; }
.data-stream { margin: 0; }
.landing-header, .landing-footer { height: 70px; padding: 0 40px; display: flex; justify-content: space-between; align-items: center; z-index: 100; }
.landing-header { border-bottom: 1px solid var(--border-subtle); }
.landing-footer { border-top: 1px solid var(--border-subtle); font-size: 0.75rem; }

/* ANIMATIONS */
.fade-in-up { animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; transform: translateY(20px); }
.delay-1 { animation-delay: 0.2s; } .delay-2 { animation-delay: 0.4s; } .delay-3 { animation-delay: 0.6s; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }
.logo-pulse { animation: pulseGlow 3s infinite alternate; }
@keyframes pulseGlow { from { filter: drop-shadow(0 0 5px rgba(159, 239, 0, 0.2)); } to { filter: drop-shadow(0 0 20px rgba(159, 239, 0, 0.8)); } }
.cursor { display: inline-block; width: 10px; height: 1.1rem; background-color: var(--accent-green); animation: blink 1s step-end infinite; vertical-align: middle; margin-left: 5px; box-shadow: 0 0 8px var(--accent-green); }
@keyframes blink { 50% { opacity: 0; } } .blink { animation: blink 1.2s infinite; }
.status-indicator { width: 10px; height: 10px; border-radius: 50%; background-color: var(--accent-green); display: inline-block; }
.status-indicator.active { animation: pulseDot 2s infinite ease-in-out; }
@keyframes pulseDot { 0% { box-shadow: 0 0 5px var(--accent-green); opacity: 0.7; } 50% { box-shadow: 0 0 15px var(--accent-green), 0 0 30px var(--accent-green); opacity: 1; } 100% { box-shadow: 0 0 5px var(--accent-green); opacity: 0.7; } }
.system-secure-text { font-family: var(--font-mono); font-weight: bold; color: var(--accent-green); animation: pulseText 2s infinite ease-in-out; }
@keyframes pulseText { 0% { text-shadow: 0 0 2px var(--accent-green); opacity: 0.8; } 50% { text-shadow: 0 0 12px var(--accent-green), 0 0 20px var(--accent-green); opacity: 1; color: #fff; } 100% { text-shadow: 0 0 2px var(--accent-green); opacity: 0.8; } }
.scanner-line { position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: var(--accent-green); box-shadow: 0 0 10px var(--accent-green), 0 0 20px var(--accent-green); opacity: 0; z-index: 1; animation: scanSweep 4s linear infinite; pointer-events: none; }
@keyframes scanSweep { 0% { top: 0; opacity: 0; } 10% { opacity: 0.3; } 90% { opacity: 0.3; } 100% { top: 100%; opacity: 0; } }

/* ==========================================
   TARGET ROSTER SCROLLBAR & GLITCH EFFECTS
   ========================================== */

/* Custom Scrollbar for the Roster Grid */
#roster-grid::-webkit-scrollbar { width: 8px; }
#roster-grid::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
#roster-grid::-webkit-scrollbar-thumb { background: rgba(159, 239, 0, 0.3); border-radius: 4px; }
#roster-grid::-webkit-scrollbar-thumb:hover { background: rgba(159, 239, 0, 0.6); }

/* Continuous Glow & Hover Glitch for Headers */
.glitch-glow {
    color: var(--accent-green) !important;
    font-family: var(--font-mono);
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(159, 239, 0, 0.4);
    animation: pulseText 2s infinite ease-in-out;
    position: relative;
    display: inline-block;
    cursor: crosshair;
}

/* The Glitch triggers only on hover */
.glitch-glow:hover {
    animation: glitchEffect 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
}

@keyframes glitchEffect {
    0% { transform: translate(0); text-shadow: -2px 0 #ff00c1, 2px 0 #00fff9; }
    20% { transform: translate(-2px, 2px); text-shadow: 2px -2px #ff00c1, -2px 2px #00fff9; }
    40% { transform: translate(-2px, -2px); text-shadow: 2px 2px #ff00c1, -2px -2px #00fff9; }
    60% { transform: translate(2px, 2px); text-shadow: -2px -2px #ff00c1, 2px 2px #00fff9; }
    80% { transform: translate(2px, -2px); text-shadow: -2px 2px #ff00c1, 2px -2px #00fff9; }
    100% { transform: translate(0); text-shadow: -2px 0 #ff00c1, 2px 0 #00fff9; }
}

/* ==========================================
   AI ASSISTANT (CHATBOT) STYLES
   ========================================== */
.cyber-chatbot-widget {
    position: fixed; bottom: 30px; right: 30px; z-index: 9999; font-family: var(--font-mono);
}

/* The Glowing Floating Action Button */
.chatbot-toggle {
    width: 60px; height: 60px; border-radius: 50%;
    background: rgba(10, 15, 20, 0.9); border: 2px solid var(--accent-green);
    box-shadow: 0 0 15px rgba(159, 239, 0, 0.3); cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    transition: all 0.3s ease; backdrop-filter: blur(5px);
}
.chatbot-toggle:hover {
    transform: scale(1.1); box-shadow: 0 0 25px rgba(159, 239, 0, 0.6);
}
.chatbot-toggle svg { fill: var(--accent-green); width: 30px; height: 30px; animation: pulseGlow 3s infinite alternate; }

/* The Chat Window */
.chatbot-window {
    display: none; width: 350px; height: 450px;
    background: rgba(5, 8, 12, 0.95); border: 1px solid var(--accent-green);
    border-radius: 8px; box-shadow: 0 0 30px rgba(0,0,0,0.9);
    backdrop-filter: blur(15px); flex-direction: column; overflow: hidden;
    position: absolute; bottom: 80px; right: 0;
    transform-origin: bottom right;
}
.chatbot-window.active {
    display: flex; animation: popInChat 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes popInChat { 
    from { opacity: 0; transform: scale(0.5); } 
    to { opacity: 1; transform: scale(1); } 
}

/* Chat Header */
.chat-header {
    background: rgba(159, 239, 0, 0.1); padding: 12px 15px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border-subtle);
}
.close-chat { color: var(--text-muted); cursor: pointer; font-size: 1.2rem; transition: 0.2s; }
.close-chat:hover { color: #ff4444; }

/* Messages Area */
.chat-messages {
    flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(159, 239, 0, 0.3); border-radius: 3px; }

/* Message Bubbles */
.chat-msg { max-width: 85%; padding: 10px 12px; border-radius: 4px; font-size: 0.8rem; line-height: 1.4; word-wrap: break-word; }
.msg-bot { 
    align-self: flex-start; background: rgba(159, 239, 0, 0.05); 
    border-left: 2px solid var(--accent-green); color: var(--text-primary); 
}
.msg-user { 
    align-self: flex-end; background: rgba(255, 255, 255, 0.05); 
    border-right: 2px solid var(--text-muted); color: var(--text-muted); 
}

/* Input Area */
.chat-input {
    padding: 15px; border-top: 1px solid var(--border-subtle);
    display: flex; align-items: center; background: rgba(0,0,0,0.5);
}
#ai-input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text-primary); font-family: var(--font-mono); font-size: 0.85rem;
}
#ai-input::placeholder { color: rgba(169, 183, 198, 0.3); }

/* ========================================== */
/* MOBILE OVERRIDE PROTOCOL (Android/iOS)     */
/* ========================================== */

@media screen and (max-width: 768px) {
    /* Stack the layout vertically */
    .split-layout {
        flex-direction: column;
        gap: 30px;
        padding: 10px;
    }

    /* Hide the decorative side data streams to save screen space */
    .side-terminal, 
    .decorative-corner {
        display: none !important;
    }

    /* Shrink the massive header text */
    .hero-box h1 {
        font-size: 2.2rem !important;
    }

    /* Center the hero content and buttons */
    .hero-box {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Stack buttons vertically on small screens */
    .hero-box div[style*="display: flex; gap: 15px"] {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        gap: 10px !important;
    }

    .btn-cyber {
        width: 100%;
    }

    /* Adjust the terminal box so it fits on screen */
    .terminal-box {
        width: 100%;
        height: 350px;
        margin-bottom: 80px; /* Give space for the footer */
    }

    /* Adjust headers and footers to wrap nicely */
    .landing-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 15px;
    }

    /* Hide the developer footer on mobile to prevent overlap */
    div[style*="position: fixed; bottom: 20px"] {
        display: none !important;
    }
}