* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

.theme-transition * {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}
@media (prefers-color-scheme: dark) {
    :root {
    --bg-color: #121212;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-color: #ffffff;
    --text-secondary: #cccccc;
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --bg-color-rgb: 18, 18, 18;
    --bg-secondary-rgb: 26, 26, 26;
}
}
@media (prefers-color-scheme: light) {
    :root {
    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-color: #212529;
    --text-secondary: #6c757d;
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --bg-color-rgb: 255, 255, 255;
    --bg-secondary-rgb: 248, 249, 250;
}
}

.theme-transition,
.theme-transition *,
.theme-transition *:before,
.theme-transition *:after {
    transition: all 0.3s ease !important;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: var(--bg-secondary);
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 5px var(--shadow-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transform: translateZ(0);
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: padding, background-color;
    backface-visibility: hidden;
}

.header-shrink {
    padding: 0.8rem 2rem;
    background-color: rgba(var(--bg-secondary-rgb), 0.98);
    backdrop-filter: blur(10px);
    transform: translateZ(0);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 95%;  /* Increased from 90% */
    margin: 0 auto;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

nav h1, nav a {
    transform: translateZ(0);
    backface-visibility: hidden;
    transition: font-size 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: font-size;
}

.header-shrink nav h1 {
    font-size: 1.5rem;
}

.header-shrink nav a {
    font-size: 0.9rem;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--primary-color);
}


main {
    margin-top: 8rem; /* Increased from 6rem to give more space */
    flex: 1;
    max-width: 1200px;
    padding: 0 1rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-align: center;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto; /* Changed from 2rem auto */
    padding: 2.5rem;
    background-color: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow-color);
    transform: translateY(20px);
    opacity: 0;
    animation: fadeUp 0.6s ease-out forwards;
}

/* Apply theme colors to contact-specific elements */
.contact-form input,
.contact-form textarea {
    background-color: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--bg-tertiary);
}

@keyframes fadeUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.form-group {
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideIn 0.5s ease-out forwards;
}

.form-group:nth-child(1) { animation-delay: 0.2s; }
.form-group:nth-child(2) { animation-delay: 0.3s; }
.form-group:nth-child(3) { animation-delay: 0.4s; }
.form-group:nth-child(4) { animation-delay: 0.5s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

input, textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--bg-tertiary);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color), 0.1);
}

input:focus + label, textarea:focus + label {
    color: var(--primary-color);
}

.btn {
    width: 100%;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.6s forwards;
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-icon {
    transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
    transform: translateX(5px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

footer {
    background-color: var(--bg-secondary);
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
}

/* Dropdown styles */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-secondary);
    min-width: 200px;
    box-shadow: 0 2px 5px var(--shadow-color);
    border-radius: 5px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease-in-out;
    padding: 0.5rem 0;
}

.dropdown.active .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content li {
    display: block;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease-in-out;
}

.dropdown.active .dropdown-content li {
    opacity: 1;
    transform: translateX(0);
}

.dropdown-content a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    display: block;
    width: 100%;
    transition: background-color 0.3s;
}

.dropdown-content a:hover {
    background-color: var(--bg-tertiary);
}

.arrow {
    display: inline-block;
    transition: transform 0.3s ease;
    margin-left: 4px;
}

.dropdown.active .arrow {
    transform: rotate(180deg);
}

/* Tags styles */
.tags {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.tag {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
}

/* Hide filtered courses */
.corso-card.hidden {
    display: none;
}

/* Animation delays for dropdown items */
.dropdown:hover .dropdown-content li:nth-child(1) { transition-delay: 0.1s; }
.dropdown:hover .dropdown-content li:nth-child(2) { transition-delay: 0.15s; }
.dropdown:hover .dropdown-content li:nth-child(3) { transition-delay: 0.2s; }
.dropdown:hover .dropdown-content li:nth-child(4) { transition-delay: 0.25s; }
.dropdown:hover .dropdown-content li:nth-child(5) { transition-delay: 0.3s; }
.dropdown:hover .dropdown-content li:nth-child(6) { transition-delay: 0.35s; }

/* Stili per il dropdown menu */
.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-secondary);
    min-width: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown.active .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content li {
    margin: 0;
    padding: 0;
}

