/* Global Styles */
* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100%;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    display: flex;
    flex-direction: column;
    position: relative;
}

main.container {
    flex: 1; /* Espande il contenitore principale per occupare lo spazio disponibile */
    max-width: 100%;
    overflow-x: hidden;
}

/* Previeni overflow orizzontale globale */
.container, .container-fluid, section, div {
    max-width: 100%;
}

.row {
    margin-left: 0;
    margin-right: 0;
}

img {
    max-width: 100%;
    height: auto;
}

.footer {
    background-color: #f8f9fa;
    color: #6c757d;
    font-size: 0.9rem;
}

.footer h5 {
    color: #343a40;
    font-size: 1.1rem;
}

.footer a {
    color: #6c757d;
    transition: color 0.3s;
}

.footer a:hover {
    color: #007bff;
}

.footer-logo {
    width: 48px;
    height: auto;
    display: block;
}

/* Card Styles */
.card {
    background-color: #fff;
    border-radius: 10px;
    color: #333;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
}

/* Button Styles */
.btn-primary {
    background: #3498db;
    border: none;
}

.btn-primary:hover {
    background: #2980b9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
}

.btn-success {
    background: #2ecc71;
    border: none;
}

.btn-success:hover {
    background: #27ae60;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
}

.btn-warning {
    background-color: #f39c12;
    border: none;
    font-weight: bold;
}

.btn-warning:hover {
    background-color: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
}

.btn-danger {
    background-color: #e74c3c;
    border: none;
}

.btn-danger:hover {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
}

/* Link Styles */
a {
    color: #3498db;
    text-decoration: none;
}

a:hover,
a:focus,
a:active {
    text-decoration: none;
    /* color: #2980b9; */
}

/* Navbar Styles */
.navbar {
    border-radius: 15px;
    background-color: #fff;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
}

.navbar-logo {
    width: 48px;
    height: auto;
    display: block;
}

.navbar .navbar-brand .circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f39c12;
}

.navbar .nav-link {
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
    color: #333;
}

.brand-name {
    font-weight: 700;
    color: #1f1f1f;
}


.navbar .nav-link:hover,
.navbar .nav-link:focus,
.navbar .nav-link:active {
    text-decoration: none;
    color: #000;
}

/* Effetto Hover per Corsi e About */
.navbar .nav-link.text-dark {
    background-color: transparent;
    color: #333;
    border-radius: 15px;
    padding: 10px 20px;
    transition: all 0.3s ease-in-out;
}

.navbar .nav-link.text-dark:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

/* Stato Attivo per Corsi e About */
.navbar .nav-link.active {
    background-color: rgba(52, 152, 219, 0.2);
    color: #3498db;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

/* Utility Classes */
.navbar .btn-primary {
    background-color: #3498db;
    border: none;
    font-weight: bold;
}

.navbar .btn-primary:hover {
    background-color: rgba(0, 93, 155, 0.601);
    color: #3498db;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
}

.navbar .btn-warning {
    background-color: #f39c12;
    border: none;
}

.navbar .btn-warning:hover {
    background-color: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
}

.navbar .btn-danger {
    background-color: #e74c3c;
    border: none;
}

.navbar .btn-danger:hover {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
}

.navbar .nav-link.text-dark:hover {
    color: #333;
    text-decoration: none;
}

.navbar .dropdown-menu {
    min-width: 200px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar .dropdown-menu .dropdown-item {
    font-size: 0.9rem;
    padding: 10px 15px;
    transition: background-color 0.3s, color 0.3s;
}

.navbar .dropdown-menu .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.alert {
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Stile Offcanvas */
.offcanvas {
    background-color: #f8f9fa; /* Sfondo neutro */
}

.offcanvas-header {
    padding: 1.5rem;
    border-bottom: 1px solid #ddd; /* Bordo sottile per separazione */
    background-color: transparent; /* Rimozione sfondo blu */
}

.offcanvas-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333; /* Testo scuro */
}

.offcanvas-body {
    padding: 1.5rem;
}

.offcanvas-body a {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    border-radius: 5px; /* Angoli arrotondati */
    transition: all 0.3s ease-in-out;
}

/* Bottone personalizzato */
.custom-btn {
    border: 1px solid #007bff; /* Bordo blu */
    background-color: transparent; /* Sfondo trasparente */
    color: #007bff; /* Testo blu */
}

.custom-btn:hover {
    background-color: #007bff; /* Sfondo blu in hover */
    color: #fff; /* Testo bianco in hover */
    border-color: #007bff; /* Mantiene il colore del bordo */
}

/* Bottone Logout personalizzato */
.custom-btn-danger {
    border: 1px solid #e74c3c; /* Bordo rosso */
    background-color: transparent; /* Sfondo trasparente */
    color: #e74c3c; /* Testo rosso */
}

.custom-btn-danger:hover {
    background-color: #e74c3c; /* Sfondo rosso in hover */
    color: #fff; /* Testo bianco in hover */
    border-color: #e74c3c; /* Mantiene il colore del bordo */
}



/* ========================================
   FIX OVERFLOW MOBILE - Previene spazio bianco laterale
   ======================================== */

/* Previeni overflow orizzontale senza rompere il layout */
body {
    overflow-x: hidden;
}

/* Le immagini non devono eccedere il container */
img {
    max-width: 100%;
    height: auto;
}

/* Previeni overflow su elementi larghi */
.row {
    max-width: 100%;
}

/* ========================================
   FIX AOS - Assicura visibilità elementi
   ======================================== */

/* Fallback: assicura che gli elementi con data-aos siano visibili */
[data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* AOS inizializzato: abilita animazioni */
html:not(.no-js) [data-aos] {
    opacity: 1;
}

/* Quando AOS è pronto, riabilita le transizioni */
[data-aos].aos-animate {
    opacity: 1 !important;
}
