/* Gallery Page Specific Styles */
.gallery-page-body {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 50%, #1b4f72 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.gallery-header {
    background: var(--accent-gradient);
    border-bottom: 5px solid #1b4f72;
    box-shadow: var(--shadow-primary);
    position: relative;
    z-index: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Override some global header styles from main.css that affect header h1
   main.css applies background-clip/text-fill which can make text invisible
   depending on stacking and gradients. Reset those for gallery header. */
.gallery-header h1,
.gallery-header .gallery-header-title-section h1 {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: unset !important;
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.35) !important;
}

/* Ensure header doesn't clip children (rounded backgrounds, shadows) */
.gallery-header {
    overflow: visible !important;
}

.gallery-back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    flex: 0 0 auto;
    min-width: 120px;
}

.gallery-back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.gallery-header-content {
    flex: 1;
    display: flex;
    justify-content: center;
}

.gallery-header-placeholder {
    flex: 0 0 auto;
    min-width: 120px;
    visibility: hidden;
}

.gallery-header-title-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-direction: column;
}

.gallery-header-title-section h1 {
    color: white;
    margin: 0;
    font-size: 2.2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.gallery-header-title-section .logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.gallery-language-flags {
    display: flex;
    gap: 10px;
}

.gallery-language-flags .flag {
    width: 35px;
    height: 25px;
    cursor: pointer;
    border-radius: 5px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.gallery-language-flags .flag:hover,
.gallery-language-flags .flag.active {
    border-color: #fff;
    transform: scale(1.1);
}

.gallery-main {
    padding: 40px 20px;
}

.gallery-container {
    max-width: 1100px;
    margin: 0 auto;
}

.gallery-intro {
    text-align: center;
    margin-bottom: 40px;
}

.gallery-intro p {
    font-size: 1.3em;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
    font-weight: 500;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* Videos section */
.gallery-videos {
    padding: 40px 20px 80px 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.01) 100%);
}
.gallery-videos .videos-title {
    color: white;
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 10px;
}
.gallery-videos .videos-intro {
    color: white;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.1em;
}
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}
.video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

.gallery-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: contain;
    background-color: rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 0;
}

.gallery-item:active {
    transform: scale(0.95);
    transition: transform 0.15s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    animation: pulse 2s infinite;
}

/* Add click animation for gallery items */
.gallery-item.clicked {
    animation: zoomClick 0.3s ease-out;
}

@keyframes zoomClick {
    0% {
        transform: scale(1) translateY(-5px);
    }
    50% {
        transform: scale(1.05) translateY(-8px);
    }
    100% {
        transform: scale(1) translateY(-5px);
    }
}

/* Enhanced Modal Styles for Gallery */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(27, 79, 114, 0);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(0px);
}

.modal.visible {
    display: flex;
    opacity: 1;
    background-color: rgba(27, 79, 114, 0.95);
    backdrop-filter: blur(10px);
}

.modal-content-gallery {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.3) rotate(5deg);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 60px 80px 20px 80px;
}

.modal.visible .modal-content-gallery {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

.modal-content-gallery img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: scale(0.8) translateY(30px);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s;
    filter: brightness(0.7);
}

.modal.visible .modal-content-gallery img {
    opacity: 1;
    transform: scale(1) translateY(0px);
    filter: brightness(1);
}

.modal-content-gallery .close-button {
    position: absolute;
    top: -20px;
    right: 50%;
    transform: translateX(50%);
    font-size: 2.5em;
    color: white;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(50%) scale(0.5) rotate(90deg);
    animation: fadeInRotate 0.6s ease 0.4s forwards;
}

@keyframes fadeInRotate {
    to {
        opacity: 1;
        transform: translateX(50%) scale(1) rotate(0deg);
    }
}

.modal-content-gallery .close-button:hover {
    background: rgba(255, 0, 0, 0.8);
    transform: translateX(50%) scale(1.2) rotate(90deg);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: calc(100% + 120px);
    display: flex;
    justify-content: space-between;
    padding: 0;
    pointer-events: none;
    opacity: 0;
    animation: slideInNav 0.5s ease 0.6s forwards;
    left: -80px;
}

@keyframes slideInNav {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(0);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.modal-nav button {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.8em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: all;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-nav button:first-child {
    margin-left: 0;
}

.modal-nav button:last-child {
    margin-right: 0;
}

.modal-nav button:hover {
    background: rgba(52, 152, 219, 0.9);
    transform: scale(1.2);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.modal-nav button:active {
    transform: scale(1.1);
}

/* Add pulsing animation for navigation buttons */
.modal-nav button {
    animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), 0 0 20px rgba(52, 152, 219, 0.3);
    }
}

/* Gallery Button in Event Info */
.gallery-images-button {
    background: linear-gradient(135deg, #27ae60 0%, #229954 50%, #1e8449 100%) !important;
    margin-top: 10px;
}

.gallery-images-button:hover {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 50%, #229954 100%) !important;
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(39, 174, 96, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        position: relative;
    }
    
    .gallery-header-content {
        position: static;
        transform: none;
    }
    
    .gallery-header-placeholder {
        display: none;
    }
    
    .gallery-header-title-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .gallery-header-title-section h1 {
        font-size: 1.8em;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
    
    .gallery-item img {
        height: 250px;
        object-fit: contain;
    }
    
    .gallery-intro p {
        font-size: 1.1em;
    }
    
    .modal-content-gallery {
        padding: 50px 60px 20px 60px;
    }
    
    .modal-nav {
        width: calc(100% + 120px);
        left: -60px;
    }
    
    .modal-nav button {
        width: 45px;
        height: 45px;
        font-size: 1.4em;
    }
}

@media (max-width: 480px) {
    .gallery-main {
        padding: 20px 10px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }
    
    .gallery-item img {
        height: 220px;
        object-fit: contain;
    }
    
    .gallery-header-title-section h1 {
        font-size: 1.5em;
    }
    
    .gallery-intro p {
        font-size: 1em;
    }
    
    .modal-content-gallery {
        padding: 40px 50px 15px 50px;
    }
    
    .modal-nav {
        width: calc(100% + 100px);
        left: -50px;
    }
    
    .modal-nav button {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }
    
    .modal-content-gallery .close-button {
        width: 40px;
        height: 40px;
        font-size: 2em;
        top: -15px;
    }
}

.hidden {
    display: none !important;
}

body.gallery-page-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.gallery-main {
    flex: 1;
}
