/* ==================== */
/* Global Styles */
/* ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #171852;
    --secondary-color: #8b5cf6;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --success-color: #10b981;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ==================== */
/* Header */
/* ==================== */

.header {
    background: var(--gradient);
    padding: 2rem 0;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    background: linear-gradient(to right, #fff, #f0f9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 300;
}

/* ==================== */
/* Filters Section */
/* ==================== */

.filters-section {
    margin-bottom: 2rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-group label {
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-select,
.date-input {
    padding: 0.6rem 1rem;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-select:hover,
.date-input:hover {
    border-color: var(--primary-color);
}

.filter-select:focus,
.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-filter {
    padding: 0.6rem 1.5rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.view-toggle {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.btn-view {
    padding: 0.6rem;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-view:hover {
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.btn-view.active {
    background: var(--gradient);
    color: white;
    border-color: transparent;
}

.stats {
    text-align: center;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ==================== */
/* Loading Indicator */
/* ==================== */

.loading {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ==================== */
/* Gallery Grid */
/* ==================== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

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

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 1rem;
    transform: translateY(100%);
    transition: all 0.3s ease;
}

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

.gallery-item-date {
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
}

.gallery-item-size {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

/* ==================== */
/* Carousel */
/* ==================== */

.carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.carousel-main {
    flex: 1;
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: var(--shadow-xl);
}

.carousel-main img {
    width: 100%;
    height: 600px;
    object-fit: contain;
    background: #000;
}

.carousel-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.carousel-info span {
    color: white;
    font-size: 0.95rem;
}

.carousel-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.carousel-btn:hover {
    background: var(--gradient);
    color: white;
    border-color: transparent;
    transform: scale(1.1);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-thumbnails {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--dark-bg);
}

.carousel-thumbnails::-webkit-scrollbar {
    height: 8px;
}

.carousel-thumbnails::-webkit-scrollbar-track {
    background: var(--dark-bg);
    border-radius: 4px;
}

.carousel-thumbnails::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.carousel-thumbnail {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.carousel-thumbnail:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.carousel-thumbnail.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.carousel-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================== */
/* Lightbox */
/* ==================== */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.lightbox-content {
    position: relative;
    z-index: 1001;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

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

.lightbox-nav:hover {
    background: var(--gradient);
    border-color: transparent;
}

.lightbox-nav.prev {
    left: -70px;
}

.lightbox-nav.next {
    right: -70px;
}

.lightbox-image-container {
    max-width: 90vw;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-xl);
}

.lightbox-info {
    margin-top: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
}

.lightbox-info p {
    margin: 0.25rem 0;
    font-size: 0.95rem;
}

/* ==================== */
/* Responsive Design */
/* ==================== */

@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
    
    .carousel-main img {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .filters {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-group {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .view-toggle {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .carousel-main img {
        height: 300px;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-nav.prev {
        left: 10px;
    }
    
    .lightbox-nav.next {
        right: 10px;
    }
}

/* ==================== */
/* Animations */
/* ==================== */

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

.gallery-item {
    animation: fadeIn 0.5s ease forwards;
}

.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; }

