/* ===================================
   GALLERY PAGE STYLES
   =================================== */

/* Page Header */
/* Page Header */
.page-header {
    color: var(--white);
    padding: var(--spacing-5xl) 0 var(--spacing-4xl);
    position: relative;
    overflow: hidden;
    margin-top: 50px; /* Account for fixed header */
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center; /* Center content vertically and horizontally */
}

/* Style for the video background */
.page-header-video-background {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0; /* Place behind content */
    transform: translate(-50%, -50%);
    object-fit: cover; /* Ensures the video covers the entire area without distortion */
}

.page-header::before {
    /* This creates the grid pattern overlay. Adjust its opacity or remove if not needed */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="header-grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23ffffff" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23header-grid)"/></svg>');
    background-size: auto;
    background-position: center, center;
    background-repeat: repeat;
    animation: header-pattern-float 30s ease-in-out infinite;
    opacity: 0.2; /* Adjust opacity to make the video more visible */
    z-index: 1; /* Place above the video, below content */
}

/* The .page-header::after block for the blue overlay is now removed */


.page-header-content {
    position: relative;
    z-index: 3; /* Ensure content is on top */
    text-align: center;
    max-width:  90%; 
    margin: 0 auto;
}

.page-title {
    font-size: var(--fs-5xl);
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    color: var(--white);
}

.page-subtitle {
    font-size: var(--fs-lg);
    opacity: 0.9;
    margin-bottom: var(--spacing-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.breadcrumb {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--fs-sm);
    opacity: 0.8;
}

.breadcrumb a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition-normal);
}

.breadcrumb a:hover {
    color: var(--accent-color);
}

.breadcrumb i {
    font-size: var(--fs-xs);
}

/* Gallery Stats */
.gallery-stats {
    background: var(--white);
    padding: var(--spacing-4xl) 0;
    border-bottom: 1px solid var(--gray-light);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
}

.stat-item {
    text-align: center;
    padding: var(--spacing-xl);
    background: var(--light-color);
    border-radius: var(--radius-xl);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-lg);
    font-size: var(--fs-2xl);
    transition: var(--transition-normal);
}

.stat-item:hover .stat-icon {
    transform: scale(1.1);
}

.stat-number {
    font-size: var(--fs-4xl);
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: var(--fs-base);
    color: var(--gray-dark);
    font-weight: 500;
}

/* Gallery Filters */
.gallery-filters-section {
    background: var(--light-color);
    padding: var(--spacing-3xl) 0;
    border-bottom: 1px solid var(--gray-light);
}

.filter-wrapper {
    text-align: center;
}

.filter-title {
    font-size: var(--fs-2xl);
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: var(--spacing-xl);
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: center;
    align-items: center;
}

.filter-btn {
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--white);
    color: var(--gray-dark);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-lg);
    font-size: var(--fs-base);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    transition: var(--transition-normal);
    z-index: 1;
}

.filter-btn span {
    position: relative;
    z-index: 2;
}

.filter-btn:hover::before {
    left: 0;
}

.filter-btn:hover {
    color: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.filter-btn.active::before {
    left: 0;
}

/* Gallery Grid */
.gallery-section {
    padding: var(--spacing-4xl) 0;
    background: var(--white);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-3xl);
}

/* Gallery Item */
.gallery-item {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    position: relative;
    border: 1px solid var(--gray-light);
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.gallery-image {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.gallery-item:hover .gallery-image img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(0, 102, 204, 0.9) 0%, 
        rgba(0, 212, 255, 0.9) 100%);
    opacity: 0;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-content {
    text-align: center;
    color: var(--white);
    transform: translateY(20px);
    transition: var(--transition-normal);
    padding: var(--spacing-lg);
}

.gallery-item:hover .gallery-content {
    transform: translateY(0);
}

.gallery-content h4 {
    font-size: var(--fs-xl);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.gallery-content p {
    font-size: var(--fs-base);
    margin-bottom: var(--spacing-lg);
    opacity: 0.9;
}

.gallery-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: var(--fs-lg);
    transition: var(--transition-normal);
    backdrop-filter: blur(10px);
}

.gallery-link:hover {
    background: var(--white);
    color: var(--primary-color);
    border-color: var(--white);
    transform: scale(1.1);
}

/* Gallery Info */
.gallery-info {
    padding: var(--spacing-lg);
    text-align: center;
}

.gallery-category {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--primary-color);
    color: var(--white);
    border-radius: var(--radius-md);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-sm);
}

.gallery-info h5 {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

/* Load More Section */
.gallery-load-more {
    text-align: center;
    margin-top: var(--spacing-3xl);
}

#loadMoreBtn {
    min-width: 200px;
    position: relative;
    overflow: hidden;
}

#loadMoreBtn.loading {
    pointer-events: none;
}

