:root {
    --primary-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e1e8ed;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --accent: #3498db;
    --overlay-bg: rgba(0, 0, 0, 0.85);
    --transition-speed: 0.3s;
}

#gallery h1 {
    font-size: 2.5rem;
    color: #1a1a2e;
}

/* Gallery Grid Layout - 4 columns */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 30px;
}

/* Thumbnail Card */
.thumbnail-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.thumbnail-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.thumbnail-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.thumbnail-card:hover::after {
    opacity: 1;
}

.thumbnail-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-speed);
}

.thumbnail-card:hover img {
    transform: scale(1.05);
}

.image-title {
    padding: 16px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    z-index: 1000;
    animation: fadeIn var(--transition-speed);
    cursor: pointer;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

/* Modal Content */
.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    cursor: default;
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Close Button */
.close-btn {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-primary);
    transition: all 0.2s;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.close-btn:hover {
    background: var(--accent);
    color: white;
    transform: rotate(90deg);
}

/* Navigation Buttons */
.nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-primary);
    transition: all 0.2s;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-btn:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.nav-btn.prev {
    left: 30px;
}

.nav-btn.next {
    right: 30px;
}

/* Image Counter */
.image-counter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 24px;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    h1 {
        font-size: 2rem;
    }

    .thumbnail-card img {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .nav-btn, .close-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .nav-btn.prev {
        left: 15px;
    }

    .nav-btn.next {
        right: 15px;
    }

    .close-btn {
        top: 15px;
        right: 15px;
    }
}