@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

/* ==========================================================================
   1. VARIABILI GLOBALI E RESET DI BASE
   ========================================================================== */
:root {
    --primary: #D1184F;
    --primary-dark: #B3103F;
    --primary-light: #E13869;
    --dark: #333333;
    --gray: #6C757D;
    --light: #F8F9FA;
    --gray-light: #E9ECEF;
    --navbar-height: 70px;
    --primary-rgb: 209, 24, 79;
    
    /* Override Bootstrap variables */
    --bs-primary: #D1184F !important;
    --bs-primary-rgb: 209, 24, 79 !important;
    --bs-secondary: #6C757D !important;
    --bs-success: #198754 !important;
    --bs-info: #0dcaf0 !important;
    --bs-warning: #ffc107 !important;
    --bs-danger: #dc3545 !important;
    --bs-light: #F8F9FA !important;
    --bs-dark: #333333 !important;
    --bs-gray: #6C757D !important;
    --bs-gray-100: #F8F9FA !important;
    --bs-gray-200: #E9ECEF !important;
    --bs-gray-300: #dee2e6 !important;
    --bs-gray-600: #6C757D !important;
    --bs-gray-700: #495057 !important;
    --bs-gray-800: #343a40 !important;
    --bs-gray-900: #212529 !important;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--dark);
    line-height: 1.6;
    font-size: 0.95rem;
    font-weight: 400;
    padding-top: var(--navbar-height);
    margin: 0;
    background-color: #ffffff;
    overflow-x: hidden;
}

/* ==========================================================================
   2. NAVBAR
   ========================================================================== */
.navbar {
    background-color: white !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--dark) !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    transition: color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    color: var(--dark) !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active {
    color: var(--primary) !important;
}

.navbar-nav .nav-link.active {
    font-weight: 600;
}

/* Dropdown Menu Navbar */
.dropdown-menu {
    border-radius: 0 !important;
    border: 1px solid var(--gray-light) !important;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    margin-top: 0.125rem;
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-weight: 400;
    font-size: 0.9rem;
    transition: background-color 0.3s ease, color 0.3s ease;
    color: var(--dark);
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-menu .dropdown-item.active {
    background-color: var(--primary) !important;
    color: white !important;
}

.dropdown-toggle::after {
    margin-left: 0.5em;
}

@media (min-width: 992px) {
    .navbar-nav .nav-item.dropdown:hover > .dropdown-menu {
        display: block;
    }
}

/* Stili per navbar collassata (mobile) */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: white;
        margin-top: 0.5rem;
        border-top: 1px solid var(--gray-light);
        box-shadow: 0 5px 10px rgba(0,0,0,0.05);
        padding-bottom: 0.5rem;
    }
    .navbar-nav { width: 100%; }
    .navbar-nav .nav-item { width: 100%; border-bottom: 1px solid var(--gray-light); }
    .navbar-nav .nav-item:last-child { border-bottom: none; }
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        margin: 0;
        width: 100%;
    }
    .navbar-nav .dropdown-menu {
        background-color: var(--light) !important;
        box-shadow: none !important;
        border: none !important;
        padding-left: 1rem !important;
        width: 100% !important;
        margin-top: 0 !important;
    }
    .navbar-nav .dropdown-item {
        color: var(--dark) !important;
        padding: 0.6rem 1rem !important;
        border-bottom: 1px solid var(--gray-light) !important;
    }
    .navbar-nav .dropdown-item:last-child { border-bottom: none !important; }
    .navbar-nav .dropdown-item:hover,
    .navbar-nav .dropdown-item:focus {
        background-color: var(--gray-light) !important;
        color: var(--primary) !important;
    }
    .navbar-nav .dropdown-toggle::after {
        display: inline-block !important;
        float: right;
        margin-top: 0.25em;
    }
}


/* ==========================================================================
   3. BOTTONI
   ========================================================================== */
.btn {
    border-radius: 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.65rem 1.35rem;
    font-size: 0.85rem;
    border-width: 1px;
}

.btn-primary:not(.blue-form .btn-primary) {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}
.btn-primary:not(.blue-form .btn-primary):hover,
.btn-primary:not(.blue-form .btn-primary):focus {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    background-color: transparent;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.2);
}

.btn-light {
    background-color: white !important;
    border-color: var(--gray-light) !important;
    color: var(--primary) !important;
}
.btn-light:hover,
.btn-light:focus {
    background-color: var(--light) !important;
    border-color: var(--gray) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* ==========================================================================
   4. SEZIONI GENERICHE (Layout, Hero, Header Pagina, CTA, Stats)
   ========================================================================== */
.section {
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}
.section.bg-light { background-color: var(--light); }
.section.bg-primary { background-color: var(--primary); color: white; }

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}
.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: inherit;
}
.section-subtitle {
    font-size: 1.1rem;
    color: var(--gray);
    max-width: 700px;
    margin: 0 auto 2rem auto;
    line-height: 1.6;
}
.section.bg-primary .section-title,
.section.bg-primary .section-subtitle {
    color: white;
}
.section.bg-primary .section-subtitle {
    opacity: 0.9;
}

.hero, .page-header, .cta-section {
    background-color: var(--primary) !important;
    color: white;
    position: relative;
}
.hero { padding: 5rem 0; }
.page-header { padding: 3rem 0; }
.cta-section { padding: 4rem 0; text-align: center; }

.hero h1, .page-title, .cta-title {
    font-weight: 600;
    position: relative;
    z-index: 2;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 1.25rem; line-height: 1.3; }
.page-title { font-size: 2.5rem; margin-bottom: 1rem; }
.cta-title { font-size: 2rem; margin-bottom: 1rem; }

.hero p, .page-subtitle, .cta-text {
    opacity: 0.9;
    position: relative;
    z-index: 2;
    line-height: 1.7;
}
.hero p { font-size: 1.1rem; margin-bottom: 2rem; }
.page-subtitle { font-size: 1.2rem; }
.cta-text { font-size: 1.1rem; margin-bottom: 2rem; }

.hero-buttons, .hero-image { position: relative; z-index: 2; }

.diagonal-stripes {
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.07),
        rgba(255, 255, 255, 0.07) 20px,
        transparent 20px,
        transparent 40px
    );
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60%;
    z-index: 1;
    pointer-events: none;
}

/* Applica le stripes solo dove serve */
.hero .diagonal-stripes, 
.page-header .diagonal-stripes, 
.cta-section .diagonal-stripes {
    display: block;
}


/* ==========================================================================
   5. FEATURE CARDS (sezione "Servizi Principali")
   ========================================================================== */
.feature-card {
    background-color: white;
    border-radius: 8px !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.feature-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    line-height: 1;
}
.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark);
}
.feature-text {
    font-size: 0.9rem;
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}
.feature-card .btn {
    margin-top: auto;
}

/* ==========================================================================
   6. SEZIONE CAROUSEL RIMOSSA
   ========================================================================== */
/*
   Gli stili per #promoCarousel sono stati rimossi da questo file globale
   per evitare conflitti con Swiper.js.
   Gli stili necessari per il nuovo carosello Swiper sono ora definiti
   direttamente nel file Blade che lo utilizza (es. home.blade.php)
   usando lo stack @push('styles').
*/

/* ==========================================================================
   7. STATS SECTION
   ========================================================================== */
.stats-section {
    padding: 4rem 0;
    background-color: var(--primary) !important;
}
.stats-section .stat-card {
    background-color: white !important;
    color: var(--dark) !important;
    border-radius: 8px !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 2.5rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 200px;
}

.stats-section .stat-number {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--primary) !important;
    margin-bottom: 0.75rem;
}

.stats-section .stat-text {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray) !important;
    line-height: 1.5;
}


/* ==========================================================================
   8. MODALI (es. YouTube)
   ========================================================================== */
.modal .modal-dialog {
    max-width: 800px;
    width: 90%;
    margin: 3rem auto;
}
.modal .modal-content {
    border-radius: 8px !important;
}

/* Stili specifici per il modale video */
#youtubeModal .modal-content {
    background: black !important;
    border: none !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5) !important;
}
#youtubeModal .modal-header {
    border: none !important;
    padding: 0.75rem 1rem !important;
    position: absolute;
    top: 0px; right: 0px;
    z-index: 10;
}
#youtubeModal .btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat !important;
    opacity: 0.8 !important;
    padding: 0.5rem !important;
}
#youtubeModal .btn-close:hover { opacity: 1 !important; }

#youtubeModal .modal-body {
    padding: 0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

/* ==========================================================================
   9. FOOTER
   ========================================================================== */
footer {
    background-color: #333;
    color: rgba(255,255,255,0.7);
    padding: 3.5rem 0 1.5rem;
    font-size: 0.9rem;
}
.footer-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: white;
}
.footer-contact {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    line-height: 1.6;
}
.footer-contact i {
    margin-right: 0.85rem;
    opacity: 0.8;
    font-size: 1.1em;
    margin-top: 0.2em;
    color: var(--primary-light);
}
.footer-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    display: block;
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}
.footer-link:hover { color: white; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 1.5rem;
    margin-top: 2.5rem;
    opacity: 0.8;
    font-size: 0.85rem;
    text-align: center;
}

/* ==========================================================================
   10. RESPONSIVE
   ========================================================================== */
@media (max-width: 991.98px) { /* Tablet */
    .section { padding: 3rem 0; }
    .hero { padding: 4rem 0; }
    .hero h1 { font-size: 1.9rem; }
    .page-title { font-size: 2.1rem; }
    .section-title { font-size: 1.8rem; }
    .cta-title { font-size: 1.8rem; }

    .stats-section .stat-card {
        min-height: 180px;
        padding: 2rem 1rem;
    }
    .stats-section .stat-number {
        font-size: 2.25rem;
    }
}

@media (max-width: 767.98px) { /* Mobile */
    body { padding-top: calc(var(--navbar-height) - 10px); }
    .section { padding: 2.5rem 0; }
    .hero { padding: 3rem 0; }
    .hero h1 { font-size: 1.7rem; }
    .hero p { font-size: 1rem; }
    .page-title { font-size: 1.8rem; }
    .section-title { font-size: 1.6rem; }
    .cta-title { font-size: 1.7rem; }
    .section-subtitle { font-size: 1rem; }

    .stats-section .row > div[class*="col-"] {
        margin-bottom: 1.5rem;
    }
    .stats-section .row > div[class*="col-"]:last-child {
        margin-bottom: 0;
    }
    .stats-section .stat-card {
        min-height: 160px;
        padding: 1.5rem;
    }
    .stats-section .stat-number {
        font-size: 2rem;
    }
    .stats-section .stat-text {
        font-size: 0.8rem;
    }

    .footer-title { text-align: center; }
    .footer-contact { justify-content: center; }
    .footer .col-md-4 { margin-bottom: 2rem; }
    .footer .col-md-4:last-child { margin-bottom: 0; }
}

@media (max-width: 575.98px) { /* Mobile Piccolo */
    body {
        font-size: 0.9rem;
    }
    .section { padding: 2rem 0; }
    .hero h1 { font-size: 1.5rem; }
    .section-title { font-size: 1.4rem; }
    .cta-title { font-size: 1.5rem; }

    .modal .modal-dialog {
        width: calc(100% - 1rem);
        margin: 0.5rem auto;
    }
}

/* ==========================================================================
   11. FORM
   ========================================================================== */
   /* Form Section Styles */
.content-section {
    padding: 4rem 0;
}

.content-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1.5rem;
}

.content-text {
    color: var(--gray);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.content-text.highlight {
    background-color: #fff3cd;
    padding: 1rem;
    border-left: 4px solid var(--primary);
    margin: 1.5rem 0;
}

.features-list {
    list-style: none;
    padding: 0;
}

.features-list li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 2rem;
}

.features-list li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.custom-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: none;
}

.custom-card .card-header {
    border-radius: 8px 8px 0 0 !important;
    border-bottom: none;
}

.custom-card .card-body {
    padding: 2rem;
}

/* ==========================================================================
   COURSE PAGES STYLES - Override Bootstrap completely
   ========================================================================== */

