/* css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

:root {
    --bg-base: #02040a;
    --bg-panel: #0a0e17;
    --neon-cyan: #00FFCC;
    --neon-pink: #FF00FF;
    --neon-gold: #FFD700;
    --alert-red: #ff3333;
    --border-glow: 0 0 10px rgba(0, 255, 204, 0.3);
}

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

body {
    font-family: 'Share Tech Mono', monospace;
    background-color: var(--bg-base);
    color: var(--neon-cyan);
    overflow-x: hidden;
    line-height: 1.5;
}

/* --- LAYOUT STRUCTURE --- */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-panel);
    border-bottom: 2px solid var(--neon-cyan);
    box-shadow: var(--border-glow);
}

header h1 {
    font-size: 1.5rem;
    text-shadow: 0 0 5px var(--neon-cyan);
    letter-spacing: 2px;
}

nav {
    display: flex;
    gap: 10px;
}

.main-content {
    display: flex;
    flex: 1;
    gap: 20px;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* --- SIDEBAR / HUD --- */
.hud-panel {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.panel-box {
    background: var(--bg-panel);
    border: 1px solid var(--neon-cyan);
    padding: 15px;
    box-shadow: inset 0 0 10px rgba(0, 255, 204, 0.05);
}

.panel-box h3 {
    border-bottom: 1px dashed var(--neon-cyan);
    padding-bottom: 5px;
    margin-bottom: 10px;
    color: var(--neon-gold);
}

.highlight { color: #FFF; text-shadow: 0 0 5px #FFF; }
.pink-text { color: var(--neon-pink); }
.gold-text { color: var(--neon-gold); }

/* --- BUTTONS & INPUTS --- */
button {
    background: transparent;
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
    padding: 8px 15px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    text-transform: uppercase;
}

button:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 10px var(--neon-cyan);
}

button.danger {
    color: var(--alert-red);
    border-color: var(--alert-red);
}
button.danger:hover {
    background: var(--alert-red);
    color: #000;
    box-shadow: 0 0 10px var(--alert-red);
}

input, select {
    background: #000;
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
    padding: 8px;
    font-family: inherit;
    width: 100%;
    margin-bottom: 10px;
}

/* --- CANVAS & VIEWS --- */
.view-container {
    flex: 3;
    display: flex;
    flex-direction: column;
    height: 85vh; /* Gives the radar room to breathe */
}

.radar-wrapper {
    width: 100%;
    flex: 1; 
    border: 2px solid var(--neon-cyan);
    box-shadow: var(--border-glow);
    background: #000;
    
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* NEW: Forces Flexbox to allow shrinking below its content size */
    min-width: 0; 
    overflow: hidden;
}

canvas {
    cursor: crosshair;
    
    /* NEW: The Silver Bullet for Canvas Overflow. 
       This tells the browser it's legally allowed to squish the canvas 
       if the window gets smaller, allowing JS to measure the new smaller space! */
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
}

.terminal-log {
    height: 150px;
    overflow-y: auto;
    font-size: 0.85rem;
    color: #00ccaa;
    background: rgba(0, 20, 30, 0.5);
}

.hidden { display: none !important; }

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .main-content {
        /* CRITICAL: This puts the Radar on TOP of the HUD on phones! */
        flex-direction: column-reverse; 
        padding: 10px;
        gap: 15px;
    }
    
    .view-container {
        /* Gives the canvas exactly half the phone screen so it's always playable */
        height: 50vh; 
        min-height: 400px; 
    }
    
    .hud-panel {
        min-width: 100%;
    }
    
    header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    header h1 {
        font-size: 1.2rem;
    }
    
    nav {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav button {
        font-size: 0.85rem;
        padding: 8px;
        flex: 1; /* Makes buttons span the width of the screen evenly */
    }

    /* Make buttons bigger for "fat fingers" on touch screens */
    .buy-btn, button {
        padding: 12px; 
        font-weight: bold;
    }
}

/* --- SECURE DATA TABLES (ADMIN) --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    color: var(--neon-cyan);
    background: rgba(0, 0, 0, 0.5);
}

th, td {
    border: 1px solid rgba(0, 255, 204, 0.3);
    padding: 10px 15px;
    text-align: left;
}

th {
    background: rgba(0, 255, 204, 0.1);
    color: var(--neon-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9em;
}

tr:hover {
    background: rgba(0, 255, 204, 0.05);
}

/* Keep the table inputs compact */
td input[type="number"] {
    width: 90px;
    margin-bottom: 0;
    padding: 5px;
    display: inline-block;
}

td button {
    padding: 5px 10px;
    font-size: 0.85em;
}

.admin-header-link {
    color: var(--neon-pink);
    text-decoration: none;
    font-weight: bold;
    border: 1px solid var(--neon-pink);
    padding: 5px 15px;
    transition: 0.2s;
}

.admin-header-link:hover {
    background: var(--neon-pink);
    color: #000;
}