/* Reset & Base */
body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    background: #050505;
    color: white;
    user-select: none;
}

/* Utils di SAURON */
.modal-hidden {
    display: none !important;
}

.success-bg {
    background: #27ae60 !important;
}

/* --- TOPBAR --- */
#topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    background: #2c3e50;
    padding: 0 20px;
    border-bottom: 2px solid #34495e;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 100;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-size: 1.2em;
    font-weight: bold;
    letter-spacing: 2px;
    color: #fff;
}

#user-greeting {
    border-left: 2px solid #34495e;
    padding-left: 10px;
    font-size: 0.9em;
    color: #bdc3c7;
}

.topbar-actions {
    display: flex;
    gap: 10px;
}

/* --- TACTICAL DROPDOWN --- */
.dropdown-tactical {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #1a252f;
    min-width: 200px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.7);
    z-index: 200;
    border-radius: 4px;
    border: 1px solid #34495e;
    overflow: hidden;
}

.dropdown-content.show-menu {
    display: block !important;
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #2c3e50;
    font-size: 0.9em;
}

.dropdown-content a:hover {
    background-color: #3498db;
}

/* --- SPECIFICI PER LOGIN/PRIVACY (Usano basi di notifications.css) --- */
.auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    margin-bottom: 12px;
    background: #0d141b;
    border: 1px solid #34495e;
    color: white;
    border-radius: 4px;
}

.auth-footer-text {
    text-align: center;
    font-size: 0.85em;
    color: #7f8c8d;
    margin-top: 15px;
}

/* --- GLOBE & TACTICAL ELEMENTS --- */
#globeViz {
    width: 100vw;
    height: calc(100vh - 60px);
}

body.placement-mode-active #globeViz {
    cursor: crosshair !important;
}

.interactive-layer {
    pointer-events: auto;
}

.yellow-dot {
    width: 14px;
    height: 14px;
    background: #FFD700;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

.post-it {
    display: none;
    position: absolute;
    background: #fdfd96;
    color: #333;
    padding: 12px;
    width: 220px;
    top: -5px;
    left: 25px;
    z-index: 10;
    border-bottom-right-radius: 12px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
    font-size: 13px;
}

#polygon-tools {
    display: none;
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 62, 80, 0.9);
    padding: 10px 20px;
    border-radius: 30px;
    border: 2px solid #f1c40f;
    z-index: 500;
    align-items: center;
    gap: 15px;
}

/* --- MAP OVERLAYS (Posizionamento UI sulla mappa) --- */
.map-ui-container {
    position: absolute;
    z-index: 100;
    pointer-events: none;
    /* Lascia passare i click al globo... */
}

.map-ui-container>* {
    pointer-events: auto;
    /* ...tranne che sui bottoni */
}

.ui-top-right {
    top: 75px;
    right: 15px;
}

.ui-bottom-left {
    bottom: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Adattamento Topbar per i nuovi dati */
.user-info-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    border-left: 2px solid #34495e;
    padding-left: 10px;
}

.game-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.game-controls select {
    padding: 6px;
    border-radius: 4px;
    background: #1a252f;
    color: white;
    border: 1px solid #3498db;
}

/* ==========================================
   SAURON - PANNELLO GESTORE (Dashboard)
   ========================================== */

body.gestore-layout {
    background: #0f171e;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    overflow: auto;
    /* Sovrascrive l'hidden della mappa */
}

.dashboard-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 60px);
}

/* Sidebar Menu */
.sidebar {
    width: 250px;
    background: #1a252f;
    border-right: 2px solid #34495e;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-btn {
    background: transparent;
    border: none;
    color: #bdc3c7;
    text-align: left;
    padding: 15px 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: 0.2s;
    font-weight: bold;
}

.sidebar-btn:hover {
    background: #2c3e50;
    color: white;
    border-left: 4px solid #3498db;
}

.sidebar-btn.active {
    background: #2c3e50;
    color: #3498db;
    border-left: 4px solid #3498db;
}

/* Area Contenuto e Tabs */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.tab-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-section.active {
    display: block;
}

/* Tabelle Dati */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #1a252f;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #34495e;
}

.data-table th {
    background: #2c3e50;
    color: #3498db;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-table tr:hover {
    background: #273746;
}

/* Intestazioni Sezione */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #34495e;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;
    color: #3498db;
}

button,
.action-btn,
.sidebar-btn,
.btn-confirm {
    box-shadow: none !important;
    border-radius: 2px !important;
    border: none !important;
    background-image: none !important;
    text-shadow: none !important;
    transform: none !important;
    transition: background-color 0.2s ease, opacity 0.2s ease !important;
}

button:hover,
.action-btn:hover,
.sidebar-btn:hover,
.btn-confirm:hover {
    opacity: 0.85;
}

.auth-input {
    border-radius: 2px !important;
    box-shadow: none !important;
}

@keyframes dropInBlink {
    0% {
        transform: scale(3) translateY(-20px);
        opacity: 0;
        filter: drop-shadow(0 0 20px #fff);
    }

    50% {
        transform: scale(1) translateY(0);
        opacity: 1;
        filter: drop-shadow(0 0 30px #f1c40f);
    }

    100% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 0px transparent);
    }
}

.new-element-anim {
    animation: dropInBlink 0.6s ease-out forwards;
}

/* --- IOS SWITCH PER MODALITÀ MODIFICA --- */
.ios-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #7f8c8d;
    /* Grigio spento */
    transition: .4s;
    border-radius: 22px;
}

.ios-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* Colore attivo (Arancione Sauron) */
.ios-switch input:checked+.ios-slider {
    background-color: #f39c12;
}

.ios-switch input:checked+.ios-slider:before {
    transform: translateX(18px);
}

.privacy-footer-btn {
    position: fixed;
    bottom: 15px;
    right: 15px; /* Spostato in basso a destra */
    z-index: 1000; /* Sopra la mappa */
    background: rgba(26, 37, 47, 0.8);
    color: #bdc3c7;
    border: 1px solid #34495e;
    padding: 6px 12px;
    font-size: 0.75em;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.privacy-footer-btn:hover {
    background: #34495e;
    color: white;
}

/* Allineamento banner cookie per non sovrapporsi */
#cookie-banner {
    right: 15px;
    bottom: 55px; /* Alzato per lasciare spazio al tasto privacy */
}

/* Raddoppio altezza pulsanti topbar */
.topbar-tall-btn {
    padding-top: 16px !important;
    padding-bottom: 16px !important;
    font-weight: bold;
    border-radius: 4px !important;
}