/* ============================================
   KIRIKU - L'ASILO ECOFRIENDLY
   Custom Styles
   ============================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Baloo 2', cursive;
}

/* ===== GLASSMORPHISM NAVBAR FULL-BODY ===== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* GLASSMORPHISM EFFECT - Fuso con Hero + GRADIENT FADE-OUT */
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.10) 60%,
        rgba(255, 255, 255, 0.02) 95%,
        rgba(255, 255, 255, 0) 100%
    );
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    
    /* SHADOW SUBTILE - NO BORDER */
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
    
    /* PADDING */
    padding: 1rem 2rem;
}

@media (max-width: 768px) {
    #navbar {
        padding: 0.75rem 1rem;
    }
}

/* Nav links color con contrast boost */
.nav-links a {
    color: #2D4A1E; /* Più scuro per contrasto su glass */
    font-weight: 700;
    font-size: 0.95rem;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, #7CA44C, #5F7C3B);
    border-radius: 3px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:hover {
    color: #7CA44C;
    background: rgba(124, 164, 76, 0.1);
    transform: translateY(-2px);
}

.nav-links a:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* NAVBAR SCROLLED STATE - Più opaco ma sempre con fade */
#navbar.scrolled {
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.28) 0%,
        rgba(255, 255, 255, 0.22) 60%,
        rgba(255, 255, 255, 0.08) 95%,
        rgba(255, 255, 255, 0) 100%
    );
    backdrop-filter: blur(50px) saturate(200%);
    -webkit-backdrop-filter: blur(50px) saturate(200%);
    box-shadow: 
        0 1px 0 rgba(255, 255, 255, 0.15) inset,
        0 8px 32px rgba(0, 0, 0, 0.08);
    padding: 0.75rem 2rem;
}

@media (max-width: 768px) {
    #navbar.scrolled {
        padding: 0.5rem 1rem;
    }
}

/* Mobile menu con glassmorphism */
#mobile-menu {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 255, 255, 0.90) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(124, 164, 76, 0.2);
    box-shadow: 
        0 8px 32px rgba(124, 164, 76, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

#mobile-menu a {
    color: #2D4A1E;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu a:hover {
    background: linear-gradient(135deg, 
        rgba(124, 164, 76, 0.15),
        rgba(124, 164, 76, 0.10)
    );
    color: #7CA44C;
    transform: translateX(5px);
}

/* ===== BURGER MENU GLASSMORPHISM MINIMALE ===== */
.mobile-menu-btn {
    /* Glass effect sottile */
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    /* Border sottile elegante */
    border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 12px !important;
    
    /* Shadow delicata */
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    
    /* Dimensioni eleganti */
    width: 44px;
    height: 44px;
    padding: 0 !important;
    
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    transform: scale(1.05);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

/* Linee hamburger eleganti */
.mobile-menu-btn svg {
    color: #2D4A1E;
    filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.5));
}

/* Smooth transition per icona */
.mobile-menu-btn svg circle,
.mobile-menu-btn svg path {
    transition: all 0.3s ease;
}

/* === HERO SECTION === */
.hero-section {
    position: relative;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* === BUTTONS === */
.cta-button {
    box-shadow: 0 5px 15px rgba(124, 164, 76, 0.3);
}

.cta-button:hover {
    box-shadow: 0 8px 20px rgba(124, 164, 76, 0.5);
}

/* === CARDS === */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

/* === GALLERY === */
.gallery-item {
    display: block;
    cursor: pointer;
}

.gallery-item img {
    transition: transform 0.3s ease;
}

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

/* Gallery Password Protection */
#gallery-password-overlay {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#gallery-password-form {
    animation: fadeInUp 0.6s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.animate-shake {
    animation: shake 0.5s ease;
}

/* === CLAIMS CARDS === */
.claim-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(124, 164, 76, 0.2);
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(124, 164, 76, 0.1);
    animation: fadeInUp 0.8s ease backwards;
}

.claim-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(124, 164, 76, 0.25);
    border-color: rgba(124, 164, 76, 0.5);
    background: rgba(255, 255, 255, 0.95);
}

.claim-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: all 0.4s ease;
}

.claim-card:hover .claim-icon {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

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

@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.animate-pulse-slow {
    animation: pulse-slow 3s ease-in-out infinite;
}

/* === PARTICLES CANVAS === */
#particles-canvas {
    pointer-events: none;
}

/* === TEAM SECTION - EDUCATRICI === */
.team-card {
    position: relative;
    height: 100%;
}