.dropdown-content a {
    padding: 12px 20px;
    display: block;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-content a:hover {
    background-color: var(--bg-tertiary);
}

/* Animazione della freccia */
.arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.dropdown.active .arrow {
    transform: rotate(180deg);
}

/* Bordi arrotondati per primo e ultimo elemento */
.dropdown-content li:first-child a {
    border-radius: 8px 8px 0 0;
}

.dropdown-content li:last-child a {
    border-radius: 0 0 8px 8px;
}

/* Preloader styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-in-out;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid var(--bg-secondary);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hide preloader when page is loaded */
#preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Prevent scroll while loading */
body.loading {
    overflow: hidden;
}

/* Base animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Apply animations to elements */
.hero {
    animation: slideInUp 0.8s ease-out forwards;
}

.corso-card {
    opacity: 0;
    animation: scaleUp 0.6s ease-out forwards;
}

.corso-card:nth-child(1) { animation-delay: 0.1s; }
.corso-card:nth-child(2) { animation-delay: 0.2s; }
.corso-card:nth-child(3) { animation-delay: 0.3s; }
.corso-card:nth-child(4) { animation-delay: 0.4s; }
.corso-card:nth-child(5) { animation-delay: 0.5s; }
.corso-card:nth-child(6) { animation-delay: 0.6s; }

nav h1 {
    animation: slideInLeft 0.6s ease-out forwards;
}

nav ul {
    animation: slideInRight 0.6s ease-out forwards;
}

.contact-form {
    animation: scaleUp 0.8s ease-out forwards;
}

/* Hover animations */
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.corso-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.corso-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Smooth page transitions */
body {
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.2s forwards;
}

/* Input field animations */
input, textarea {
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.1);
}

/* Tag animations */
.tag {
    transition: all 0.3s ease;
}

.tag:hover {
    transform: translateY(-2px);
    background-color: #007bff;
    color: white;
}

/* Expanded course content animation */
.corso-expanded {
    backdrop-filter: blur(0);
    transition: backdrop-filter 0.3s ease;
}

.corso-expanded.active {
    backdrop-filter: blur(5px);
}

.expanded-content {
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.corso-expanded.active .expanded-content {
    transform: scale(1);
    opacity: 1;
}

/* Dropdown animation refinements */
.dropdown-content {
    transform-origin: top;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-content li {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Footer animation */
footer {
    animation: slideInUp 0.6s ease-out forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

/* Add to all CSS files */
.corso-card, .hero, .contact-form, .recensione-card, .faq-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Apply theme colors to contact-specific elements */
.contact-info {
    color: var(--text-secondary);
}

/* Theme toggle button styles */
.theme-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
    transition: background-color 0.3s;
}

.theme-toggle:hover {
    background-color: var(--bg-tertiary);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-color);
    transition: transform 0.3s ease;
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: none;
}

.message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    animation: slideIn 0.3s ease-out;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Add these new styles after your existing CSS */

.info-sections {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

.info-card {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px var(--shadow-color);
    transform: translateY(20px);
    opacity: 0;
    animation: fadeUp 0.6s ease-out forwards;
}

.info-card:nth-child(1) { animation-delay: 0.2s; }
.info-card:nth-child(2) { animation-delay: 0.4s; }
.info-card:nth-child(3) { animation-delay: 0.6s; }

.info-card h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
    text-align: left;
}

.info-card p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.team-member {
    color: var(--primary-color);
    font-weight: 500;
}

.info-card ul {
    list-style-position: outside;  /* Changed from inside */
    margin-bottom: 1rem;
    padding-left: 2rem;  /* Added padding for the bullets */
}

.info-card ul li {
    margin-bottom: 0.8rem;
    padding-left: 0.5rem;  /* Reduced padding */
    line-height: 1.5;  /* Added for better readability */
}

.request-steps {
    display: grid;
    gap: 2rem;
    margin-top: 1.5rem;
}

.step {
    position: relative;
    padding-left: 3rem;
}

.step-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.step ul {
    list-style-position: outside;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.step ul li {
    padding-left: 0.5rem;
    margin-bottom: 0.5rem;
}

.step a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.step a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .info-card {
        padding: 1.5rem;
    }
    
    .request-steps {
        gap: 1.5rem;
    }
}