:root {
    --bg-color: #0d0f12;
    --panel-bg: rgba(255, 255, 255, 0.05);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0aab5;
    --accent-color: #3b82f6;
    
    --alert-red: #ef4444;
    --alert-orange: #f97316;
    --alert-green: #22c55e;
}

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

body {
    font-family: 'Rubik', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden; /* TV interfaces shouldn't scroll the body */
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Glassmorphism Panels */
.panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 20px;
}

/* TV Focus State */
.focusable {
    transition: all 0.2s ease;
    cursor: pointer;
    outline: 2px solid transparent;
}

.focusable.focused {
    outline: 4px solid #ffffff;
    box-shadow: 0 0 20px rgba(255,255,255,0.4);
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.15);
    z-index: 10;
}

/* Dashboard Layout */
#dashboard {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
    gap: 24px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h2 {
    font-size: 2rem;
    font-weight: 700;
}

#disclaimer {
    color: var(--alert-orange);
    font-weight: 500;
    font-size: 1.2rem;
    background: rgba(249, 115, 22, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
}

.clock {
    font-size: 2.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

main {
    display: flex;
    flex: 1;
    gap: 24px;
    min-height: 0;
}

/* Map Area */
#map-container {
    flex: 2;
    position: relative;
    padding: 0;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
}

.map-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
}

/* Sidebar Alerts */
#sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--panel-border);
}

#alerts-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 8px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.alert-card {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--panel-border);
    border-right: 6px solid var(--panel-border);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-card.type-red { border-right-color: var(--alert-red); }
.alert-card.type-orange { border-right-color: var(--alert-orange); }
.alert-card.type-green { border-right-color: var(--alert-green); }

.alert-header {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.alert-body {
    font-size: 1.1rem;
    line-height: 1.4;
}

.btn {
    background: transparent;
    color: white;
    border: 1px solid var(--panel-border);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Full Screen Alert */
#full-screen-alert {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: flashIn 0.5s ease-out forwards;
}

#full-screen-alert.hidden {
    display: none;
}

.alert-content {
    max-width: 80%;
    padding: 60px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    border: 4px solid rgba(255,255,255,0.2);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

#alert-title {
    font-size: 6rem;
    font-weight: 900;
    margin-bottom: 24px;
}

#alert-text {
    font-size: 3rem;
    font-weight: 500;
}

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: 60%;
    max-height: 80%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.regions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    overflow-y: auto;
    padding: 12px;
    flex: 1;
}

.region-item {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--panel-border);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.region-item.selected {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent-color);
}

input[type="text"] {
    width: 100%;
    padding: 16px;
    border-radius: 8px;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--panel-border);
    color: white;
    font-size: 1.2rem;
    font-family: inherit;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

@keyframes flashIn {
    0% { opacity: 0; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
}

.status-indicator::before {
    content: '';
    display: inline-block;
    width: 10px; height: 10px;
    background: var(--alert-green);
    border-radius: 50%;
    margin-left: 8px;
    box-shadow: 0 0 10px var(--alert-green);
}

@keyframes flashRedAlert {
    0% { background-color: rgba(239, 68, 68, 0.95); box-shadow: inset 0 0 0 rgba(0,0,0,0); }
    50% { background-color: rgba(153, 27, 27, 1); box-shadow: inset 0 0 150px rgba(0,0,0,0.8); }
    100% { background-color: rgba(239, 68, 68, 0.95); box-shadow: inset 0 0 0 rgba(0,0,0,0); }
}

.flash-red {
    animation: flashRedAlert 0.7s infinite !important;
}

.login-input {
    width: 100%;
    padding: 16px;
    border-radius: 8px;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--panel-border);
    color: white;
    font-size: 1.2rem;
    font-family: inherit;
    text-align: center;
}

.login-input:focus {
    outline: none;
    border-color: var(--accent-color);
}
