:root {
    --bg-color: #1e1e1e;
    /* Deep Dark Gray */
    --text-color: #ffffff;
    /* White */
    --text-dim: #aaaaaa;
    /* Light Gray */
    --accent-red: #ff4d4d;
    /* Bright Red */
    --accent-blue: #4da6ff;
    /* Bright Blue */
    --accent-green: #5cd65c;
    /* Muted Green for 'Online' status */

    /* Glassmorphism Vars */
    --glass-bg: rgba(255, 255, 255, 0.05);
    /* Very subtle white tint */
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --glass-blur: blur(12px);

    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--bg-color);
    /* Subtle texture or gradient to make glass pop */
    background-image: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blink {
    animation: blink 1.5s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.3;
    }
}

/* Shared Glass Styles */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--glass-blur);
    border-radius: 12px;
}

/* --- UNAUTHORIZED / LOGIN --- */
.container {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    margin: 8% auto;
    padding: 3rem;
    max-width: 500px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 77, 77, 0.2);
}

.terminal-body {
    background: var(--bg-color);
    color: #eee;
    font-family: var(--font-mono);
}

/* --- DASHBOARD GRID --- */
.dashboard-grid {
    display: grid;
    grid-template-areas:
        "header header header"
        "chat   map    info"
        "chat   map    missions";
    grid-template-columns: 320px 1fr 300px;
    grid-template-rows: 70px 1fr 1fr;
    height: 100vh;
    gap: 15px;
    /* Actual spacing for floating glass panels */
    padding: 15px;
    box-sizing: border-box;
}

/* HEADER */
.header {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    /* Glass Header */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    border-radius: 12px;
    height: 100%;
}

.brand {
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* PANELS */
.panel {
    composes: glass-panel;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Important for inner scroll */
}

.panel-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 8px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* CHAT */
.chat-panel {
    grid-area: chat;
}

#chat-log {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    margin-bottom: 10px;
}

.message {
    margin-bottom: 8px;
    padding: 5px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

.message.radio {
    border-left: 3px solid var(--accent-red);
    background: rgba(255, 77, 77, 0.1);
}

.message.system {
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
    text-align: center;
}

.msg-meta {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-right: 8px;
}

.chat-input-area {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
}

.chat-input-area input {
    background: transparent;
    border: none;
    color: #fff;
    flex-grow: 1;
    font-family: var(--font-mono);
    outline: none;
}

button {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid var(--glass-border);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* MAP */
.map-panel {
    grid-area: map;
    padding: 0;
    position: relative;
}

#map-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#map-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

#map-canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.map-toolbar {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    gap: 8px;
    border: 1px solid var(--glass-border);
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
}

.color-swatch.active {
    border-color: #fff;
    transform: scale(1.1);
}

/* CREW */
#online-list {
    overflow-y: auto;
}

.user-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    margin-right: 10px;
    box-shadow: 0 0 5px #555;
}

.status-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.offline {
    opacity: 0.5;
}

/* MISSIONS */
.mission-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    transition: transform 0.2s;
}

.mission-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.06);
}

.mission-card.active {
    border-left: 3px solid var(--accent-red);
    background: rgba(255, 77, 77, 0.05);
}

/* BUTTONS */
.btn-red {
    color: var(--accent-red);
    border-color: var(--accent-red);
}

.btn-red:hover {
    background: var(--accent-red);
    color: #fff;
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* NOTIFS */
#notif-overlay {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    z-index: 1000;
}

.notif {
    composes: glass-panel;
    border-left: 4px solid var(--accent-red);
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.8);
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideIn {
    from {
        transform: translateX(120%);
    }

    to {
        transform: translateX(0);
    }
}