﻿:root {
    --rosso-ferrari: #FF2800;
    --sfondo-bianco: #ffffff;
    --GrigioSfumato: #343a4096;
}

body {
    padding-top: 50px;
    padding-bottom: 20px;
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--sfondo-bianco);
}

.container {
    padding: 15px;
}

/* RIQUADRO BASE — stile condiviso */
.box-style {
    background-color: var(--sfondo-bianco);
    border: 2px solid var(--rosso-ferrari);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    padding: 20px;
    min-width: 250px;
    max-width: 400px;
    width: 100%;
    margin: auto;
    text-align: center;
}

/* RIQUADRO BASE — stile leggero */
.box-style-light {
    background-color: var(--sfondo-bianco);
    border: 1px solid var(--rosso-ferrari);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    padding: 20px;
    min-width: 250px;
    max-width: 400px;
    width: 100%;
    margin: auto;
    text-align: center;
}

/* POPUP COUNTDOWN */
.popupCountdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 5s ease-in-out;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    .popupCountdown.show {
        opacity: 1;
    }

    .popupCountdown.hide {
        opacity: 0;
        visibility: hidden;
    }

/* IMMAGINE INTRO */
.intro-image {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0px 4px 12px rgba(0,0,0,0.3);
}

/* LABEL COUNTDOWN */
.countdownLabel {
    font-size: 16px;
    color: var(--rosso-ferrari);
    margin-top: 10px;
    display: block;
}

/* LOGIN PANEL */
.loginPanel {
    display: none;
    opacity: 0;
    transition: opacity 5s ease-in-out;
    margin-top: 40px;
}

    .loginPanel.showLogin {
        display: block;
        opacity: 1;
    }

/* FORM ELEMENTS */
.form-group {
    margin-bottom: 15px;
}

.control-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--rosso-ferrari);
}

.form-control {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border-radius: 6px;
    /*border: 1px solid #ccc;*/
}

/* VALIDAZIONE */
.text-danger {
    color: var(--rosso-ferrari);
    font-size: 14px;
}

/* BUTTONS */
.btn {
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    border-radius: 8px;
}

.btn-primary {
    background-color: var(--rosso-ferrari);
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease;
}

    .btn-primary:hover {
        background-color: #e02500;
    }

.btn-block {
    width: 100%;
}

/* RESPONSIVE */
@media screen and (max-width: 480px) {
    .popupCountdown {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 16px;
        padding: 15px;
        max-width: 90%;
        width: 90%;
        text-align: center;
        z-index: 9999;
    }

    .intro-image {
        display: block;
        margin: 0 auto;
        width: 80%;
        height: auto;
        border-radius: 20px;
        box-shadow: 0px 4px 12px rgba(0,0,0,0.3);
    }

    .login-box {
        padding: 15px;
    }
}

/* ANIMAZIONI FADE */
.fade-in {
    opacity: 0;
    animation: fadeInOnly 5s ease-in forwards;
}

.fade-out {
    opacity: 1;
    animation: fadeOutOnly 5s ease-out forwards;
    pointer-events: none;
}

@keyframes fadeInOnly {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOutOnly {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* NASCONDI ELEMENTI */
.hidden {
    display: none !important;
}

/* ============================================================
   SEZIONE HOME — GRADIENTI, EFFETTI E COLORI FORMULA 1
   ============================================================ */
.home-hero {
    background: linear-gradient(135deg, #ff2800, #b40000, #ff2800);
    background-size: 200% 200%;
    animation: moveGradient 6s ease infinite;
    padding: 80px 0;
    border-bottom: 4px solid var(--rosso-ferrari);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    border-radius: 12px;
    transform: none;
    backface-visibility: hidden;
}

.hero-box {
    background: transparent !important;
    border: none;
    box-shadow: none;
}

.rosso-ferrari {
    color: var(--rosso-ferrari);
}

@keyframes moveGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.fade-slide {
    opacity: 0;
    transform: translateY(-30px);
    animation: fadeSlideIn 1.5s ease forwards;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUpIn 1.5s ease forwards;
}

@keyframes fadeUpIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delay-1 {
    animation-delay: 0.3s;
}

.delay-2 {
    animation-delay: 0.6s;
}

/* ============================================================
   NAVBAR FORMULA 1 — FIX MENU E STILE
   ============================================================ */
.navbar {
    background-color: var(--sfondo-bianco) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border-bottom: none !important;
}

    .navbar .navbar-brand,
    .navbar .nav-link,
    .navbar .dropdown-toggle {
        color: var(--rosso-ferrari) !important;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        transition: color 0.3s ease, transform 0.2s ease;
    }

        .navbar .navbar-brand:hover,
        .navbar .nav-link:hover,
        .navbar .dropdown-toggle:hover,
        .navbar .nav-link:focus {
            color: #b40000 !important;
            transform: scale(1.05);
        }

    /* Dropdown centrato sotto la voce */
    .navbar .dropdown-menu {
        border: 1px solid var(--rosso-ferrari);
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        left: 50% !important;
        transform: translateX(-50%) !important;
        right: auto !important;
        min-width: 160px;
        max-width: 90vw;
        overflow-x: hidden;
    }

    /* Elementi dropdown */
    .navbar .dropdown-item {
        color: var(--rosso-ferrari);
        transition: background-color 0.3s ease, color 0.3s ease;
        white-space: nowrap;
    }

        .navbar .dropdown-item:hover {
            background-color: var(--rosso-ferrari);
            color: white;
        }

/* Bottone menu mobile */
.navbar-toggler {
    border-color: var(--rosso-ferrari);
}

.navbar-toggler-icon {
    filter: invert(27%) sepia(99%) saturate(7475%) hue-rotate(4deg) brightness(102%) contrast(104%);
}

/* Mobile: menu sempre interno allo schermo */
@media (max-width: 933px) {
    .navbar .dropdown-menu {
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        width: 100% !important;
        text-align: center;
        margin: 0 auto;
        border-left: none;
        border-right: none;
    }

    .navbar .nav-item {
        text-align: center;
    }
}

/* ============================================================
   ACCENTI ROSSO FERRARI PER ASP.NET CONTROLLI
   ============================================================ */
input[type="submit"],
asp\:button,
button,
.btn {
    background-color: var(--rosso-ferrari);
    color: #fff !important;
    border: 1px solid var(--rosso-ferrari);
    border-radius: 8px;
    transition: all 0.3s ease;
}

    input[type="submit"]:hover,
    asp\:button:hover,
    button:hover,
    .btn:hover {
        background-color: #b40000;
        color: #fff !important;
        transform: scale(1.03);
    }

/* DROPDOWNLIST ASP.NET */
select,
.aspNetDropDown,
select.form-control {
    background-color: #fff;
    color: #222;
    border: 1px solid var(--rosso-ferrari);
    border-radius: 6px;
    padding: 6px 10px;
    transition: all 0.3s ease;
    /*appearance: none;*/
    cursor: pointer;
    text-align: center;
}

    select:focus,
    .aspNetDropDown:focus,
    select.form-control:focus {
        outline: none;
        border-color: var(--rosso-ferrari);
        box-shadow: 0 0 6px rgba(255, 40, 0, 0.4);
    }

    select:hover {
        border-color: #b40000;
    }

    select option {
        color: #000;
        background-color: #fff;
    }

.gridview select,
asp\:gridview select {
    background-color: #fff !important;
    color: #000 !important;
    border: 1px solid var(--rosso-ferrari);
}

/* GRIDVIEW HEADER */
.gridview thead th,
asp\:gridview th {
    background-color: var(--rosso-ferrari) !important;
    color: white !important;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
}

/* GRIDVIEW BORDO */
.gridview,
asp\:gridview {
    border-top: 3px solid var(--rosso-ferrari) !important;
    border-collapse: collapse;
}

/* TITOLI */
h2, h3, h4 {
    color: var(--rosso-ferrari);
    font-weight: 600;
}

/* PULSANTI ASP.NET CLASSICI */
input[type="button"],
input[type="submit"],
input[type="reset"] {
    background-color: var(--rosso-ferrari);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
}

    input[type="button"]:hover,
    input[type="submit"]:hover,
    input[type="reset"]:hover {
        background-color: #b40000;
    }


.text-rosso {
    color: var(--rosso-ferrari) !important;
}

.table th {
    color: var(--GrigioSfumato);
    border-top: 1px solid var(--rosso-ferrari);
}

.table td {
    color: var(--GrigioSfumato);
}

.mini-table th, td {
    padding: 0.05rem!important;
}
/* Dropdown leggibili */
.form-control,
select,
.outline-red {
    background-color: var(--sfondo-bianco);
    color: #000 !important;
    border: 1px solid var(--rosso-ferrari);
}

.apparence-none {
    appearance: none;
}

    .form-control:focus,
    select:focus {
        outline: none;
        border-color: var(--rosso-ferrari);
        box-shadow: 0 0 5px rgba(255, 40, 0, 0.5);
    }

/* Bottoni coerenti */
.outline-red {
    border-color: var(--rosso-ferrari) !important;
    color: var(--rosso-ferrari) !important;
    background-color: var(--sfondo-bianco);
    transition: all 0.3s ease;
}

    .outline-red:hover {
        background-color: var(--rosso-ferrari) !important;
        color: #fff !important;
    }

/* Migliora spaziatura tra griglie */
.table + .table {
    margin-top: 20px;
}

.checkbox-rossa input[type="checkbox"] {
    accent-color: var(--rosso-ferrari) !important;
}

    .checkbox-rossa input[type="checkbox"]:disabled {
        accent-color: var(--rosso-ferrari) !important;
        opacity: 0.7; /* facoltativo, per far capire che è disabilitata */
        cursor: not-allowed;
    }

/* Sticky header GridView */
.gridview-container {
    max-height: 360px;
    overflow-y: auto;
}

.gridview th {
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 2;
}

/* Overlay landscape warning (mobile portrait only) */
@media screen and (orientation: portrait) and (max-width: 992px) {
    .rotate-overlay {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        font-size: 1.2rem;
        font-weight: bold;
        color: black;
        background: #ffffff;
        position: fixed;
        inset: 0;
        z-index: 9999;
        padding: 20px;
    }

    .main-content {
        display: none;
    }
}

.btn-small {
    padding: .5rem .2rem;
    font-size: .85rem;
}
.grid-extrasmall td, th {
    padding: 2px 2px!important; /* verticale 2px, orizzontale 4px */
}

.Grigio {
    color: var(--GrigioSfumato)
}