.team-card-inner {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.team-card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #7CA44C, #5F7C3B, #3E5E2C);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.team-card:hover .team-card-inner {
    transform: translateY(-12px);
    box-shadow: 0 20px 60px rgba(124, 164, 76, 0.25);
    border-color: #7CA44C;
}

.team-card:hover .team-card-inner::before {
    transform: scaleX(1);
}

/* Foto con anello decorativo */
.team-photo-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
    width: 160px;
    height: 160px;
}

.team-photo-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7CA44C, #5F7C3B, #FFB84D);
    animation: rotateRing 8s linear infinite;
    opacity: 0.8;
}

@keyframes rotateRing {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.team-photo {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #7CA44C, #5F7C3B);
    transition: transform 0.4s ease;
}

.team-card:hover .team-photo {
    transform: scale(1.05);
}

.team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.team-card:hover .team-photo img {
    transform: scale(1.1);
}

/* Badge decorativo */
.team-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #FFB84D, #FFA726);
    border-radius: 50%;
    border: 4px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Informazioni educatrice */
.team-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.team-name {
    font-family: 'Baloo 2', cursive;
    font-size: 1.75rem;
    font-weight: 700;
    color: #3E5E2C;
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.team-card:hover .team-name {
    color: #7CA44C;
}

.team-role {
    font-size: 1rem;
    font-weight: 600;
    color: #7CA44C;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.team-bio {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    flex: 1;
}

/* Certificazioni */
.team-certifications {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: auto;
}

.cert-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, #7CA44C, #5F7C3B);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(124, 164, 76, 0.3);
    transition: all 0.3s ease;
}

.cert-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 164, 76, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .team-card-inner {
        padding: 2rem 1.5rem;
    }
    
    .team-photo-wrapper {
        width: 130px;
        height: 130px;
    }
    
    .team-name {
        font-size: 1.5rem;
    }
}

/* === SVG BAMBINI ANIMATI === */
.child-jumping {
    animation: jumpAnimation 2s ease-in-out infinite;
    transform-origin: center bottom;
}

@keyframes jumpAnimation {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-30px);
    }
}

.ball-bounce {
    animation: ballBounce 1.5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes ballBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-40px);
    }
}

.child-running {
    animation: runningMotion 1s ease-in-out infinite;
}

@keyframes runningMotion {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    25% {
        transform: translateX(-5px) rotate(-2deg);
    }
    75% {
        transform: translateX(5px) rotate(2deg);
    }
}

.child-drawing {
    animation: drawingMotion 3s ease-in-out infinite;
}

@keyframes drawingMotion {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(-2deg);
    }
}

.butterfly {
    animation: butterflyFly 4s ease-in-out infinite;
}

@keyframes butterflyFly {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(30px, -20px);
    }
    50% {
        transform: translate(60px, 10px);
    }
    75% {
        transform: translate(30px, 30px);
    }
}

.tree-left,
.tree-right {
    animation: treeSwaying 4s ease-in-out infinite;
    transform-origin: bottom center;
}

@keyframes treeSwaying {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(2deg);
    }
}

.grass {
    animation: grassWave 3s ease-in-out infinite;
}

@keyframes grassWave {
    0%, 100% {
        d: path("M0,350 Q200,340 400,350 T800,350 T1200,350 L1200,400 L0,400 Z");
    }
    50% {
        d: path("M0,350 Q200,355 400,345 T800,355 T1200,345 L1200,400 L0,400 Z");
    }
}

.flowers {
    animation: flowersGrow 2s ease-in-out infinite alternate;
}

@keyframes flowersGrow {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.1);
    }
}

/* Riduci animazioni su mobile per performance */
@media (max-width: 768px) {
    .child-jumping,
    .ball-bounce,
    .child-running,
    .child-drawing,
    .butterfly {
        animation-duration: 3s; /* Rallenta per risparmiare risorse */
    }
}

/* === HERO ENHANCEMENTS === */
.hero-section {
    position: relative;
}

