/* Gallery Page Specific Styles */

.page-header {
    background: var(--gradient-accent);
    color: white;
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://via.placeholder.com/1920x600/9b59b6/ffffff?text=Gallery+Background') center/cover;
    opacity: 0.1;
}

.page-header h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.page-header p {
    font-size: 1.3rem;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

/* Gallery Filters */
.gallery-filters {
    padding: 60px 0 40px;
    background: var(--soft-gray);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    border: 2px solid var(--royal-blue);
    color: var(--royal-blue);
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--royal-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

/* Gallery Section */
.gallery-section {
    padding: 60px 0 100px;
    background: var(--soft-gray);
}

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

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
}

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

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 30px 20px 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

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

.gallery-content h4 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: white;
}

.gallery-content p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
    line-height: 1.4;
}

.gallery-category {
    display: inline-block;
    background: var(--gradient-primary);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: var(--shadow-heavy);
}

.lightbox-info {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    max-width: 500px;
}

.lightbox-info h4 {
    color: var(--royal-blue);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.lightbox-info p {
    color: var(--dark-gray);
    margin-bottom: 15px;
}

.lightbox-category {
    display: inline-block;
    background: var(--gradient-primary);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: white;
    color: var(--royal-blue);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-nav:hover {
    background: white;
    color: var(--royal-blue);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

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

.gallery-item.show {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Loading Animation */
.gallery-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.2rem;
    color: var(--royal-blue);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--royal-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Masonry Layout Enhancement */
.gallery-grid.masonry {
    columns: 3;
    column-gap: 30px;
}

.gallery-grid.masonry .gallery-item {
    break-inside: avoid;
    margin-bottom: 30px;
}

.gallery-grid.masonry .gallery-item img {
    height: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2.5rem;
    }
    
    .page-header p {
        font-size: 1.1rem;
    }
    
    .filter-buttons {
        gap: 10px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .gallery-grid.masonry {
        columns: 2;
        column-gap: 20px;
    }
    
    .gallery-grid.masonry .gallery-item {
        margin-bottom: 20px;
    }
    
    .gallery-overlay {
        padding: 20px 15px 15px;
    }
    
    .gallery-content h4 {
        font-size: 1.1rem;
    }
    
    .gallery-content p {
        font-size: 0.85rem;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .lightbox img {
        max-height: 70vh;
    }
    
    .lightbox-info {
        padding: 15px;
        margin-top: 15px;
    }
    
    .lightbox-close {
        top: -40px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 100px 0 60px;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .gallery-filters {
        padding: 40px 0 30px;
    }
    
    .gallery-section {
        padding: 40px 0 60px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gallery-grid.masonry {
        columns: 1;
    }
    
    .gallery-item img {
        height: 200px;
    }
    
    .filter-buttons {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .lightbox-info {
        padding: 12px;
    }
    
    .lightbox-info h4 {
        font-size: 1.1rem;
    }
    
    .lightbox-info p {
        font-size: 0.9rem;
    }
}

/* Hover Effects Enhancement */
@media (hover: hover) {
    .gallery-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(26, 75, 132, 0.1);
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: 1;
    }
    
    .gallery-item:hover::before {
        opacity: 1;
    }
    
    .gallery-overlay {
        z-index: 2;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .gallery-filters,
    .footer {
        display: none;
    }
    
    .page-header {
        background: none;
        color: black;
        padding: 20px 0;
    }
    
    .gallery-grid {
        display: block;
    }
    
    .gallery-item {
        break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .gallery-overlay {
        position: static;
        background: white;
        color: black;
        transform: none;
        padding: 10px;
        border-top: 1px solid #ddd;
    }
}