/* =========================================
   CONFIGURACIÓN GENERAL
   ========================================= */
body {
    background-color: #121212;
    color: #ffffff;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    text-align: center;
    overflow-x: hidden;
    /* Evita el rebote de scroll en iOS */
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Contenedor principal para permitir scroll contenido */
#app-content {
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* =========================================
   ENCABEZADO (HEADER PREMIUM)
   ========================================= */
header {
    background: linear-gradient(180deg, #b71c1c 0%, #801313 100%);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.header-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo-container img {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

header h1 {
    font-size: 1.1rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
}

#status-signal {
    font-size: 0.65rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: bold;
    background: rgba(0,0,0,0.2);
    text-transform: uppercase;
}

.signal-online { color: #4caf50; border: 1px solid #4caf50; }
.signal-offline { color: #ffeb3b; border: 1px solid #ffeb3b; }

/* =========================================
   MAPA Y PÁNICO
   ========================================= */
#map {
    height: 350px;
    width: 100%;
    background-color: #1a1a1a;
    border-bottom: 3px solid #b71c1c;
    z-index: 1;
}

.alert-container {
    padding: 20px;
    display: flex;
    justify-content: center;
}

.btn-main {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 8px solid #333;
    background: radial-gradient(circle, #f44336 0%, #b71c1c 100%);
    color: white;
    font-weight: 900;
    font-size: 1.1rem;
    box-shadow: 0 0 30px rgba(183, 28, 28, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.btn-main:active {
    transform: scale(0.9);
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.8);
    background: #ff0000;
}

/* =========================================
   REPORTES Y GRID
   ========================================= */
.safe-zone-container {
    padding: 0 15px 10px 15px;
}

.btn-report {
    background-color: #2c2c2c;
    border: 2px solid #444;
    color: white;
    padding: 18px 10px;
    font-size: 0.85rem;
    font-weight: bold;
    border-radius: 12px;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-report.safe-place {
    background: linear-gradient(90deg, #1a237e 0%, #0d47a1 100%);
    border: 2px solid #3f51b5;
    flex-direction: row;
    font-size: 0.95rem;
    width: 100%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 15px 20px 15px;
}

.btn-report:active {
    transform: scale(0.96);
    background-color: #444;
}

/* =========================================
   MODAL PARA REGISTRAR PARADERO
   ========================================= */
#modal-paradero {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-card {
    background: #1e1e1e;
    width: 100%;
    max-width: 400px;
    padding: 30px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    text-align: left;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.input-modal {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #444;
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 1rem;
    box-sizing: border-box;
}

.input-modal:focus {
    border-color: #b71c1c;
    outline: none;
}

.btn-modal-group {
    display: flex;
    gap: 12px;
}

.btn-m {
    flex: 1;
    padding: 15px;
    border-radius: 12px;
    border: none;
    font-weight: bold;
    cursor: pointer;
}

.btn-m-save { background: #b71c1c; color: white; }
.btn-m-cancel { background: #444; color: #ccc; }

/* =========================================
   LOGIN Y AUTENTICACIÓN
   ========================================= */
.input-auth {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 12px;
    border: 1px solid #333;
    background: #1e1e1e;
    color: white;
    font-size: 1rem;
    box-sizing: border-box;
}

.btn-auth {
    width: 100%;
    background: #b71c1c;
    color: white;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* =========================================
   FOOTER Y ESTADOS
   ========================================= */
footer {
    background-color: #1a1a1a;
    color: #666;
    padding: 40px 15px;
    border-top: 1px solid #333;
    font-size: 0.8rem;
}
.footer-links { margin-bottom: 15px; }

.footer-links a {
    color: #b71c1c;
    text-decoration: none;
    margin: 0 10px;
    font-weight: bold;
}
.offline-badge {
    margin: 10px 15px;
    padding: 12px;
    background-color: #1a1a1a;
    border-radius: 12px;
    border-left: 4px solid #b71c1c;
}

@media (max-height: 650px) {
    #map { height: 260px; }
    .btn-main { width: 120px; height: 120px; }
}