/* Logo Hero con ombra colorata */
.logo-hero {
    filter: drop-shadow(0 10px 30px rgba(124, 164, 76, 0.4))
            drop-shadow(0 4px 15px rgba(62, 94, 44, 0.3));
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Animated Gradient Background - Toni Legno Naturale Schiariti */
.bg-gradient-premium {
    background: linear-gradient(135deg, 
        #FBF3E8 0%,
        #F5E9D8 25%,
        #EBE0CC 50%,
        #F5E9D8 75%,
        #FBF3E8 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Montessori Geometric Shapes */
.shape {
    position: absolute;
    opacity: 0.15;
    animation: float 20s ease-in-out infinite;
}

/* Triangolo - Crescita */
.shape-1 {
    width: 0;
    height: 0;
    border-left: 200px solid transparent;
    border-right: 200px solid transparent;
    border-bottom: 350px solid #7CA44C;
    top: 10%;
    right: 10%;
    animation-delay: 0s;
    transform-origin: center;
}

/* Cerchio - Completezza */
.shape-2 {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: #FFB84D;
    bottom: 15%;
    left: 8%;
    animation-delay: 5s;
}

/* Quadrato - Stabilità */
.shape-3 {
    width: 250px;
    height: 250px;
    background: #6D422B;
    top: 20%;
    left: 15%;
    animation-delay: 10s;
    transform: rotate(45deg);
}

/* Rettangolo - Apprendimento */
.shape-4 {
    width: 180px;
    height: 280px;
    background: #7CA44C;
    border-radius: 20px;
    bottom: 25%;
    right: 15%;
    animation-delay: 15s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    75% {
        transform: translate(40px, 10px) scale(1.05);
    }
}

/* === TESTIMONIALS === */
#testimonials-container {
    position: relative;
}

.testimonial-item {
    min-height: 350px;
}

/* === VIDEO MODAL === */
#video-modal {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* === STATS COUNTER === */
.counter {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* === PREMIUM SHADOWS === */
.shadow-premium {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.shadow-premium-lg {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

/* === GLASSMORPHISM === */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* === GRADIENT TEXT === */
.gradient-text {
    background: linear-gradient(135deg, #7CA44C 0%, #3E5E2C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === HOVER EFFECTS PREMIUM === */
.hover-lift-premium {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift-premium:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(124, 164, 76, 0.3);
}

/* === SMOOTH TRANSITIONS === */
.transition-smooth {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === FORM === */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    font-family: 'Poppins', sans-serif;
}

input:focus,
textarea:focus {
    border-color: #7CA44C !important;
    box-shadow: 0 0 0 3px rgba(124, 164, 76, 0.1);
}

/* === SCROLL TO TOP BUTTON === */
#scroll-top {
    transition: all 0.3s ease;
}

#scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

#scroll-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* === TIMELINE (Mobile) === */
@media (max-width: 768px) {
    .timeline-item {
        padding-left: 0;
    }
}

/* === MOBILE MENU === */
#mobile-menu {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === CUSTOM SHADOWS === */
.shadow-custom {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.shadow-custom-lg {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* === HOVER EFFECTS === */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 640px) {
    .hero-section h1 {
        font-size: 3rem;
    }
    
    .hero-section p {
        font-size: 1.125rem;
    }
}

/* === ACCESSIBILITY === */
a:focus,
button:focus {
    outline: 2px solid #7CA44C;
    outline-offset: 2px;
}

/* Skip to content link for screen readers */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #7CA44C;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* === LOADING STATE === */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* === PRINT STYLES === */
@media print {
    .no-print {
        display: none !important;
    }
}

/* === GLIGHTBOX CUSTOMIZATION === */
.glightbox-clean .gslide-description {
    background: #3E5E2C;
}

.glightbox-clean .gdesc-inner {
    color: white;
}

/* === AOS ANIMATIONS OVERRIDE === */
[data-aos] {
    pointer-events: auto;
}

/* === CUSTOM SCROLLBAR === */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #F1F4D8;
}

::-webkit-scrollbar-thumb {
    background: #7CA44C;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5F7C3B;
}

/* === UTILITY CLASSES === */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.bg-overlay {
    position: relative;
}

.bg-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(62, 94, 44, 0.6);
}

/* === SELECTION STYLING === */
::selection {
    background-color: #7CA44C;
    color: white;
}

::-moz-selection {
    background-color: #7CA44C;
    color: white;
}

/* === RESPONSIVE IMAGES === */
img {
    max-width: 100%;
    height: auto;
}

/* === TORRE ROSA MONTESSORI === */
.torre-rosa-container {
    perspective: 1200px;
}

#torre-rosa {
    transform-style: preserve-3d;
    position: relative;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 2px;
}

.cube-montessori {
    background: linear-gradient(135deg, #E8A5A5 0%, #D88B8B 50%, #C77171 100%);
    border-radius: 4px;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    opacity: 0;
    transform: translateY(-50px) rotateX(10deg) scale(0.8);
    animation: cubeAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: all 0.4s ease;
}

.cube-montessori::before {
    content: '';
    position: absolute;
    inset: 10%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
    border-radius: 2px;
}

.cube-montessori::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 8px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.3), transparent);
    filter: blur(4px);
}

.cube-montessori:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

@keyframes cubeAppear {
    0% {
        opacity: 0;
        transform: translateY(-100px) rotateX(-20deg) scale(0.5);
    }
    60% {
        opacity: 1;
        transform: translateY(10px) rotateX(5deg) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg) scale(1);
    }
}

/* Animazione loop per mantenere viva la torre */
@keyframes towerPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

#torre-rosa {
    animation: towerPulse 4s ease-in-out infinite;
}

