/* ============================================
   PREMIUM GALLERY STYLES
   Lubega Institute - Campus Gallery
   ============================================ */

/* CSS Variables */
:root {
    --primary: #1a4d8c;
    --primary-light: #2c6eb0;
    --secondary: #e67e22;
    --accent: #f39c12;
    --light: #f8f9fa;
    --white: #ffffff;
    --dark: #2c3e50;
    --text-dark: #1a1a2e;
    --text-muted: #6c757d;
    --border: #e9ecef;
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.16);
    --shadow-hover: 0 20px 40px rgba(0,0,0,0.2);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-dark);
    background: var(--light);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   PAGE HEADER WITH GLASS-MORPHISM EFFECT
   ============================================ */
.page-header { 
    background: url('../images/gallery/pouse at the bus.jpeg') center/cover fixed;
    position: relative;
    text-align: center;
    color: white;
    padding: 120px 0;
}

/* Glass-morphism overlay effect */
.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    pointer-events: none;
}

/* Dark gradient overlay for better text readability */
.page-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.1), rgba(0,0,0,0.1));
    pointer-events: none;
}

.page-header .container {
    position: relative;
    z-index: 2;
}

.page-header h1 {
    font-size: 3.5rem;
    margin-bottom: 16px;
    font-weight: 800;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    animation: fadeInUp 0.8s ease;
    letter-spacing: -0.5px;
}

.page-header p {
    font-size: 1.25rem;
    margin-bottom: 24px;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
    animation: fadeInUp 0.8s ease 0.1s both;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.breadcrumb {
    animation: fadeInUp 0.8s ease 0.2s both;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.breadcrumb a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 4px;
    color: rgba(255,255,255,0.8);
}

/* ============================================
   SECTION HEADER
   ============================================ */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 16px;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--secondary);
    border-radius: 2px;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 24px auto 0;
}

/* ============================================
   GALLERY SECTION
   ============================================ */
.gallery-section { 
    padding: 80px 0; 
    background: var(--light);
}

/* ============================================
   VIEW CONTROLS
   ============================================ */
.view-controls {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 24px;
}

.view-btn {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.view-btn.active {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.view-btn:hover:not(.active) {
    background: var(--light);
    transform: translateY(-2px);
}

/* ============================================
   FILTER BUTTONS
   ============================================ */
.gallery-filters { 
    display: flex; 
    justify-content: center; 
    gap: 12px; 
    margin-bottom: 48px; 
    flex-wrap: wrap; 
}

.filter-btn { 
    padding: 10px 28px; 
    background: var(--white); 
    border: 2px solid var(--border); 
    border-radius: 40px; 
    cursor: pointer; 
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(230, 126, 34, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.filter-btn:hover::before {
    width: 200px;
    height: 200px;
}

.filter-btn.active, 
.filter-btn:hover { 
    background: var(--secondary); 
    color: var(--white); 
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   GALLERY GRID
   ============================================ */
.gallery-grid { 
    column-count: 4; 
    column-gap: 24px; 
}

/* Grid View (default) */
.gallery-grid.grid-view {
    column-count: 4;
}

/* List View */
.gallery-grid.list-view {
    column-count: 1;
}

.gallery-grid.list-view .gallery-item {
    display: flex;
    margin-bottom: 20px;
}

.gallery-grid.list-view .gallery-item img {
    width: 300px;
    height: 200px;
    object-fit: cover;
}

/* Gallery Items */
.gallery-item { 
    break-inside: avoid; 
    margin-bottom: 24px; 
    border-radius: 16px; 
    overflow: hidden; 
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.gallery-item:hover { 
    transform: translateY(-8px); 
    box-shadow: var(--shadow-hover);
}

.gallery-item img { 
    width: 100%; 
    height: auto; 
    display: block; 
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Image Overlay */
.gallery-item::after {
    content: '🔍 Click to enlarge';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 40px 16px 16px;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* ============================================
   GALLERY STATS
   ============================================ */
.gallery-stats {
    text-align: center;
    margin-top: 48px;
    padding: 20px 32px;
    background: var(--white);
    border-radius: 60px;
    display: inline-block;
    width: auto;
    margin-left: auto;
    margin-right: auto;
    box-shadow: var(--shadow-sm);
    font-size: 1rem;
    font-weight: 500;
}

.gallery-stats span {
    font-weight: 800;
    color: var(--secondary);
    font-size: 1.2rem;
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.scroll-top:hover {
    transform: translateY(-5px);
    background: var(--primary);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gallery-item {
    animation: fadeIn 0.6s ease backwards;
}

/* Stagger animation */
.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }
.gallery-item:nth-child(7) { animation-delay: 0.35s; }
.gallery-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-item:nth-child(9) { animation-delay: 0.45s; }
.gallery-item:nth-child(10) { animation-delay: 0.5s; }

/* Loading Skeleton */
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.gallery-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    min-height: 200px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) { 
    .gallery-grid, 
    .gallery-grid.grid-view { 
        column-count: 3; 
        column-gap: 20px; 
    }
}

@media (max-width: 992px) {
    .container {
        padding: 0 20px;
    }
    
    .page-header h1 {
        font-size: 2.5rem;
    }
    
    .page-header {
        padding: 80px 0;
    }
}

@media (max-width: 768px) { 
    .gallery-grid,
    .gallery-grid.grid-view { 
        column-count: 2; 
        column-gap: 16px; 
    }
    
    .page-header { 
        padding: 60px 0;
    }
    
    .page-header h1 { 
        font-size: 2rem; 
    }
    
    .page-header p {
        font-size: 1rem;
        padding: 0 20px;
    }
    
    .section-header h2 { 
        font-size: 1.8rem; 
    }
    
    .filter-btn { 
        padding: 8px 20px; 
        font-size: 0.85rem; 
    }
    
    .gallery-item::after { 
        content: ''; /* Hide overlay on mobile */
    }
    
    .gallery-grid.list-view .gallery-item {
        flex-direction: column;
    }
    
    .gallery-grid.list-view .gallery-item img {
        width: 100%;
        height: auto;
    }
    
    .view-controls {
        justify-content: center;
    }
}

@media (max-width: 480px) { 
    .gallery-grid,
    .gallery-grid.grid-view { 
        column-count: 1; 
    }
    
    .container { 
        padding: 0 16px; 
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .filter-btn {
        padding: 6px 16px;
        font-size: 0.8rem;
    }
    
    .gallery-stats {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    .breadcrumb {
        font-size: 0.9rem;
    }
}

/* ============================================
   ACCESSIBILITY & PRINT
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .page-header {
        background: var(--primary);
        padding: 40px 0;
    }
    
    .page-header::before,
    .page-header::after {
        display: none;
    }
    
    .gallery-filters,
    .view-controls,
    .scroll-top,
    .gallery-item::after {
        display: none;
    }
    
    .gallery-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}


/* Dropdown */
        .dropdown { position: relative; display: inline-block; }
        .dropdown-toggle::after { content: '\f107'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 0.7rem; margin-left: 6px; }
        .dropdown:hover .dropdown-toggle::after { transform: rotate(180deg); }
        .dropdown-menu { position: absolute; top: 100%; left: 0; min-width: 220px; background-color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.15); padding: 10px 0; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.3s ease; z-index: 9999; margin-top: 10px; border-radius: 8px; overflow: visible; }
        .dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
        .dropdown.dropdown-open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
        .dropdown-menu li { display: block; width: 100%; border-bottom: 1px solid #eee; }
        .dropdown-menu li:last-child { border-bottom: none; }
        .dropdown-menu::before { content: ''; position: absolute; top: -8px; left: 25px; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 8px solid #fff; }
        .dropdown-menu a { display: block; width: 100%; padding: 12px 20px !important; font-size: 14px; color: #333 !important; text-decoration: none; transition: all 0.3s; border-radius: 0 !important; }
        .dropdown-menu a:hover { background: #c9a227; color: #fff !important; padding-left: 25px !important; }
  

        /* Dropdown - Original Style with Slide Animation */
        nav menuitem {
            position:relative;
            display:block;
            opacity:1;
            cursor:pointer;
        }

        nav menuitem > menu {
            position: absolute;
            pointer-events:none;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s, visibility 0.3s;
        }
        
        menuitem:hover > menu,
        menuitem:focus-within > menu {
            pointer-events:initial;
            opacity: 1;
            visibility: visible;
        }
        
        /* Make nested menus visible on hover */
        nav menuitem menuitem:hover > menu,
        nav menuitem menuitem:focus-within > menu {
            pointer-events:initial;
            opacity: 1;
            visibility: visible;
        }
        
        nav > menu { display:flex; }

        nav > menu > menuitem { pointer-events: all; opacity:1; }
        menu menuitem a { white-space:nowrap; display:block; }
            

        menuitem:hover > menu > menuitem,
        menu:hover > menuitem{
            opacity:1;
        }
        nav > menu > menuitem menuitem menu {
            transform:translateX(100%);
            top:0; right:0;
        }

        nav a {
            transition: background 0.5s, color 0.5s, transform 0.5s;
            position:relative;
        }

        nav > menu > menuitem > a + menu:after{
            content: '';
            position:absolute;
            border:6px solid transparent;
            border-top: 6px solid #1a365d;
            right:15px;
            top: 50%;
            transform: translateY(-50%);
        }
        nav menuitem > menu > menuitem > a + menu:after{ 
            content: '';
            position:absolute;
            border:6px solid transparent;
            border-left: 6px solid #1a365d;
            right:-12px;
            top: 50%;
            transform: translateY(-50%);
        }

        nav menuitem > menu {
            background: #fff;
            border-radius: 5px;
            padding: 8px 0;
            min-width: 200px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.15);
        }

        nav menuitem > menu menuitem a {
            color: #333 !important;
            padding: 10px 20px;
        }

        nav menuitem > menu menuitem a:hover {
            background: #c9a227;
            color: #fff !important;
            padding-left: 25px !important;
        }

        nav > menu > menuitem > menu > menuitem{
            opacity: 1;
        }
        nav > menu > menuitem:hover > menu > menuitem,
        nav > menu > menuitem.hover > menu > menuitem{
            opacity: 1;
        }

        menuitem > menu > menuitem > menu > menuitem{
            opacity: 1;
        } 
        menuitem > menu > menuitem:hover > menu > menuitem,  
        menuitem > menu > menuitem.hover > menu > menuitem{  
            opacity: 1;
        }
        .dropdown-submenu:hover .dropdown-menu { opacity: 1; visibility: visible; }
        .mobile-toggle { display: none; font-size: 1.5rem; cursor: pointer; padding: 10px; }






        