/*
* gallery.css - Enhanced Version
* More attractive and modern styling for the gallery page
*/

/* ========================================= */
/* Enhanced Gallery Hero Section */
/* ========================================= */

.gallery-hero {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #06b6d4 100%);
    position: relative;
    overflow: hidden;
}

.gallery-hero::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"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.gallery-hero h1 {
    background: linear-gradient(45deg, #ffffff, #e0f2fe, #ffffff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ========================================= */
/* Enhanced Gallery Grid with Masonry Effect */
/* ========================================= */

.gallery-section {
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    position: relative;
}

.gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.gallery-container {
    position: relative;
    z-index: 1;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0;
}

.gallery-item {
    position: relative;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item img {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: brightness(1) contrast(1) saturate(1);
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-radius: 16px;
}

.gallery-item:hover img {
    transform: scale(1.1);
    filter: brightness(1.1) contrast(1.1) saturate(1.2);
}

/* Enhanced video indicator */
.video-indicator {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(59, 130, 246, 0.8));
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.gallery-item:hover .video-indicator {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(16, 185, 129, 0.9));
}

/* Special effects for different sized items */
.gallery-item:nth-child(5n) {
    grid-row: span 2;
}

.gallery-item:nth-child(7n) {
    transform: rotate(0.5deg);
}

.gallery-item:nth-child(11n) {
    transform: rotate(-0.5deg);
}

/* ========================================= */
/* Enhanced Modal with Glassmorphism */
/* ========================================= */

.gallery-modal {
    backdrop-filter: blur(20px);
    background: rgba(0, 0, 0, 0.8);
    animation: modalFadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(20px);
    }
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 20px;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px 20px 0 0;
}

#modalTitle {
    background: linear-gradient(135deg, #1e40af, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

#closeModal {
    background: linear-gradient(135deg, #fee2e2, #fef3c7);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
    transition: all 0.3s ease;
}

#closeModal:hover {
    background: linear-gradient(135deg, #fecaca, #fed7aa);
    transform: rotate(90deg) scale(1.1);
}

/* ========================================= */
/* Enhanced Load More Button */
/* ========================================= */

.btn-load-more {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8, #0ea5e9);
    background-size: 200% 200%;
    border: none;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.btn-load-more::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.7s ease;
}

.btn-load-more:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
    animation: gradientShift 2s ease-in-out infinite;
}

.btn-load-more:hover::before {
    left: 100%;
}

.btn-load-more:active {
    transform: translateY(-1px) scale(1.02);
}

/* ========================================= */
/* Floating Elements and Decorations */
/* ========================================= */

.gallery-section {
    position: relative;
}

.gallery-section::after {
    content: '';
    position: absolute;
    top: 20%;
    right: 5%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

/* Add subtle animation to gallery items on load */
.gallery-item {
    animation: itemFadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.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; }

@keyframes itemFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================= */
/* Enhanced Responsive Design */
/* ========================================= */

@media (max-width: 767px) {
    .gallery-grid {
        gap: 4px;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .gallery-item {
        border-radius: 8px;
    }
    
    .gallery-item:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .gallery-hero h1 {
        font-size: 2.5rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .gallery-grid {
        gap: 6px;
    }
    
    .gallery-item {
        border-radius: 10px;
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        gap: 12px;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .gallery-item:hover {
        transform: translateY(-12px) scale(1.03);
    }
}

/* ========================================= */
/* Loading Animation */
/* ========================================= */

.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ========================================= */
/* Long Press Visual Feedback Enhancement */
/* ========================================= */

.gallery-item.long-pressing {
    transform: scale(0.95);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.gallery-item.long-pressing::before {
    opacity: 0.8;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.3), rgba(16, 185, 129, 0.3));
}

/* ========================================= */
/* Scroll Animations */
/* ========================================= */

@media (prefers-reduced-motion: no-preference) {
    .gallery-item {
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    .gallery-section {
        scroll-behavior: smooth;
    }
}

/* For users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .btn-load-more,
    .modal-content {
        animation: none;
        transition: none;
    }
}

/* NEW: Simplified Two-Breakpoint Navbar Logic */
@media (min-width: 1025px) {
  .site-header .nav-links {
    display: flex !important;
  }
  .site-header .mobile-menu-toggle {
    display: none !important;
  }
  body {
    font-weight: 400;
  }
  @media (min-width: 1440px) {
    body {
      font-weight: 500;
    }
  }
  @media (min-width: 1920px) {
    body {
      font-weight: 600;
    }
  }
}

@media (max-width: 1024px) {
  .site-header .nav-links {
    display: none !important;
  }
  .site-header .mobile-menu-toggle {
    display: block !important;
    cursor: pointer;
  }
  .site-header .nav-links.open {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 1rem 0;
    z-index: 999;
  }
}