#loadMoreBtn.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    animation: loading-shimmer 1.5s infinite;
}

/* Gallery Features */
.gallery-features {
    background: var(--light-color);
    padding: var(--spacing-5xl) 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-2xl);
    margin-top: var(--spacing-3xl);
}

.feature-item {
    text-align: center;
    padding: var(--spacing-2xl);
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-lg);
    font-size: var(--fs-2xl);
    transition: var(--transition-normal);
}

.feature-item:hover .feature-icon {
    transform: rotate(360deg) scale(1.1);
}

.feature-item h4 {
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: var(--spacing-md);
}

.feature-item p {
    font-size: var(--fs-base);
    color: var(--gray-dark);
    line-height: 1.6;
    margin: 0;
}

/* Masonry Layout for Different Screen Sizes */
@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    /*.gallery-item:nth-child(4n+1) .gallery-image {
        height: 320px;
    }
    
    .gallery-item:nth-child(6n+3) .gallery-image {
        height: 240px;
    }*/
}

@media (min-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
    /*
    .gallery-item:nth-child(8n+2) .gallery-image,
    .gallery-item:nth-child(8n+7) .gallery-image {
        height: 360px;
    } */
}

/* Lightbox Customization */
.lightbox {
    z-index: 10000;
}

.lightbox .lb-image {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
}

.lightbox .lb-outerContainer {
    border-radius: var(--radius-lg);
}

.lightbox .lb-dataContainer {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.lightbox .lb-data .lb-caption {
    color: var(--white);
    font-size: var(--fs-lg);
    font-weight: 500;
}

.lightbox .lb-data .lb-number {
    color: var(--accent-color);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: var(--spacing-xl);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: var(--spacing-4xl) 0 var(--spacing-3xl);
    }
    
    .page-title {
        font-size: var(--fs-4xl);
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .gallery-image {
        height: 250px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .gallery-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .feature-item {
        padding: var(--spacing-xl);
    }
}

@media (max-width: 480px) {
    .gallery-section,
    .gallery-stats,
    .gallery-filters-section,
    .gallery-features {
        padding: var(--spacing-2xl) 0;
    }
    
    .page-title {
        font-size: var(--fs-3xl);
    }
    
    .breadcrumb {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .gallery-image {
        height: 200px;
    }
    
    .gallery-info {
        padding: var(--spacing-md);
    }
    
    .stat-item {
        padding: var(--spacing-lg);
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: var(--fs-xl);
    }
    
    .stat-number {
        font-size: var(--fs-3xl);
    }
    
    .filter-title {
        font-size: var(--fs-xl);
    }
    
    .gallery-content h4 {
        font-size: var(--fs-lg);
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: var(--fs-xl);
    }
    
    .feature-item h4 {
        font-size: var(--fs-lg);
    }
}

/* Animation Keyframes */
@keyframes header-pattern-float {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(5px, -2px); }
    50% { transform: translate(-3px, 5px); }
    75% { transform: translate(-5px, -3px); }
}

@keyframes loading-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Filter Animation */
.gallery-item {
    transition: all 0.5s ease;
}

.gallery-item.filter-hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.gallery-item.filter-visible {
    opacity: 1;
    transform: scale(1);
}

/* Loading States */
.gallery-loading .gallery-grid {
    opacity: 0.7;
    pointer-events: none;
}

.gallery-skeleton {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-light);
}

.skeleton-image {
    height: 280px;
    background: linear-gradient(90deg, 
        var(--gray-light) 25%, 
        #e8e8e8 50%, 
        var(--gray-light) 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

.skeleton-content {
    padding: var(--spacing-lg);
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, 
        var(--gray-light) 25%, 
        #e8e8e8 50%, 
        var(--gray-light) 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
}

.skeleton-line.short {
    width: 60%;
}

/* Print Styles */
@media print {
    .page-header,
    .gallery-filters-section,
    .gallery-load-more,
    .gallery-features {
        display: none;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .gallery-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--gray-light);
    }
    
    .gallery-overlay,
    .gallery-link {
        display: none;
    }
    
    .gallery-image {
        height: 200px;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .gallery-item,
    .filter-btn,
    .stat-item,
    .feature-item {
        border-width: 3px;
    }
    
    .gallery-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .filter-btn,
    .stat-item,
    .feature-item,
    .gallery-link {
        transition: none;
    }
    
    .gallery-item:hover,
    .stat-item:hover,
    .feature-item:hover {
        transform: none;
    }
    
    .gallery-image img,
    .gallery-content,
    .feature-icon {
        transition: none;
    }
    
    .loading-shimmer {
        animation: none;
    }
}

/* ===================================
   GALLERY PAGE DROPDOWN MENU FIX
   Add this to your gallery.css or main CSS file
   =================================== */

/* Ensure dropdown functionality works on gallery page */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 1001;
}

/* Desktop dropdown styles - ensure they work on gallery page */
@media (min-width: 769px) {
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 220px;
        background: var(--white);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-xl);
        padding: var(--spacing-md);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all var(--transition-normal);
        border: 1px solid rgba(0, 0, 0, 0.1);
        z-index: 1000;
        pointer-events: none;
    }

    .dropdown:hover .dropdown-menu,
    .dropdown.active .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .dropdown-item {
        display: block;
        padding: var(--spacing-sm) var(--spacing-md);
        color: var(--gray-dark);
        text-decoration: none;
        border-radius: var(--radius-md);
        transition: all var(--transition-fast);
        font-size: var(--fs-sm);
        white-space: nowrap;
    }

    .dropdown-item:hover {
        background: var(--light-color);
        color: var(--primary-color);
        text-decoration: none;
    }

    /* Dark theme support */
    .header.dark .dropdown-menu {
        background: var(--dark-secondary);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .header.dark .dropdown-item {
        color: var(--gray-light);
    }

    .header.dark .dropdown-item:hover {
        background: var(--dark-color);
        color: var(--accent-color);
    }
}

/* Mobile dropdown styles - specific fixes for gallery page */
@media (max-width: 768px) {
    /* Ensure mobile menu is properly positioned on gallery page */
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        width: 100%;
        height: calc(100vh - 60px); /* Adjust based on your header height */
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: var(--spacing-xl);
        gap: 0;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        overflow-y: auto;
        box-shadow: var(--shadow-xl);
        z-index: 999;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    /* Mobile dropdown specific styles */
    .dropdown-menu {
        position: static !important;
        width: 100%;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: var(--light-color);
        margin-top: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        transition: max-height var(--transition-normal);
        pointer-events: auto;
    }

    .dropdown.active .dropdown-menu {
        max-height: 300px;
        padding: var(--spacing-sm) 0;
    }

    .dropdown-item {
        padding: var(--spacing-md) var(--spacing-xl);
        font-size: var(--fs-base);
        color: var(--gray-dark);
        text-decoration: none;
        display: block;
        transition: all var(--transition-normal);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        white-space: normal;
    }

    .dropdown-item:hover,
    .dropdown-item:focus {
        background: rgba(0, 102, 204, 0.1);
        color: var(--primary-color);
        text-decoration: none;
    }

    .dropdown-item:last-child {
        border-bottom: none;
    }

    /* Services dropdown chevron rotation */
    .dropdown-toggle i {
        transition: transform var(--transition-normal);
    }

    .dropdown.active .dropdown-toggle i {
        transform: rotate(180deg);
    }

    /* Dark theme mobile */
    .header.dark .nav-menu {
        background: rgba(26, 26, 26, 0.98);
    }

    .header.dark .dropdown-menu {
        background: var(--dark-secondary);
    }

    .header.dark .dropdown-item {
        color: var(--gray-light);
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }

    .header.dark .dropdown-item:hover {
        background: rgba(0, 212, 255, 0.1);
        color: var(--accent-color);
    }
}

/* Fix any z-index conflicts on gallery page */
.gallery-section,
.gallery-filters-section,
.gallery-stats {
    position: relative;
    z-index: 1;
}

.page-header {
    position: relative;
    z-index: 2;
}

.header {
    z-index: 1030 !important;
}

.nav-menu {
    z-index: 1029 !important;
}

.dropdown-menu {
    z-index: 1028 !important;
}

/* Ensure gallery filter buttons don't interfere */
.gallery-filters .filter-btn {
    z-index: 1;
}

.gallery-filters .filter-btn:focus {
    z-index: 2;
}

/* Fix for gallery lightbox if it conflicts */
.lightbox {
    z-index: 10000 !important;
}

/* Ensure dropdown works with any page background */
.dropdown-menu {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Additional hover states for better UX */
@media (min-width: 769px) {
    .dropdown-toggle:hover {
        color: var(--primary-color);
    }

    .header.dark .dropdown-toggle:hover {
        color: var(--accent-color);
    }
}

/* Fix for dropdown appearing behind gallery elements */
@media (min-width: 769px) {
    .dropdown-menu {
        position: absolute;
        z-index: 1050; /* Higher than most elements */
    }

    /* Ensure dropdown doesn't get cut off */
    .nav-item.dropdown {
        position: static;
    }

    .dropdown-menu {
        position: absolute;
        top: calc(100% + 5px); /* Small gap from nav item */
        left: 0;
    }

    /* Adjust position if dropdown goes off screen */
    .nav-item.dropdown:last-child .dropdown-menu,
    .nav-item.dropdown:nth-last-child(2) .dropdown-menu {
        left: auto;
        right: 0;
    }
}