:root {
    --primary-sky: #007bff;
    --dark-sky: #004085;
    --light-cloud: #f0f8ff;
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --glass: rgba(255, 255, 255, 0.95);
}

body {
    background: linear-gradient(135deg, #e0f7fa 0%, #ffffff 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    margin: 0;
    padding-bottom: 50px;
    min-height: 100vh;
}

/* NAVBAR */
.NavBar {
    background: var(--dark-sky);
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.NavBar img {
    height: 40px;
    filter: brightness(0) invert(1);
}

.dashboard-sky {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* WIDGET SEZIONE RISCHIO */
.risk-widget-section {
    margin-bottom: 40px;
    background-color: transparent;
}

.section-title {
    color: var(--dark-sky);
    font-weight: 700;
    margin-bottom: 20px;
    border-left: 5px solid var(--primary-sky);
    padding-left: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.widget-card {
    background: var(--white);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 5px solid transparent;
    height: 100%;
}

.widget-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.widget-card.border-danger { border-color: #dc3545; }
.widget-card.border-warning { border-color: #ffc107; }
.widget-card.border-success { border-color: #198754; }

.risk-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    margin: 0 auto 15px auto;
    font-size: 1.5rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.flight-code {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--dark-sky);
    margin-bottom: 2px;
}

.flight-dest {
    color: #666;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 10px;
}

.risk-label {
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* TABELLA VOLI */
.table-container {
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 40px;
}

.header-row {
    display: flex;
    background-color: var(--primary-sky);
    color: white;
    font-weight: 600;
    padding: 15px 20px;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.card-volo {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.card-volo:hover {
    background-color: #f8fbff;
}

.card-volo:last-child {
    border-bottom: none;
}

/* Colonne Tabella (Flex) */
.col-id { flex: 1; font-weight: bold; color: var(--primary-sky); }
.col-company { flex: 2; font-weight: 500; }
.col-dest { flex: 2; color: #555; }
.col-meteo { flex: 3; padding-right: 20px; }
.col-actions { flex: 2; text-align: center; }
.col-pdf { flex: 1; text-align: right; }

.meteo-text {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-sky {
    background-color: var(--primary-sky);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.btn-sky:hover {
    background-color: var(--dark-sky);
    transform: scale(1.05);
}

/* SEZIONE ANNUNCI FLIP */
.annunci-section {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    padding: 30px;
    background: linear-gradient(180deg, #f0f8ff 0%, #ffffff 100%);
    justify-content: center;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.airport-flip-container {
    width: 260px;
    height: 150px;
    perspective: 1000px;
}

.flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: airport-flip 8s infinite ease-in-out;
}
.front, .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: inherit; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: none;
}

.front {
    background-color: #ffffff;
    color: #333;
    transform: rotateX(0deg);
    border: 1px solid #eef2f3;
}

.front .top-info { 
    font-size: 1.5rem; 
    font-weight: 800; 
    color: var(--primary-sky);
    border-bottom: 2px solid #f0f8ff; 
    width: 80%; 
    padding-bottom: 10px; 
    margin-bottom: 10px; 
}
.front .mid-info { 
    font-size: 1.1rem; 
    font-weight: 600;
    text-transform: uppercase; 
    color: #555;
    letter-spacing: 0.5px;
}
.front .bot-info { 
    font-size: 0.9rem; 
    margin-top: 10px; 
    font-weight: bold;
    background-color: #eef2f3;
    padding: 4px 12px;
    border-radius: 20px;
}
.back {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    transform: rotateX(180deg);
    padding: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.3);
}
@keyframes airport-flip {
    0% { transform: rotateX(0deg); }
    35% { transform: rotateX(0deg); }
    45% { transform: rotateX(180deg); }
    85% { transform: rotateX(180deg); }
    100% { transform: rotateX(360deg); }
}

/* MODALE */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.modal-header {
    background-color: var(--primary-sky);
    color: white;
    border-radius: 15px 15px 0 0;
}
.modal-title { font-weight: 600; }
.btn-close { filter: invert(1); }
@media (max-width: 450px) {
    .NavBar {
        padding: 10px 15px;
    }

    .dashboard-sky {
        padding: 10px;
    }

    .header-row {
        display: none;
    }

    .card-volo {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        background: #fff;
        border-radius: 15px;
        margin-bottom: 20px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
        border: 1px solid #eee;
    }

    .col-id, .col-company, .col-dest, .col-meteo, .col-actions, .col-pdf {
        width: 100%;
        text-align: left;
        flex: none;
        padding: 0;
    }

    .col-id {
        font-size: 1.3rem;
        border-bottom: 2px solid #f0f8ff;
        padding-bottom: 5px;
        margin-bottom: 5px;
    }

    .col-company {
        font-size: 1.1rem;
        color: var(--dark-sky);
        margin-bottom: 5px;
    }

    .col-dest {
        font-weight: bold;
        margin-bottom: 10px;
    }

    .col-meteo {
        background-color: #f8f9fa;
        padding: 10px;
        border-radius: 10px;
        margin-bottom: 10px;
    }

    .meteo-text {
        white-space: normal;
        margin-bottom: 8px;
    }

    .btn-sky, .btn-sm {
        width: 100%;
        display: block;
        margin-bottom: 5px;
        padding: 10px;
    }

    .annunci-section {
        padding: 15px;
        gap: 15px;
    }

    .airport-flip-container {
        width: 100%;
        max-width: 300px;
    }
}