/* ===================================
   Professional Gallery Page Styles
   Mobile-First, Modern & Animated
   =================================== */

/* Root Variables */
:root {
    /* Colors */
    --primary: #0274be;
    --primary-dark: #003bb1;
    --primary-light: #00a8ff;
    --accent: #00d9ff;
    --text-dark: #1a202c;
    --text-body: #4a5568;
    --text-light: #718096;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    --overlay-dark: rgba(0, 0, 0, 0.8);
    --overlay-light: rgba(2, 116, 190, 0.9);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0274be 0%, #003bb1 100%);
    --gradient-overlay: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* Borders */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-body);
    background: var(--bg-secondary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

/* ===================================
   Hero Section
   =================================== */
.gallery-hero {
    position: relative;
    height: 50vh;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--gradient-primary);
}

.hero-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255, 255, 255, 0.03) 35px, rgba(255, 255, 255, 0.03) 70px);
    animation: patternMove 20s linear infinite;
}

@keyframes patternMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(70px, 70px); }
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(0, 168, 255, 0.2) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    padding: var(--space-lg);
}

.hero-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    animation: float 3s ease-in-out infinite;
}

.hero-icon i {
    font-size: 2.5rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* ===================================
   Gallery Section
   =================================== */
.gallery-section {
    padding: var(--space-2xl) 0;
}

/* Enhanced Tabs */
.gallery-tabs-wrapper {
    margin-bottom: var(--space-2xl);
}

.tabs-container {
    display: flex;
    gap: var(--space-sm);
    background: var(--bg-primary);
    padding: var(--space-xs);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.gallery-tab {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-light);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-base);
    position: relative;
    z-index: 1;
}

.gallery-tab:hover {
    color: var(--primary);
    background: var(--bg-secondary);
}

.gallery-tab.active {
    color: white;
}

.tab-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.tab-label {
    font-weight: 600;
    font-size: 1rem;
}

.tab-count {
    font-size: 0.875rem;
    opacity: 0.8;
}

.tab-indicator {
    position: absolute;
    height: calc(100% - var(--space-xs) * 2);
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    top: var(--space-xs);
}

/* ===================================
   Gallery Grid
   =================================== */
.gallery-grid {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: 1fr;
}

.gallery-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.gallery-item.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   Photo Cards
   =================================== */
.photo-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.photo-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.photo-wrapper {
    position: relative;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    overflow: hidden;
    background: var(--bg-tertiary);
}

.photo-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.photo-card:hover .photo-wrapper img {
    transform: scale(1.1);
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay-light);
    opacity: 0;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-card:hover .photo-overlay {
    opacity: 1;
}

.overlay-content {
    transform: translateY(20px);
    transition: var(--transition-base);
}

.photo-card:hover .overlay-content {
    transform: translateY(0);
}

.view-btn {
    width: 60px;
    height: 60px;
    border: 2px solid white;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-base);
    backdrop-filter: blur(10px);
}

.view-btn:hover {
    background: white;
    color: var(--primary);
    transform: scale(1.1);
}

.photo-info {
    padding: var(--space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.photo-title {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: var(--space-xs);
    line-height: 1.4;
}

.photo-date {
    font-size: 0.875rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: auto;
}

/* ===================================
   Video Cards
   =================================== */
.video-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.video-wrapper {
    position: relative;
    background: var(--text-dark);
}

.video-container {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-lg);
    color: var(--text-light);
    background: var(--bg-tertiary);
}

.video-error i {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    color: #e53e3e;
}

.video-info {
    padding: var(--space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.video-title {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: var(--space-xs);
    line-height: 1.4;
}

.video-date {
    font-size: 0.875rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: auto;
}

/* ===================================
   Empty State
   =================================== */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.empty-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-lg);
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.empty-icon i {
    font-size: 4rem;
}

.empty-state h3 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: var(--space-sm);
    font-weight: 700;
}

.empty-state p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 500px;
    margin: 0 auto;
}

/* ===================================
   Lightbox
   =================================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay-dark);
    backdrop-filter: blur(10px);
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid white;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-base);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: white;
    color: var(--text-dark);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid white;
    border-radius: var(--radius-xl);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-base);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: white;
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: -80px;
}

.lightbox-next {
    right: -80px;
}

.lightbox-image-wrapper {
    background: var(--text-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: calc(90vh - 120px);
}

.lightbox-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-caption {
    background: var(--bg-primary);
    padding: var(--space-lg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    text-align: center;
}

.lightbox-caption h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: var(--space-xs);
}

.lightbox-caption p {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* ===================================
   Animation Classes
   =================================== */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   Responsive Design
   =================================== */
@media (min-width: 640px) {
    :root {
        --space-sm: 1.25rem;
        --space-md: 2rem;
        --space-lg: 3rem;
        --space-xl: 4rem;
        --space-2xl: 5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .container {
        padding: 0 var(--space-md);
    }
}

@media (min-width: 768px) {
    .gallery-hero {
        height: 60vh;
        min-height: 400px;
    }

    .hero-icon {
        width: 100px;
        height: 100px;
    }

    .hero-icon i {
        font-size: 3rem;
    }

    .tabs-container {
        gap: var(--space-md);
    }

    .tab-icon {
        font-size: 2rem;
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile Lightbox Adjustments */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 50px;
        height: 50px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
    }

    .lightbox-content {
        width: 95%;
    }
}

/* ===================================
   Accessibility
   =================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.gallery-tab:focus-visible,
.view-btn:focus-visible,
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 4px;
}

/* ===================================
   Print Styles
   =================================== */
@media print {
    .gallery-hero,
    .gallery-tabs-wrapper,
    .lightbox {
        display: none !important;
    }

    .photo-card,
    .video-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}