/* Bootstrap button overrides - Maximum priority */
.btn-primary {
    --bs-btn-color: #fff !important;
    --bs-btn-bg: #D1184F !important;
    --bs-btn-border-color: #D1184F !important;
    --bs-btn-hover-color: #fff !important;
    --bs-btn-hover-bg: #B3103F !important;
    --bs-btn-hover-border-color: #B3103F !important;
    --bs-btn-focus-shadow-rgb: 209, 24, 79 !important;
    --bs-btn-active-color: #fff !important;
    --bs-btn-active-bg: #B3103F !important;
    --bs-btn-active-border-color: #B3103F !important;
    background-color: #D1184F !important;
    border-color: #D1184F !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #B3103F !important;
    border-color: #B3103F !important;
}

/* Bootstrap badge overrides */
.badge.bg-primary {
    background-color: #D1184F !important;
}

.badge-primary {
    background-color: #D1184F !important;
}

/* Course page specific styles */
.filters-container {
    border: 1px solid #E9ECEF !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}

.filters-container .form-label {
    color: var(--dark) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.filters-container .form-select {
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--dark) !important;
    background-color: #fff !important;
    transition: all 0.3s ease !important;
}

.filters-container .form-select:focus {
    border-color: #D1184F !important;
    box-shadow: 0 0 0 0.2rem rgba(209, 24, 79, 0.25) !important;
}

.results-counter .badge {
    padding: 8px 16px !important;
    font-weight: 500 !important;
}

.ambito-title,
.tipologia-title {
    color: var(--dark) !important;
    font-weight: 600 !important;
    border-bottom: 2px solid #D1184F !important;
    padding-bottom: 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.course-card {
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    background: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06) !important;
}

.course-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
    border-color: #D1184F !important;
}

.course-image {
    position: relative !important;
    width: 100% !important;
    height: 180px !important;
    overflow: hidden !important;
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
}

.course-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.course-image-placeholder {
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 3rem !important;
    color: #6c757d !important;
}

.course-badges {
    position: absolute !important;
    top: 15px !important;
    left: 15px !important;
    right: 15px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.badge-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    align-items: flex-end !important;
}

.university-badge {
    background-color: rgba(209, 24, 79, 0.9) !important;
    color: white !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    backdrop-filter: blur(5px) !important;
}

.class-badge {
    background-color: rgba(108, 117, 125, 0.9) !important;
    color: white !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    backdrop-filter: blur(5px) !important;
}

.type-badge {
    font-size: 11px !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    color: white !important;
    backdrop-filter: blur(5px) !important;
}

.course-pricing {
    background: linear-gradient(135deg, #D1184F 0%, #B3103F 100%) !important;
    color: white !important;
    padding: 12px !important;
    border-radius: 8px !important;
    text-align: center !important;
    margin-top: auto !important;
}

.pricing-label {
    font-size: 12px !important;
    opacity: 0.9 !important;
    margin-bottom: 4px !important;
}

.pricing-amount {
    font-size: 16px !important;
    font-weight: 600 !important;
}

.course-body {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.course-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--dark) !important;
    margin-bottom: 12px !important;
    line-height: 1.4 !important;
    font-family: 'Montserrat', sans-serif !important;
}

.course-description {
    color: var(--gray) !important;
    font-size: 13px !important;
    margin-bottom: 15px !important;
    line-height: 1.5 !important;
}

.course-details {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.detail-item {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 13px !important;
    color: #666 !important;
}

.detail-item i {
    color: #D1184F !important;
    width: 16px !important;
    text-align: center !important;
}

.course-actions {
    margin-top: auto !important;
    padding-top: 15px !important;
}

.feature-card {
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    height: 100% !important;
    transition: transform 0.3s, box-shadow 0.3s !important;
}

.feature-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.feature-icon {
    font-size: 3rem !important;
    color: #D1184F !important;
}

.section-title {
    color: var(--dark) !important;
    margin-bottom: 15px !important;
}

.section-subtitle {
    color: var(--gray) !important;
    margin-bottom: 30px !important;
}

.ambito-section.hidden,
.tipologia-section.hidden {
    display: none !important;
}
   

