:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-bg: #0f0f23;
    --card-bg: rgba(255, 255, 255, 0.1);
    --card-hover: rgba(255, 255, 255, 0.2);
    --text-light: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --shadow-light: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 20px 60px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header styles - aggiornate per compatibilità con h1 e h2 esistenti */
h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

h2 {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto 4rem;
    line-height: 1.6;
    text-align: center;
    font-style: italic;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Course Container - aggiornato per compatibilità */
.course-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

.course {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-light);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
    display: block;
    margin: 0; /* Reset existing margin */
    font-size: 1rem; /* Reset existing font-size */
}

.course::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s;
}

.course:hover::before {
    left: 100%;
}

.course:hover {
    transform: translateY(-10px) scale(1.02);
    background: var(--card-hover);
    box-shadow: var(--shadow-heavy);
    border-color: rgba(255, 255, 255, 0.3);
    border-bottom: none; /* Reset existing hover effect */
}

.course-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    color: var(--text-light);
}

.course-class {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

.course-class::before {
    content: '{ ';
    color: #4facfe;
    font-weight: 500;
}

.course-class::after {
    content: ' }';
    color: #4facfe;
    font-weight: 500;
}

/* Links */
a {
    text-decoration: none;
    color: inherit;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-light);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
}

.fab:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: var(--shadow-heavy);
}

.fab::before {
    content: '↑';
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Link Risorse - mantieni compatibilità */
.link_risorse {
    width: 100vw;
    text-align: center;
    margin-top: 2rem;
}

.link_risorse a {
    text-decoration: none;
    color: white;
    text-align: center;
    padding: 1rem 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    transition: all 0.3s ease;
    display: inline-block;
}

.link_risorse a:hover {
    cursor: pointer;
    background: var(--card-hover);
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .course-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .course {
        padding: 1.5rem;
    }
    
    h1 {
        margin-bottom: 1rem;
    }
    
    h2 {
        margin-bottom: 3rem;
    }
}

@media (max-width: 480px) {
    .fab {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
    }
    
    .course-container {
        padding: 0 0.5rem;
    }
}

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

.course:nth-child(1) { animation-delay: 0.1s; }
.course:nth-child(2) { animation-delay: 0.2s; }
.course:nth-child(3) { animation-delay: 0.3s; }
.course:nth-child(4) { animation-delay: 0.4s; }
.course:nth-child(5) { animation-delay: 0.5s; }
.course:nth-child(6) { animation-delay: 0.6s; }