/* === PANNELLO SENSORIALE === */
.sensory-panel {
    aspect-ratio: 1;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.sensory-panel-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.sensory-panel:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

/* Texture Legno */
.wood-texture {
    background: 
        linear-gradient(90deg, rgba(139, 90, 43, 0.8) 1px, transparent 1px),
        linear-gradient(rgba(139, 90, 43, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, #8B5A2B, #A0694B);
    background-size: 50px 50px, 50px 50px, 100% 100%;
}

/* Texture Stoffa */
.fabric-texture {
    background: 
        repeating-linear-gradient(45deg, #C8D8E4 0px, #C8D8E4 2px, #B8C8D4 2px, #B8C8D4 4px),
        repeating-linear-gradient(-45deg, #C8D8E4 0px, #C8D8E4 2px, #B8C8D4 2px, #B8C8D4 4px);
}

/* Texture Carta Vetrata */
.sandpaper-texture {
    background: #D4B896;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(139, 90, 43, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 60% 70%, rgba(139, 90, 43, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 40% 50%, rgba(139, 90, 43, 0.2) 1px, transparent 1px);
    background-size: 10px 10px, 15px 15px, 12px 12px;
}

/* Texture Cotone */
.cotton-texture {
    background: 
        radial-gradient(circle at 25% 25%, white 40%, transparent 40%),
        radial-gradient(circle at 75% 75%, white 40%, transparent 40%),
        linear-gradient(135deg, #F8F9FA, #E9ECEF);
    background-size: 20px 20px, 20px 20px, 100% 100%;
}

/* Texture Sughero */
.cork-texture {
    background: #C4A77D;
    background-image: 
        radial-gradient(ellipse at 30% 40%, rgba(160, 105, 75, 0.4) 2px, transparent 2px),
        radial-gradient(ellipse at 70% 20%, rgba(139, 90, 43, 0.3) 3px, transparent 3px),
        radial-gradient(ellipse at 50% 80%, rgba(160, 105, 75, 0.4) 2px, transparent 2px);
    background-size: 30px 30px, 40px 40px, 35px 35px;
}

/* Texture Velluto */
.velvet-texture {
    background: linear-gradient(180deg, #6B4E71, #8B6F91);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Texture Bambù */
.bamboo-texture {
    background: 
        linear-gradient(to right, transparent 48%, rgba(139, 90, 43, 0.5) 49%, rgba(139, 90, 43, 0.5) 51%, transparent 52%),
        linear-gradient(135deg, #9ACD32, #7BA428);
    background-size: 30px 100%, 100% 100%;
}

/* Texture Feltro */
.felt-texture {
    background: #E8A5A5;
    background-image: 
        repeating-linear-gradient(0deg, rgba(200, 100, 100, 0.2) 0px, transparent 1px, transparent 2px, rgba(200, 100, 100, 0.2) 3px),
        repeating-linear-gradient(90deg, rgba(200, 100, 100, 0.2) 0px, transparent 1px, transparent 2px, rgba(200, 100, 100, 0.2) 3px);
    background-size: 8px 8px;
}

/* Animazioni hover individuali */
.sensory-panel:hover .sensory-panel-inner {
    animation: sensorBounce 0.6s ease;
}

@keyframes sensorBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* === SMOOTH TRANSITIONS === */
a, button, input, textarea {
    transition: all 0.3s ease;
}

/* === MASCOTTE ANIMATA KIRIKÙ === */
#kiriku-mascot {
    position: fixed;
    right: 30px;
    bottom: 100px;
    width: 120px;
    height: 120px;
    z-index: 999;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateX(200px) scale(0.8);
    pointer-events: none;
    display: none; /* Nascosto su mobile per default */
}

/* Mostra mascotte solo su tablet e desktop */
@media (min-width: 769px) {
    #kiriku-mascot {
        display: block;
    }
}

#kiriku-mascot.visible {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

#kiriku-mascot:hover {
    transform: translateX(0) scale(1.1) rotate(5deg);
}

.mascot-container {
    position: relative;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 24px rgba(124, 164, 76, 0.4));
    animation: mascotFloat 3s ease-in-out infinite;
}

@keyframes mascotFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* SVG Mascotte - Personaggio Foglia */
.mascot-character {
    width: 100%;
    height: 100%;
    position: relative;
}

.mascot-body {
    fill: #7CA44C;
    transition: fill 0.3s ease;
}

.mascot-face {
    fill: #F1F4D8;
}

.mascot-eyes {
    fill: #3E5E2C;
    animation: mascotBlink 4s ease-in-out infinite;
}

@keyframes mascotBlink {
    0%, 96%, 100% {
        transform: scaleY(1);
    }
    98% {
        transform: scaleY(0.1);
    }
}

.mascot-smile {
    stroke: #3E5E2C;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
}

#kiriku-mascot:hover .mascot-body {
    fill: #5F7C3B;
}

#kiriku-mascot.speaking .mascot-container {
    animation: mascotSpeak 0.5s ease-in-out infinite;
}

@keyframes mascotSpeak {
    0%, 100% {
        transform: translateY(-15px) scale(1);
    }
    50% {
        transform: translateY(-15px) scale(1.05);
    }
}

/* Balloon tooltip */
.mascot-balloon {
    position: absolute;
    bottom: 100%;
    right: -10px;
    background: white;
    border: 3px solid #7CA44C;
    border-radius: 20px;
    padding: 12px 18px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(10px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    white-space: nowrap;
    font-family: 'Baloo 2', cursive;
    font-weight: 600;
    color: #3E5E2C;
    font-size: 14px;
}

.mascot-balloon::after {
    content: '';
    position: absolute;
    bottom: -12px;
    right: 30px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid #7CA44C;
}

.mascot-balloon::before {
    content: '';
    position: absolute;
    bottom: -7px;
    right: 33px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 9px solid white;
    z-index: 1;
}

#kiriku-mascot:hover .mascot-balloon {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Mascot progress indicator */
.mascot-progress {
    position: absolute;
    top: -5px;
    left: -5px;
    width: calc(100% + 10px);
    height: calc(100% + 10px);
    border-radius: 50%;
    background: conic-gradient(
        #7CA44C 0deg,
        #7CA44C var(--progress-angle, 0deg),
        transparent var(--progress-angle, 0deg)
    );
    opacity: 0.3;
    pointer-events: none;
}

    .mascot-balloon {
        font-size: 12px;
        padding: 8px 12px;
        right: -5px;
    }
}

/* === MASCOT TOGGLE CONTROLS === */
.mascot-toggle-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #7CA44C;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mascot-toggle-btn:hover {
    background: #7CA44C;
    transform: scale(1.1);
}

.mascot-toggle-btn:hover .toggle-icon {
    stroke: white;
}

#kiriku-mascot:hover .mascot-toggle-btn {
    opacity: 1;
}

.toggle-icon {
    width: 16px;
    height: 16px;
    stroke: #7CA44C;
    transition: stroke 0.3s ease;
}

/* Stato nascosto mascotte */
#kiriku-mascot.hidden-by-user {
    opacity: 0 !important;
    transform: translateX(200px) scale(0.5) !important;
    pointer-events: none !important;
}

/* Pulsante recall (richiama mascotte) */
.mascot-recall-btn {
    position: fixed;
    right: 30px;
    bottom: 100px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #7CA44C, #5F7C3B);
    border: none;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(124, 164, 76, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 998;
    opacity: 0;
    transform: scale(0.8);
    animation: recallPulse 2s ease-in-out infinite;
}

.mascot-recall-btn.visible {
    opacity: 1;
    transform: scale(1);
}

.mascot-recall-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(124, 164, 76, 0.6);
}

.recall-icon {
    font-size: 24px;
    margin-bottom: 2px;
}

.recall-text {
    font-family: 'Baloo 2', cursive;
    font-size: 10px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes recallPulse {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(124, 164, 76, 0.4);
    }
    50% {
        box-shadow: 0 4px 24px rgba(124, 164, 76, 0.6), 0 0 0 8px rgba(124, 164, 76, 0.2);
    }
}

/* Nascondi recall button su mobile */
@media (max-width: 768px) {
    .mascot-recall-btn {
        display: none;
    }
}
