/* Animazioni generali */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes neonGlow {
    0% { text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color), 0 0 30px var(--primary-color); }
    50% { text-shadow: 0 0 15px var(--primary-color), 0 0 25px var(--primary-color), 0 0 35px var(--primary-color); }
    100% { text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color), 0 0 30px var(--primary-color); }
}

@keyframes flicker {
    0% { opacity: 1; }
    10% { opacity: 0.8; }
    20% { opacity: 1; }
    30% { opacity: 0.6; }
    40% { opacity: 1; }
    50% { opacity: 0.9; }
    60% { opacity: 1; }
    70% { opacity: 0.7; }
    80% { opacity: 1; }
    90% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Animazione per il cursore personalizzato */
.cursor {
    transition: transform 0.1s ease, width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
}

.cursor-hover {
    width: 40px;
    height: 40px;
    border-color: var(--secondary-color);
    box-shadow: 0 0 15px var(--secondary-color);
    transform: translate(-50%, -50%) scale(1.5);
}

/* Animazione per il menu mobile */
.nav-links {
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.menu-toggle {
    transition: all 0.3s ease;
}

.menu-toggle.active .hamburger {
    background-color: transparent;
}

.menu-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

/* Animazione per le sezioni */
section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animazione per le timeline */
.timeline-item {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.timeline-item.right {
    transform: translateX(50px);
}

section.visible .timeline-item {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.2s;
}

section.visible .timeline-item:nth-child(2) {
    transition-delay: 0.4s;
}

section.visible .timeline-item:nth-child(3) {
    transition-delay: 0.6s;
}

/* Animazione per le skill cards */
.skill-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease, border 0.3s ease;
}

section.visible .skill-card {
    opacity: 1;
    transform: translateY(0);
}

section.visible .skill-card:nth-child(1) {
    transition-delay: 0.1s;
}

section.visible .skill-card:nth-child(2) {
    transition-delay: 0.2s;
}

section.visible .skill-card:nth-child(3) {
    transition-delay: 0.3s;
}

section.visible .skill-card:nth-child(4) {
    transition-delay: 0.4s;
}

/* Animazione per i progetti */
.project-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease, box-shadow 0.3s ease, border 0.3s ease;
}

section.visible .project-card {
    opacity: 1;
    transform: translateY(0);
}

section.visible .project-card:nth-child(1) {
    transition-delay: 0.2s;
}

section.visible .project-card:nth-child(2) {
    transition-delay: 0.4s;
}

/* Effetto neon lampeggiante */
.flicker {
    animation: flicker 0.5s linear;
}

/* Animazione per il form di contatto */
.contact-form .form-group {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

section.visible .contact-form .form-group {
    opacity: 1;
    transform: translateY(0);
}

section.visible .contact-form .form-group:nth-child(1) {
    transition-delay: 0.1s;
}

section.visible .contact-form .form-group:nth-child(2) {
    transition-delay: 0.2s;
}

section.visible .contact-form .form-group:nth-child(3) {
    transition-delay: 0.3s;
}

section.visible .contact-form .form-group:nth-child(4) {
    transition-delay: 0.4s;
}

/* Animazione per i messaggi di successo/errore */
.success-message, .error-message {
    padding: 10px;
    margin-top: 15px;
    border-radius: var(--border-radius);
    animation: fadeIn 0.5s ease;
}

.success-message {
    background-color: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.3);
    color: #00ff00;
}

.error-message {
    background-color: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #ff0000;
}

/* Media queries per responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: rgba(10, 10, 10, 0.95);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
    }
    
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }
    
    .nav-links li {
        margin: 15px 0;
    }
}