/* ===== CSS Variables ===== */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --transition-speed: 0.3s;
    --border-radius: 0.5rem;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* ===== Hero Section ===== */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4rem 0;
    margin-bottom: 2rem;
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: fadeInDown 0.8s ease-out;
}

.hero-section .lead {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.stats-row {
    margin-top: 2rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.stat-item {
    text-align: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 120px;
    transition: transform var(--transition-speed);
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== Category Filter ===== */
.category-filter {
    z-index: 1020;
    top: 56px;
    transition: all var(--transition-speed);
}

.sticky-top-filter {
    position: sticky;
}

.filter-header {
    transition: all var(--transition-speed);
}

.filter-title {
    font-size: 1rem;
}

.category-search {
    animation: slideDown 0.3s ease-out;
}

.category-search .form-control {
    border-radius: 1.5rem;
    border-left: none;
}

.category-search .input-group-text {
    border-right: none;
    border-radius: 1.5rem 0 0 1.5rem;
}

.category-buttons-container {
    animation: slideDown 0.3s ease-out;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

.category-buttons-container.show {
    max-height: 1000px;
    opacity: 1;
}

.category-buttons-wrapper {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.category-buttons-wrapper::-webkit-scrollbar {
    width: 6px;
}

.category-buttons-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.category-buttons-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.category-buttons-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.filter-buttons {
    max-height: 250px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.filter-buttons.expanded {
    max-height: none;
}

.filter-buttons .btn {
    transition: all var(--transition-speed);
    border-radius: 1.5rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    white-space: nowrap;
    font-size: 0.875rem;
}

.filter-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-buttons .btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.filter-buttons .btn.hidden {
    display: none;
}

.filter-controls .btn {
    border-radius: 1.5rem;
    font-size: 0.875rem;
}

.category-search .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

#categoryCount {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Category Groups */
.category-group {
    margin-bottom: 1rem;
}

.category-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Gallery Grid ===== */
.gallery-section {
    min-height: 60vh;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed);
    cursor: pointer;
    background: #f8f9fa;
    aspect-ratio: 1;
}

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

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

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

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-speed);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

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

.gallery-item-info {
    color: white;
    width: 100%;
}

.gallery-item-info .category-badge {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    display: inline-block;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.gallery-item-info .image-name {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    min-height: 300px;
}

/* ===== Image Modal ===== */
#imageModal .modal-content {
    border: none;
    border-radius: var(--border-radius);
}

#imageModal .modal-body {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#imageModal img {
    max-height: 80vh;
    object-fit: contain;
}

.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    z-index: 10;
}

.modal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.modal-nav-btn.prev-btn {
    left: 20px;
}

.modal-nav-btn.next-btn {
    right: 20px;
}

.modal-nav-btn i {
    font-size: 1.5rem;
}

/* ===== Loading Animation ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .stats-row {
        gap: 1rem !important;
    }

    .stat-item {
        min-width: 100px;
        padding: 0.75rem 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .filter-header {
        padding: 0.75rem 0 !important;
    }
    
    .filter-title {
        font-size: 0.875rem;
    }
    
    .filter-buttons {
        width: 100%;
        justify-content: center;
        max-height: 200px !important;
    }
    
    .category-buttons-wrapper {
        max-height: 250px;
    }
    
    .filter-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .category-search {
        margin-top: 1rem !important;
    }

    .gallery-item {
        margin-bottom: 1rem;
    }

    .modal-nav-btn {
        width: 40px;
        height: 40px;
    }

    .modal-nav-btn.prev-btn {
        left: 10px;
    }

    .modal-nav-btn.next-btn {
        right: 10px;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }

    .stat-item {
        min-width: 80px;
        padding: 0.5rem 0.75rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    .filter-buttons .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    .category-buttons-wrapper {
        max-height: 200px;
    }
    
    .filter-controls .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    .category-group-title {
        font-size: 0.7rem;
        margin-bottom: 0.375rem;
    }
}

/* ===== Smooth Scrolling ===== */
html {
    scroll-behavior: smooth;
}

/* ===== Lazy Loading Placeholder ===== */
.gallery-item img[data-src] {
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item img[data-src].loaded {
    opacity: 1;
}

/* ===== Category Badge Colors ===== */
.category-badge.fitness { background: rgba(255, 107, 107, 0.9) !important; }
.category-badge.indoor { background: rgba(107, 142, 255, 0.9) !important; }
.category-badge.office { background: rgba(107, 255, 205, 0.9) !important; }
.category-badge.outdoor { background: rgba(255, 239, 107, 0.9) !important; }
.category-badge.party { background: rgba(255, 107, 239, 0.9) !important; }
.category-badge.portrait { background: rgba(239, 107, 255, 0.9) !important; }
.category-badge.social { background: rgba(107, 255, 142, 0.9) !important; }
.category-badge.travel { background: rgba(255, 178, 107, 0.9) !important; }

