/* ============================================================
   NEXA SUITE - MAIN STYLESHEET
   Theme: Dark Cyber / Glassmorphism
   ============================================================ */

/* --- 1. VARIABILI & PALETTE --- */
:root {
    /* Sfondi */
    --bg-dark-start: #0b0e27;
    --bg-dark-end: #1a1d42;
    --nav-bg: #131638;
    
    /* Accent & Brand */
    --accent-cyan: #00eaff; 
    --danger-red: #ff3b30;
    --success-green: #2ecc71;

    /* Vetro / Cards */
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --glass-blur: 10px;

    /* Testi */
    --text-white: #ffffff;
    --text-gray: #a0a3b1;
}

/* --- 2. RESET & BASE --- */
* { box-sizing: border-box; }

html, body {
    margin: 0; 
    padding: 0; 
    height: 100%;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--bg-dark-start), var(--bg-dark-end));
    background-attachment: fixed;
    color: var(--text-white);
    -webkit-font-smoothing: antialiased;
}

/* --- 3. LAYOUT STRUTTURALE --- */

/* Header Fisso */
.app-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: 60px;
    background-color: var(--nav-bg);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-logo-text {
    font-weight: 700; font-size: 20px; letter-spacing: 1px;
}
.accent-text { color: var(--accent-cyan); }

.app-badge {
    font-size: 0.5em;
    text-transform: uppercase;
    opacity: 0.7;
    vertical-align: middle;
    letter-spacing: 1px;
    margin-left: 3px;
}

/* Contenuto Scrollabile */
.app-content {
    padding-top: 80px; /* Spazio per header */
    padding-bottom: 90px; /* Spazio per nav */
    padding-left: 20px; 
    padding-right: 20px;
    overflow-y: auto;
    min-height: 100vh;
}

/* Bottom Nav Fissa */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 70px;
    background-color: var(--nav-bg);
    display: flex; justify-content: space-around; align-items: center;
    border-top: 1px solid var(--card-border);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom); /* Per iPhone X+ */
}

.nav-item {
    display: flex; flex-direction: column; align-items: center;
    text-decoration: none;
    color: var(--text-gray);
    font-size: 11px; font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item i { font-size: 22px; margin-bottom: 4px; }

.nav-item.active { color: var(--accent-cyan); }
.nav-item.active i { filter: drop-shadow(0 0 5px var(--accent-cyan)); }

/* Badge Notifiche Icone */
.nav-icon-container { position: relative; }
.badge {
    position: absolute; top: -5px; right: -8px;
    background-color: var(--danger-red);
    color: white; font-size: 9px; font-weight: bold;
    padding: 2px 5px; border-radius: 10px;
    border: 2px solid var(--nav-bg);
}

/* --- 4. DASHBOARD COMPONENTS --- */

/* Welcome Section */
.welcome-section { margin-bottom: 25px; }
.welcome-section h2 { margin: 0; font-weight: 300; font-size: 18px; color: var(--text-gray); }
.welcome-section h1 { margin: 2px 0 0 0; font-weight: 600; font-size: 28px; color: var(--text-white); }

/* Stats Grid */
.stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 25px;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: 16px; padding: 20px;
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    transition: transform 0.2s;
}
.stat-card:active { transform: scale(0.98); }

.stat-icon { color: var(--accent-cyan); font-size: 24px; margin-bottom: 12px; }
.stat-value { font-size: 20px; font-weight: 700; margin: 5px 0; color: var(--text-white); }
.stat-label { font-size: 12px; color: var(--text-gray); }

/* Action List */
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 15px; color: var(--text-gray); text-transform: uppercase; letter-spacing: 0.5px; }

.action-list {
    background-color: var(--card-bg);
    border-radius: 16px; overflow: hidden;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(var(--glass-blur));
}

.action-item {
    display: flex; align-items: center;
    padding: 16px 20px;
    text-decoration: none; color: var(--text-white);
    border-bottom: 1px solid var(--card-border);
    transition: background 0.2s;
}
.action-item:last-child { border-bottom: none; }
.action-item:active { background-color: rgba(255,255,255,0.1); }

.action-icon-box {
    width: 36px; height: 36px;
    background: rgba(0, 234, 255, 0.1);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    margin-right: 15px; color: var(--accent-cyan);
    font-size: 16px;
}
.action-arrow { margin-left: auto; color: var(--text-gray); font-size: 12px; }

/* --- 5. MODALS (Push & Others) --- */
.push-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.3s ease;
}

.push-modal-content {
    background: linear-gradient(145deg, #1a1d42, #0b0e27);
    border: 1px solid rgba(0, 234, 255, 0.2);
    width: 85%; max-width: 320px;
    padding: 30px 25px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    color: white;
}

.push-icon-box {
    width: 60px; height: 60px;
    background: rgba(0, 234, 255, 0.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    color: var(--accent-cyan); font-size: 26px;
    box-shadow: 0 0 20px rgba(0, 234, 255, 0.2);
}

.push-modal-content h3 { margin: 0 0 10px; font-weight: 600; font-size: 18px; }
.push-modal-content p { font-size: 13px; color: var(--text-gray); margin-bottom: 25px; line-height: 1.5; }

.push-actions { display: flex; gap: 10px; }

.btn-primary {
    background: var(--accent-cyan); color: #0b0e27; border: none;
    padding: 12px; border-radius: 12px; font-weight: 700; cursor: pointer;
    flex: 1; font-size: 14px;
}
.btn-secondary {
    background: transparent; color: var(--text-gray); 
    border: 1px solid var(--card-border);
    padding: 12px; border-radius: 12px; cursor: pointer;
    flex: 1; font-size: 14px;
}

/* --- 6. MAPPA & TRACKING (Stile Dark) --- */
#map { 
    height: 100vh; width: 100%; 
    z-index: 1; 
}

/* Info box scura per la mappa */
.info-box {
    position: absolute; top: 80px; right: 20px; z-index: 900;
    background: rgba(19, 22, 56, 0.9); /* Sfondo scuro quasi opaco */
    padding: 15px; border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    max-width: 250px;
    color: var(--text-white);
    backdrop-filter: blur(5px);
}

.info-box h3 {
    margin: 0 0 10px 0; font-size: 14px; color: var(--accent-cyan);
}

.dev-item { 
    border-bottom: 1px solid var(--card-border); 
    padding: 8px 0; font-size: 12px; 
    display: flex; align-items: center;
}
.dev-item:last-child { border-bottom: none; }

.status-dot { 
    height: 8px; width: 8px; 
    background-color: #555; 
    border-radius: 50%; 
    margin-right: 8px; 
}
.online { 
    background-color: var(--success-green); 
    box-shadow: 0 0 5px var(--success-green); 
}

/* Animazioni */
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }