* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', sans-serif;
    color: #fff;
    background-color: #0b0f19;
    background-image: radial-gradient(circle at top right, #111a2f, #0b0f19);
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
    position: relative;
}

.sidebar {
    width: 250px;
    background: rgba(255,255,255,0.02);
    border-right: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 40px;
    color: #fff;
}
.logo span { color: #00f2fe; }

.sidebar nav a {
    color: #8da2b5;
    text-decoration: none;
    display: block;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: 0.3s;
}
.sidebar nav a:hover, .sidebar nav a.active {
    background: rgba(0, 242, 254, 0.1);
    color: #00f2fe;
}

.emergency-trigger {
    margin-top: auto;
}
#emergencyBtn {
    width: 100%;
    background: rgba(255, 75, 75, 0.1);
    border: 1px solid #ff4b4b;
    color: #ff4b4b;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}
#emergencyBtn:hover {
    background: #ff4b4b;
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 75, 75, 0.5);
}

.dashboard {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}
.pulse {
    height: 10px; width: 10px; background: #00f2fe; border-radius: 50%;
    display: inline-block; margin-right: 10px; animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 242, 254, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 242, 254, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 242, 254, 0); }
}

.grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr;
    gap: 25px;
}

.card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 25px;
    backdrop-filter: blur(10px);
}
.card h2 { font-size: 1.1rem; margin-bottom: 20px; color: #b1c5d9; }

/* Map */
.stadium-map {
    position: relative;
    width: 100%;
    height: 300px;
    background: rgba(0,0,0,0.2);
    border-radius: 50%;
    border: 2px dashed rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
}
.pitch {
    width: 50%; height: 60%; background: #0a2e1d; border: 2px solid #1a5e3d; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; color: #4facfe; font-weight: bold;
}
.stand {
    position: absolute; padding: 10px; border-radius: 8px; font-size: 0.8rem;
    background: rgba(0, 242, 254, 0.1); border: 1px solid rgba(0, 242, 254, 0.3); text-align:center; transition: 0.5s;
}
.north { top: -20px; left: 50%; transform: translateX(-50%); }
.south { bottom: -20px; left: 50%; transform: translateX(-50%); }
.east { right: -30px; }
.west { left: -30px; }

.metric { margin-bottom: 20px; }
.metric label { display: block; font-size: 0.8rem; margin-bottom: 5px; color: #bdc8d4; }
.bar-bg { background: rgba(255,255,255,0.1); height: 8px; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.cyan { background: #00f2fe; box-shadow: 0 0 10px #00f2fe; }
.red { background: #ff4b4b; box-shadow: 0 0 10px #ff4b4b; }
.score { font-size: 2rem; font-weight: 800; color: #20f08b; }

.log-box { font-family: monospace; font-size: 0.8rem; color: #00f2fe; background: rgba(0,0,0,0.4); padding: 10px; border-radius: 8px; margin-top: 20px; }

/* Phone */
.phone-mockup {
    width: 260px; height: 500px; border: 8px solid #1f2937; border-radius: 36px;
    margin: 0 auto; background: #0b0f19; position: relative; overflow: hidden;
}
.phone-header { background: #1f2937; padding: 15px; text-align: center; font-size: 0.9rem; font-weight:bold; }
.phone-screen { padding: 20px; transition: 0.3s; }
.ai-suggestion { background: rgba(0, 242, 254, 0.1); border-left: 3px solid #00f2fe; padding: 15px; border-radius: 8px; margin: 20px 0; font-size: 0.85rem;}
.phone-map { height: 150px; background: rgba(255,255,255,0.05); border-radius: 8px; display:flex; align-items:center; justify-content:center; margin-bottom:20px; font-size: 0.8rem; border: 1px solid rgba(0,242,254,0.3);}
.phone-btn { width: 100%; padding: 12px; border: none; border-radius: 8px; background: #2b3b55; color: #fff; cursor: pointer; }

/* Emergency Mode */
.emergency-mode body { animation: alarmBG 1s infinite alternate; }
.emergency-mode .card, .emergency-mode .sidebar { border-color: #ff4b4b; }
@keyframes alarmBG { from { background: #1a0000; } to { background: #330000; } }

#emergencyOverlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,0,0,0.85); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 1000; flex-direction: column; }
#emergencyOverlay.hidden { display: none; }
.emergency-content { text-align: center; }
.emergency-content h1 { font-size: 4rem; color: #fff; margin-bottom: 20px; animation: flashTxt 0.5s infinite; }
@keyframes flashTxt { 0% {opacity:1;} 50% {opacity:0.6;} 100% {opacity:1;} }
.evac-route { font-size: 2rem; background: #fff; color: #ff0000; padding: 20px; border-radius: 12px; margin: 30px; font-weight: bold; }
#cancelEmergencyBtn { background: transparent; border: 2px solid #fff; color: #fff; padding: 10px 20px; font-size: 1rem; cursor: pointer; border-radius: 8px; transition: 0.3s; }
#cancelEmergencyBtn:hover { background: #fff; color:#ff0000; }

/* Phone Emergency Module */
.phone-emergency { background: #ff0000 !important; color: #fff; }
.phone-emergency .ai-suggestion { background: #fff; color: #ff0000; border: none; }
