/* Stimmate di San Francesco - Scuola dell'Infanzia Styles */

* {
    font-family: 'Fredoka', sans-serif;
}

.bounce-float {
    animation: bounceFloat 4s ease-in-out infinite;
}

.bounce-float:nth-child(2) {
    animation-delay: -1s;
}

.bounce-float:nth-child(3) {
    animation-delay: -2s;
}

.bounce-float:nth-child(4) {
    animation-delay: -3s;
}

@keyframes bounceFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg) scale(1); }
    25% { transform: translateY(-30px) rotate(5deg) scale(1.1); }
    50% { transform: translateY(-15px) rotate(-3deg) scale(1.05); }
    75% { transform: translateY(-25px) rotate(2deg) scale(1.08); }
}

.wiggle-hover {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.wiggle-hover:hover {
    transform: translateY(-12px) scale(1.08) rotate(2deg);
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: translateY(-12px) scale(1.08) rotate(2deg); }
    25% { transform: translateY(-12px) scale(1.08) rotate(-2deg); }
    75% { transform: translateY(-12px) scale(1.08) rotate(1deg); }
}

.rainbow-bg {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3, #54a0ff);
    background-size: 400% 400%;
    animation: rainbowShift 8s ease infinite;
}

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

.gradient-red {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.gradient-blue {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.gradient-green {
    background: linear-gradient(135deg, #96ceb4 0%, #85c1a3 100%);
}

.gradient-yellow {
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
}

.gradient-purple {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.gradient-orange {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.gradient-pink {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
}

.gradient-cyan {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.gradient-teal {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.card-bounce {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-bounce:hover {
    transform: translateY(-20px) scale(1.05);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.nav-icon {
    transition: all 0.3s ease;
}

.nav-icon:hover {
    transform: scale(1.2) rotate(10deg);
}

.text-shadow-fun {
    text-shadow: 3px 3px 0px rgba(0,0,0,0.1);
}

.big-shadow {
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
}

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    from { box-shadow: 0 0 20px rgba(255, 107, 107, 0.4); }
    to { box-shadow: 0 0 40px rgba(255, 107, 107, 0.8); }
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 250px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 12px;
    z-index: 1000;
    padding: 8px 0;
    border: 2px solid #f0f0f0;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #374151;
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 2px 8px;
}

.dropdown-content a:hover {
    background-color: #f3f4f6;
    transform: translateX(8px);
    color: #ff6b6b;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
}

.mobile-menu.active {
    display: block;
}

/* Navigation height compensation */
body {
    padding-top: 0;
}

/* Ensure proper spacing for fixed nav */
.section {
    scroll-margin-top: 120px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .desktop-menu {
        display: none;
    }
    
    /* Mobile specific adjustments */
    .section {
        padding-top: 140px !important;
        scroll-margin-top: 140px;
    }
    
    /* Reduce font sizes on mobile */
    h1 {
        font-size: 2.5rem !important;
    }
    
    h2 {
        font-size: 2rem !important;
    }
    
    /* Better mobile navigation */
    nav {
        padding: 8px 0;
    }
    
    .mobile-menu {
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .section {
        padding-top: 160px !important;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* Even smaller screens */
    h1 {
        font-size: 2rem !important;
    }
    
    .card-bounce {
        margin-bottom: 16px;
    }
}

/* Section visibility */
.section {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.section.active {
    display: block;
    opacity: 1;
}

/* Gallery Grid - Enhanced Responsive Design */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.gallery-item {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

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

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

.gallery-item-content {
    padding: 20px;
}

.gallery-item-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.gallery-item-description {
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Album Grid for individual galleries */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.album-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.album-image:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.breadcrumb-item {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.breadcrumb-item:hover {
    color: #3b82f6;
}

.breadcrumb-separator {
    color: #9ca3af;
    font-size: 1.2rem;
}

.breadcrumb-current {
    color: #1f2937;
    font-weight: 600;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: slideUp 0.3s ease;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
    transition: transform 0.2s ease;
}

.lightbox-close:hover {
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    padding: 16px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.lightbox-prev {
    left: -60px;
}

.lightbox-next {
    right: -60px;
}

.lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    font-weight: 500;
}

/* Loading State */
.image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

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

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

/* Responsive Gallery Adjustments */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
    
    .gallery-item img {
        height: 200px;
    }
    
    .gallery-item-content {
        padding: 16px;
    }
    
    .album-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .album-image {
        height: 160px;
    }
    
    .lightbox-nav {
        font-size: 1.5rem;
        padding: 12px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .breadcrumb {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .gallery-item img {
        height: 180px;
    }
    
    .album-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .album-image {
        height: 140px;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 1.5rem;
    }
    
    .lightbox-counter {
        bottom: 10px;
        font-size: 0.9rem;
    }
}

/* Gallery Category Cards */
.category-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.category-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.category-card-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.category-card-content {
    padding: 24px;
}

.category-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.category-card-description {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.category-card-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.category-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 0.9rem;
}

.category-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.category-card-link:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .category-card-image {
        height: 200px;
    }
    
    .category-card-content {
        padding: 20px;
    }
    
    .category-card-title {
        font-size: 1.25rem;
    }
    
    .category-card-stats {
        flex-direction: column;
        gap: 8px;
    }
}

/* Span con a capo automatico */
.span-break {
    display: inline-block;
    white-space: normal;
    word-wrap: break-word;
    word-break: break-word;
}

/* Immagini responsive nel footer */
.footer-logo {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .footer-logo {
        max-width: 50%;
        margin: 0 auto;
    }
}