/* KGB ENTERPRISE INTELLIGENCE SYSTEM - FINAL PRODUCTION UI */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,700&family=Orbitron:wght@400;700&family=Inter:wght@300;400;600&display=swap');

:root {
    --neon-red: #ff3333;
    --dark-bg: #050505;
    --panel-grey: rgba(40, 40, 40, 0.4);
    --glass-bg: rgba(20, 20, 20, 0.85);
    --border-glow: rgba(255, 51, 51, 0.35);
    --stark-white: #ffffff;
    --server-blue: #3388ff;
    --user-green: #33ff88;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* =========================
   1. GLOBAL LAYOUT (25/60/15)
========================= */
body { 
    background-color: var(--dark-bg); 
    color: var(--stark-white); 
    font-family: 'Inter', sans-serif; 
    
    height: 100vh;
    width: 100vw;

    display: grid;
    grid-template-rows: 18vh 72vh 10vh; /* ✅ FIXED */

    overflow: hidden; 
    background-image: radial-gradient(circle at 50% 50%, #1a0505 0%, #000000 100%); 
}

/* =========================
   2. HEADER
========================= */
.main-header {
    padding: 0 40px;
    background: rgba(10, 2, 2, 0.7);
    backdrop-filter: blur(25px);
    border-bottom: 1px solid var(--border-glow);
    display: grid;
    grid-template-columns: auto auto;
    justify-content: space-between;
    align-items: left;
    height: 100%;
    white-space: nowrap;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: fit-content;
}

.kpi-section {
    display: flex;
    gap: 20px;
    justify-content: flex-end;
    align-items: center;
    justify-self: end;
}

.kgb-icon {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    font-style: italic;
    color: var(--neon-red);
    text-shadow: 0 0 20px rgba(255, 50, 50, 0.8);
}

.kpi-card {
    background: var(--panel-grey);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    padding: 12px 20px;
    min-width: 150px;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 80px;
    transition: 0.3s ease;
}

.kpi-card:hover { 
    transform: translateY(-5px); 
    border-color: var(--neon-red); 
}

.kpi-icon { font-size: 1.5rem; }

.kpi-value { 
    font-family: 'Orbitron', sans-serif; 
    font-size: 1.5rem; 
    color: var(--neon-red); 
}

.kpi-label { 
    font-size: 0.65rem; 
    color: #bbb; 
    text-transform: uppercase; 
}


/* =========================
   3. MAIN AREA (30/70)
========================= */
.main-stage { 
    display: flex; 
    padding: 20px; 
    gap: 20px; 
    height: 100%;
}

/* PANELS */
.glass-panel { 
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glow);
    border-radius: 16px;

    display: flex;
    flex-direction: column;
    height: 100%;
}

/* LEFT: CHAT */
.chat-container { 
    flex: 0 0 30%; 
}

.chat-messages {
    padding: 15px 20px;
    flex: 1;
    overflow-y: auto;
}

.message {
    border: none !important;
    background: transparent;
    padding: 8px 0;
}
/* RIGHT: GRAPH */
.graph-container { 
    flex: 0 0 70%; 
    position: relative; 
    background: rgba(0,0,0,0.4); 
}

/* PANEL HEADER */
.panel-header {
    padding: 15px 20px;
    background: rgba(255, 50, 50, 0.15);
    border-bottom: 1px solid var(--border-glow);
    font-weight: 700;
    color: var(--neon-red);

    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =========================
   4. GRAPH AREA
========================= */
#mynetwork {
    flex: 1;
    height: 100%;
}

/* SEARCH BAR */
.graph-search-wrapper input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 51, 51, 0.3);
    border-radius: 20px;
    padding: 5px 15px;
    color: white;
    font-size: 0.8rem;
    outline: none;
    width: 180px;
}

/* LEGEND */
#graph-legend {
    position: absolute;
    bottom: 15px;
    left: 15px;
    width: 100px;
    height: 160px;
    padding: 6px 8px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255, 51, 51, 0.3);
    overflow: hidden;
}

.legend-item { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-size: 0.85rem; 
}
.legend-header{
    display: flex;
    gap: 15px;
    text-align: center;
    font-size: 1.1rem; 
    font-family: Arial;
}

.legend-dot { 
    width: 12px; 
    height: 12px; 
    border-radius: 50%;
}

.ticket { background: var(--neon-red); }
.server { background: var(--server-blue); }
.user { background: var(--user-green); }
.issue { background: #f4f02a; }
.device { background: #49ccd7; }
.other { background: #a76161; }

/* =========================
   5. CHAT INPUT
========================= */
.chat-input-area { 
    padding: 20px; 
    border-top: 1px solid var(--border-glow); 
}

#userInput {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 12px;
    color: white;
    margin-bottom: 10px;
}

#userInput::placeholder { 
    color: rgba(255,255,255,0.4); 
}

.analyze-btn {
    width: 100%;
    background: var(--stark-white);
    color: black;
    padding: 12px;
    border-radius: 4px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    transition: 0.3s;
}


.analyze-btn:hover {
    background: var(--neon-red);
    color: white;
    box-shadow: 0 0 20px var(--neon-red);
}

/* =========================
   6. FOOTER
========================= */
.main-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid var(--border-glow);
    background: rgba(5,5,5,0.9);
}

.footer-center { text-align: center; }

.dev-name { 
    color: var(--neon-red); 
    font-weight: bold; 
    font-size: 1.2rem; 
}

.copyright { 
    opacity: 0.5; 
    font-size: 0.7rem; 
    margin-top: 4px; 
}