/* =========================================
   VARIABLES & DESIGN SYSTEM
   ========================================= */
:root {
    /* Colors - Italian Inspired Palette */
    --primary-color: #008C45; /* Italian Green */
    --primary-light: #33a36a;
    --primary-dark: #006632;
    
    --secondary-color: #CD212A; /* Italian Red */
    --secondary-light: #d74d54;
    --secondary-dark: #9f1a20;
    
    --accent-color: #F4F5F0; /* Off White / Crema */
    --dark-color: #232b2b; /* Almost Black */
    --light-color: #f8f9fa;
    --text-color: #333333;
    --text-muted: #6c757d;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    --gradient-overlay: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8));

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* =========================================
   RESET & BASE STYLES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--accent-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-normal);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

strong {
    font-weight: 600;
}

em {
    font-style: italic;
}

/* =========================================
   UTILITIES
   ========================================= */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-xl) 0;
}

.text-center { text-align: center; }
.text-white { color: #ffffff !important; }
.text-primary { color: var(--primary-color) !important; }
.text-dark { color: var(--dark-color) !important; }

.bg-light { background-color: var(--light-color) !important; }
.bg-dark { background-color: var(--dark-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.bg-green { background-color: var(--primary-color) !important; }
.bg-red { background-color: var(--secondary-color) !important; }
.bg-white { background-color: #ffffff !important; }

.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.mt-4 { margin-top: 1.5rem !important; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.border { border: 1px solid #e2e8f0; }
.border-primary { border-color: var(--primary-color) !important; }

.lead {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

.hidden {
    display: none !important;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
    text-align: center;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 140, 69, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 140, 69, 0.4);
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

.btn-outline {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-outline:hover {
    background: white;
    color: var(--primary-color);
}

.btn-outline-nav {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.5rem 1rem;
}

.btn-outline-nav:hover {
    background: var(--primary-color);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

/* =========================================
   NAVIGATION
   ========================================= */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all var(--transition-normal);
    background: transparent;
    padding: 1.5rem 0;
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    padding: 0.75rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

#navbar.scrolled .logo {
    color: var(--dark-color);
}

.logo span {
    color: var(--primary-color);
    font-style: italic;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links li a {
    font-weight: 600;
    color: white;
    font-size: 0.95rem;
    position: relative;
}

#navbar.scrolled .nav-links li a:not(.btn) {
    color: var(--dark-color);
}

.nav-links li a:not(.btn)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width var(--transition-normal);
}

.nav-links li a:not(.btn):hover::after {
    width: 100%;
}

#navbar.scrolled .btn-outline-nav {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

#navbar.scrolled .btn-outline-nav:hover {
    background: var(--primary-color);
    color: white;
}

#navbar:not(.scrolled) .btn-outline-nav {
    color: white;
    border-color: white;
}
#navbar:not(.scrolled) .btn-outline-nav:hover {
    background: white;
    color: var(--primary-color);
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: white;
}

#navbar.scrolled .hamburger {
    color: var(--dark-color);
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('https://images.unsplash.com/photo-1523906834658-6e24ef2386f9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    color: white;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-overlay);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero h1 span {
    color: var(--primary-color);
    font-style: italic;
}

.hero .subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.custom-shape-divider-bottom-hero {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
    z-index: 2;
}

.custom-shape-divider-bottom-hero svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 70px;
}

.custom-shape-divider-bottom-hero .shape-fill {
    fill: var(--accent-color);
}

/* =========================================
   SECTION HEADERS
   ========================================= */
.section-header {
    margin-bottom: var(--spacing-lg);
}

.pre-title {
    display: block;
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-style: italic;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2.5rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.section-title span {
    color: var(--primary-color);
    position: relative;
}

/* =========================================
   ABOUT SECTION
   ========================================= */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image-container {
    position: relative;
}

.about-img {
    border-radius: var(--radius-lg);
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 4/5;
}

.experience-badge {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 5px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.experience-badge .number {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.experience-badge .text {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
}

.about-content p {
    margin-bottom: 1.5rem;
}

.features-list {
    margin-top: 2rem;
}

.features-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.features-list i {
    font-size: 1.25rem;
}

/* =========================================
   COURSES SECTION
   ========================================= */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.course-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.scale-up {
    transform: scale(1.05);
    z-index: 10;
}

.card-header {
    padding: 2.5rem 1.5rem;
    position: relative;
}

.popular-badge {
    position: absolute;
    top: 15px;
    right: -35px;
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 3rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    transform: rotate(45deg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.card-body {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.course-desc {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.course-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.course-features li:last-child {
    border-bottom: none;
}

.course-features i {
    color: var(--primary-color);
    font-size: 0.8rem;
}

/* =========================================
   CULTURE TRIVIA SECTION
   ========================================= */
.culture-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    opacity: 0.8;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
    opacity: 1;
}

.gallery-overlay h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.gallery-overlay p {
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-normal) 0.1s;
}

.gallery-item:hover .gallery-overlay p {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   QUIZ SECTION
   ========================================= */
.pattern-bg {
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

.quiz-container {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    padding: 3rem;
    max-width: 800px;
    margin: 0 auto;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width var(--transition-normal);
}

.question-count {
    font-size: 0.9rem;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#question-text {
    font-size: 1.5rem;
    line-height: 1.4;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-quiz {
    flex: 1;
    max-width: 200px;
    padding: 1rem;
    font-size: 1.1rem;
}

.v-btn {
    background: rgba(0, 140, 69, 0.2);
    border-color: var(--primary-color);
    color: white;
}
.v-btn:hover { background: var(--primary-color); }

.f-btn {
    background: rgba(205, 33, 42, 0.2);
    border-color: var(--secondary-color);
    color: white;
}
.f-btn:hover { background: var(--secondary-color); }

.feedback-msg {
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.feedback-msg.correct {
    background: rgba(0, 140, 69, 0.2);
    color: #4ade80;
    border: 1px solid var(--primary-color);
}

.feedback-msg.wrong {
    background: rgba(205, 33, 42, 0.2);
    color: #f87171;
    border: 1px solid var(--secondary-color);
}

.score-display {
    font-size: 3rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* =========================================
   CONTACT SECTION
   ========================================= */
.contact-card {
    display: flex;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.contact-info {
    flex: 1;
    padding: 4rem 3rem;
}

.contact-list li {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-list i {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
    color: rgba(255,255,255,0.8);
}

.contact-form-container {
    flex: 1.5;
    padding: 4rem 3rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
    background: #f8fafc;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 140, 69, 0.1);
}

textarea.form-control {
    resize: vertical;
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    padding: 2rem 0;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    margin: 0 0.5rem;
    transition: all var(--transition-fast);
}

.social-icons a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transition: opacity 1s ease;
}
.fade-in.appear {
    opacity: 1;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-in-up.appear {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.slide-in-left.appear {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.slide-in-right.appear {
    opacity: 1;
    transform: translateX(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 992px) {
    .about-grid, .contact-card {
        flex-direction: column;
    }
    .about-grid {
        grid-template-columns: 1fr;
    }
    .about-image-container {
        max-width: 500px;
        margin: 0 auto;
    }
    .hero h1 {
        font-size: 3rem;
    }
    .scale-up {
        transform: scale(1);
    }
    .contact-card.flex-wrap-mobile {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s ease;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    }
    .nav-links.active {
        right: 0;
    }
    .nav-links li a:not(.btn) {
        color: var(--dark-color) !important;
        font-size: 1.25rem;
    }
    .nav-links li a:not(.btn)::after {
        background-color: var(--primary-color);
    }
    #navbar:not(.scrolled) .btn-outline-nav {
        color: var(--primary-color);
        border-color: var(--primary-color);
    }
    .hamburger {
        display: block;
        z-index: 1001;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .hero-buttons {
        flex-direction: column;
    }
    .quiz-container {
        padding: 2rem 1.5rem;
    }
    .contact-info, .contact-form-container {
        padding: 2.5rem 1.5rem;
    }
    .section {
        padding: var(--spacing-lg) 0;
    }
}
