/* ========================================
   7. GALLERY STYLES
   ======================================== */

/* Photo Gallery Styles */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    padding: 20px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

    cursor: pointer;
    background-color: var(--card-bg) ;
    border-color: var(--border-color) ;
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* ========================================
   8. MODAL STYLES
   ======================================== */

/* Updated Modal Styles - Fix navbar overlay issue */
.modal {
    display: none;
    position: fixed;
    z-index: 1050 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;

}

/* Close button - ensure it's above everything */
.close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1051 !important; 
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    width: auto;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    object-fit: contain;
    z-index: 1051;
    opacity: 0;
    animation: modalopen 0.3s ease-out forwards;
}

.close:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95vw;
        max-height: 80vh;
    }
}

@media (max-width: 576px) {
    .modal-content {
        max-width: 98vw;
        max-height: 75vh;
    }
}

/* Smooth modal opening animation */
@keyframes modalopen {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ========================================
   15. NAVBAR ADDITIONAL STYLES
   ======================================== */
.bg-white {
    background-color: var(--card-bg) !important;
}
.bg-light {
    background-color: var(--bg-secondary) !important;
}

/* ========================================
   16. MODAL NAVIGATION STYLES
   ======================================== */

/* Navigation buttons */
.modal-navigation {
    position: fixed;
    top: 50%;
    width: 100%;
    z-index: 1052;
    pointer-events: none;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: auto;
    z-index: 1052;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

/* Photo counter */
.modal-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    z-index: 1052;
    backdrop-filter: blur(10px);
}

/* Caption positioning update */
.caption {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    z-index: 1052;
    backdrop-filter: blur(10px);
}

/* Mobile responsive navigation */
@media (max-width: 768px) {
    .nav-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .prev-btn {
        left: 15px;
    }
    
    .next-btn {
        right: 15px;
    }
    
    .modal-counter {
        bottom: 15px;
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .caption {
        bottom: 50px;
        padding: 6px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .prev-btn {
        left: 10px;
    }
    
    .next-btn {
        right: 10px;
    }
}

/* Dark theme support for navigation */
[data-theme="dark"] .nav-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .modal-counter,
[data-theme="dark"] .caption {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}