:root {
    --primary-blue: #0288D1;
    /* Celeste Genaro */
    --dark-blue: #01579B;
    --primary-red: #D32F2F;
    /* Keep red for SOS only */
    --police-blue: #1565C0;
    --ambulance-green: #2E7D32;
    --fire-orange: #E65100;
    --serenazgo-brown: #5D4037;
    --white: #ffffff;
    --bg-color: #E3F2FD;
    /* Light Blue Background */
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: #333;
    overflow-x: hidden;
    user-select: none;
    /* Prevent selection for app-like feel */
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* HEADER */
header {
    background: var(--primary-blue);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    justify-content: space-between;
    /* Push install button to right */
}

.header-install-btn {
    background: white;
    color: var(--primary-blue);
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-left: auto;
    /* Ensure it sticks to right */
}

.school-logo {
    height: 50px;
    margin-right: 15px;
    border-radius: 50%;
    background: white;
    padding: 2px;
}

.header-text h1 {
    font-size: 16px;
    margin: 0;
    font-weight: 700;
}

.header-text h2 {
    font-size: 12px;
    margin: 0;
    font-weight: 400;
    opacity: 0.9;
}

/* LOCATION BAR */
.location-bar {
    background: #333;
    color: #ffd700;
    padding: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
}

/* MAIN SCREEN */
#main-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.sos-btn {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ff5252, #D32F2F);
    border: 8px solid #B71C1C;
    color: white;
    font-size: 60px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(211, 47, 47, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.sos-btn:active {
    transform: scale(0.95);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.sos-btn .subtext {
    font-size: 14px;
    font-weight: 400;
    margin-top: 10px;
    max-width: 80%;
    line-height: 1.2;
}

.instruction {
    margin-top: 30px;
    color: #666;
    font-size: 18px;
    text-align: center;
}

/* PULSE ANIMATION */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7);
    }

    70% {
        box-shadow: 0 0 0 30px rgba(211, 47, 47, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* OPTIONS SCREEN */
#options-screen {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.voice-instruction {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--primary-blue);
}

.grid-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.emergency-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 12px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
    text-align: center;
}

.emergency-card:active {
    transform: scale(0.98);
}

.emergency-card span {
    margin-top: 10px;
    font-size: 16px;
}

.emergency-card.ambulance {
    background: var(--ambulance-green);
    font-size: 40px;
}

.emergency-card.police {
    background: var(--police-blue);
    font-size: 40px;
}

.emergency-card.serenazgo {
    background: var(--serenazgo-brown);
    font-size: 40px;
}

.emergency-card.fire {
    background: var(--fire-orange);
    font-size: 40px;
}

.siren-btn {
    width: 100%;
    padding: 20px;
    background: #212121;
    color: #ffeb3b;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    margin-top: auto;
    /* Push to bottom if space allows */
    margin-bottom: 15px;
    cursor: pointer;
    box-shadow: inset 0 0 10px rgba(255, 235, 59, 0.2);
}

.siren-btn.active {
    background: #ffeb3b;
    color: #212121;
    animation: pulse-yellow 1s infinite;
}

@keyframes pulse-yellow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 235, 59, 0.7);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(255, 235, 59, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 235, 59, 0);
    }
}

.back-btn {
    width: 100%;
    padding: 15px;
    background: white;
    border: 2px solid #ccc;
    color: #666;
    font-weight: bold;
    border-radius: 12px;
}

/* INSTALL PROMPT */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.install-prompt button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
}

.close-install {
    background: transparent !important;
    padding: 5px !important;
    font-size: 14px;
    color: #aaa !important;
}