/* الـ body في البداية أسود فحم سادة تماماً لشاشة التسجيل */
body {
    background-color: #000000 !important;
    color: #18f417;
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    box-sizing: border-box;
}

/* الكلاس الفعّال: يفرش التدرج الأخضر الخرافي فور الدخول */
body.bg-active {
    background: radial-gradient(circle, #132213 0%, #040904 65%, #000000 100%) !important;
    animation: fadeInBg 1s ease-in-out forwards;
}

@keyframes fadeInBg {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

#output, .prompt {
    text-shadow: 0 0 5px #18f417, 0 0 10px rgba(24, 244, 23, 0.5);
    line-height: 1.6;
    font-size: 1.2rem;
}

input {
    background: transparent;
    border: none;
    color: #18f417;
    font-family: inherit;
    font-size: 1.2rem;
    outline: none;
    width: 200px;
}

.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none;
}

/* غلاف السنترة للـ Main Menu */
#menu-wrapper {
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 5;
    background-color: transparent; 
}

/* كابينة التحكم زجاجية معتمة */
#main-menu {
    width: 900px;
    max-width: 95%;
    border: 2px solid #18f417;
    padding: 20px;
    box-shadow: 0 0 15px rgba(24, 244, 23, 0.3);
    box-sizing: border-box;
    background-color: rgba(10, 10, 10, 0.93); 
}

.terminal-header {
    text-align: center;
    border-bottom: 2px dashed #18f417;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-weight: bold;
}

.menu-layout {
    display: flex;
    gap: 30px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
}

.menu-btn {
    background: transparent;
    border: 1px solid #18f417;
    color: #18f417;
    padding: 10px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.menu-btn:hover, .menu-btn.active {
    background-color: #18f417;
    color: #0a0a0a;
    box-shadow: 0 0 10px #18f417;
    font-weight: bold;
}

.content-area {
    flex-grow: 1;
    border: 1px solid #18f417;
    padding: 20px;
    min-height: 320px;
    background-color: rgba(0, 0, 0, 0.4);
}

.blink-text { animation: blink 1s infinite; }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* عناصر الأرشيف الفرعي */
.sub-menu { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }
.sub-btn { background: transparent; border: none; color: #18f417; font-family: inherit; font-size: 1rem; text-align: left; cursor: pointer; padding: 5px; transition: all 0.2s; }
.sub-btn:hover { color: #fff; padding-left: 15px; }

/* الخريطة والرادار */
.radar-container {
    position: relative;
    width: 100%;
    height: 220px;
    background-color: rgba(4, 20, 4, 0.85);
    border: 1px solid #18f417;
    margin-top: 15px;
    overflow: hidden;
}
.radar-grid {
    position: absolute;
    width: 100%; height: 100%;
    background-image: linear-gradient(rgba(24, 244, 23, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(24, 244, 23, 0.08) 1px, transparent 1px);
    background-size: 20px 20px;
}
.radar-sweep {
    position: absolute;
    width: 100%; height: 100%;
    background: linear-gradient(180deg, rgba(24, 244, 23, 0.15) 0%, transparent 100%);
    top: -100%;
    animation: sweep 3s linear infinite;
}
@keyframes sweep { 0% { top: -100%; } 100% { top: 100%; } }

.map-marker {
    position: absolute;
    width: 8px; height: 8px;
    background-color: #18f417;
    border-radius: 50%;
    box-shadow: 0 0 8px #18f417;
    cursor: pointer;
    z-index: 20;
}
.map-marker::after {
    content: ''; position: absolute;
    width: 100%; height: 100%;
    border: 1px solid #18f417; border-radius: 50%;
    animation: pulse 1.5s infinite; top: 0; left: 0;
}
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(3); opacity: 0; } }

.marker-label {
    position: absolute; left: 12px; top: -5px;
    font-size: 0.75rem; white-space: nowrap;
    background-color: #0a0a0a; padding: 1px 4px;
    border: 1px solid #18f417; color: #18f417;
}

/* تنسيق إحصائيات قسم الـ AGENT STATUS */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}
.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}
.stat-name {
    width: 170px; /* مساحة واسعة لعدم نزول النص على سطرين */
    font-size: 0.95rem;
}
.stat-bar {
    flex-grow: 1;
    height: 12px;
    border: 1px solid #18f417;
    background-color: rgba(24, 244, 23, 0.05);
    position: relative;
    overflow: hidden;
}
.stat-fill {
    height: 100%;
    background-color: #18f417;
    box-shadow: 0 0 8px #18f417;
    animation: loadBar 1s ease-out forwards;
    width: 0%;
}
@keyframes loadBar {
    from { width: 0%; }
}
.stat-val {
    width: 55px;
    text-align: right;
    font-weight: bold;
}