:root {
    --bg-color: #000000;
    --text-color: #33ff00;
    /* Classic Terminal Green */
    --accent-color: #ff0000;
    /* Alert Red */
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background grid effect */
.grid-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 255, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 0, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: -1;
    pointer-events: none;
}

/* Login Container */
.login-container {
    border: 1px solid var(--text-color);
    padding: 3rem;
    width: 400px;
    background: rgba(0, 0, 0, 0.9);
    box-shadow: 0 0 20px rgba(51, 255, 0, 0.2);
    position: relative;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.8;
}

.input-group input {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid #333;
    padding: 0.8rem;
    color: var(--text-color);
    font-family: var(--font-mono);
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--text-color);
    box-shadow: 0 0 10px rgba(51, 255, 0, 0.1);
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s;
}

.btn-submit:hover {
    background: var(--text-color);
    color: black;
    box-shadow: 0 0 20px rgba(51, 255, 0, 0.4);
}

.error-msg {
    color: var(--accent-color);
    font-size: 0.8rem;
    margin-top: 1rem;
    text-align: center;
    min-height: 1.2em;
    /* Prevent layout shift */
    visibility: hidden;
}

.error-msg.visible {
    visibility: visible;
    animation: flash 0.5s;
}

@keyframes flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Dashboard Styles */
.dashboard-container {
    width: 95%;
    height: 95%;
    border: 1px solid #333;
    display: grid;
    grid-template-columns: 250px 1fr;
    grid-template-rows: 60px 1fr;
    background: rgba(0, 0, 0, 0.95);
}

.db-header {
    grid-column: 1 / -1;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.db-sidebar {
    border-right: 1px solid #333;
    padding: 1rem;
}

.db-content {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-item {
    display: block;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    opacity: 0.6;
    text-decoration: none;
    color: inherit;
}

.nav-item:hover,
.nav-item.active {
    border-left: 2px solid var(--accent-color);
    background: rgba(255, 0, 0, 0.05);
    opacity: 1;
}

.data-panel {
    border: 1px solid #1a1a1a;
    padding: 1rem;
    background: #050505;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 0.5rem;
}

.map-stats {
    font-size: 0.8rem;
    color: var(--accent-color);
}

.hacker-text {
    line-height: 1.4;
    font-size: 0.8rem;
    color: #555;
}

.hacker-text p {
    margin-bottom: 4px;
}

.blink {
    animation: blink 1s infinite step-end;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.map-container {
    width: 100%;
    height: 400px;
    background-color: #000;
    position: relative;
    overflow: hidden;
    border: 1px solid #111;
}

#threat-canvas {
    width: 100%;
    height: 100% !important;
    display: block;
}

.bottom-panels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
}

.stat-item .label {
    width: 60px;
    opacity: 0.7;
}

.bar-container {
    flex-grow: 1;
    height: 4px;
    background: #111;
}

.bar {
    height: 100%;
    background: var(--text-color);
    opacity: 0.5;
}

.intel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.intel-grid .data-panel {
    margin-bottom: 0;
}

@media (max-width: 1200px) {
    .intel-grid {
        grid-template-columns: 1fr;
    }
}

/* Statistics Table */
.stats-table-wrapper {
    margin-top: 1rem;
    overflow-x: auto;
}

.minimal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    color: #666;
}

.minimal-table th {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #111;
    color: var(--text-color);
    font-weight: normal;
    text-transform: uppercase;
}

.minimal-table td {
    padding: 10px;
    border-bottom: 1px solid #050505;
}

.status-red {
    color: #800;
}

.status-orange {
    color: #860;
}

.status-green {
    color: #080;
}

.stat-item .value {
    font-size: 0.75rem;
    opacity: 0.3;
    margin-left: 10px;
}

.term-link {
    color: var(--text-color);
    text-decoration: none;
    border: 1px solid #1a1a1a;
    padding: 5px 15px;
    font-size: 0.8rem;
    display: inline-block;
}

.term-link:hover {
    background: var(--text-color);
    color: black;
}