/* ========================
   GALLERY PAGE STYLES
   ======================== */

/* Gallery Filter */
.gallery-filter {
    background: var(--light-bg);
    border-bottom: 2px solid var(--light-gray);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.filter-btn {
    background: var(--white);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius-large);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    cursor: pointer;
    font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(45deg, var(--primary-color), var(--pink-color));
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

/* Gallery Grid */
.gallery-section {
    background: var(--white);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.gallery-item {
    opacity: 1;
    transform: scale(1);
    transition: var(--transition-slow);
}

.gallery-item.hide {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.gallery-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    height: 100%;
}

.gallery-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-heavy);
}

.gallery-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

/* Placeholder Images */
.placeholder-image,
.placeholder-video {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--white);
    text-align: center;
    position: relative;
}

.placeholder-image span,
.placeholder-video span {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1rem;
    font-family: 'Fredoka One', cursive;
}

/* Different background gradients for categories */
.classroom-bg {
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
}

.reading-bg {
    background: linear-gradient(135deg, #45B7D1, #96CEB4);
}

.art-bg {
    background: linear-gradient(135deg, #FECA57, #FF9FF3);
}

.playground-bg {
    background: linear-gradient(135deg, #54A0FF, #5F27CD);
}

.garden-bg {
    background: linear-gradient(135deg, #00D2D3, #54A0FF);
}

.music-bg {
    background: linear-gradient(135deg, #FF9FF3, #54A0FF);
}

.cooking-bg {
    background: linear-gradient(135deg, #FECA57, #FF6B6B);
}

.science-bg {
    background: linear-gradient(135deg, #48CAE4, #0077B6);
}

.birthday-bg {
    background: linear-gradient(135deg, #FF6B6B, #FFE66D);
}

.graduation-bg {
    background: linear-gradient(135deg, #4ECDC4, #45B7D1);
}

.cafeteria-bg {
    background: linear-gradient(135deg, #96CEB4, #FECA57);
}

.nap-bg {
    background: linear-gradient(135deg, #A8E6CF, #C7CEEA);
}

.placeholder-video {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
}

.gallery-content {
    text-align: center;
    color: var(--white);
    padding: 1.5rem;
}

.gallery-content h5 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.gallery-content p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.view-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--pink-color));
    border: none;
    color: var(--white);
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius-large);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    cursor: pointer;
}

.view-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: linear-gradient(45deg, var(--pink-color), var(--primary-color));
}

/* Video Items */
.video-item .placeholder-video {
    position: relative;
}

.video-item .placeholder-video::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23000" opacity="0.3"/></svg>');
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--purple-color) 100%);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Modal Styles */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-bottom: none;
}

.modal-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
}

.btn-close {
    filter: invert(1);
}

.modal-image-container {
    max-height: 60vh;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.modal-placeholder-image {
    width: 100%;
    height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: var(--white);
    font-size: 4rem;
}

.modal-placeholder-image span {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1rem;
    font-family: 'Fredoka One', cursive;
}

.modal-description {
    font-size: 1.1rem;
    color: var(--dark-gray);
    line-height: 1.6;
}

/* Video Modal */
.video-container {
    max-height: 70vh;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.video-placeholder {
    width: 100%;
    height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: var(--white);
    font-size: 5rem;
}

.video-placeholder span {
    font-size: 2rem;
    font-weight: 600;
    margin-top: 1rem;
    font-family: 'Fredoka One', cursive;
}

.video-placeholder p {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.8;
}

/* Animation for gallery items */
@keyframes galleryItemIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gallery-item {
    animation: galleryItemIn 0.6s ease-out forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }
.gallery-item:nth-child(9) { animation-delay: 0.9s; }

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .gallery-image {
        height: 200px;
    }
    
    .placeholder-image,
    .placeholder-video {
        font-size: 2rem;
    }
    
    .placeholder-image span,
    .placeholder-video span {
        font-size: 1rem;
    }
    
    .filter-buttons {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }
    
    .modal-placeholder-image {
        height: 300px;
        font-size: 3rem;
    }
    
    .video-placeholder {
        height: 300px;
        font-size: 3rem;
    }
    
    .video-placeholder span {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gallery-image {
        height: 180px;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .gallery-content {
        padding: 1rem;
    }
    
    .gallery-content h5 {
        font-size: 1.1rem;
    }
    
    .gallery-content p {
        font-size: 0.8rem;
    }
    
    .view-btn {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }
}

/* Loading Animation for Gallery */
.gallery-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.gallery-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--light-gray);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Masonry Effect for varied heights */
.gallery-item.tall {
    grid-row-end: span 2;
}

.gallery-item.tall .gallery-image {
    height: 350px;
}

/* Hover effects for better interactivity */
.gallery-card {
    cursor: pointer;
}

.gallery-overlay .gallery-content {
    transform: translateY(20px);
    transition: var(--transition);
}

.gallery-card:hover .gallery-overlay .gallery-content {
    transform: translateY(0);
}

/* Focus states for accessibility */
.filter-btn:focus,
.view-btn:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .gallery-filter,
    .cta-section {
        display: none;
    }
    
    .gallery-grid {
        display: block;
    }
    
    .gallery-item {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}