* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    color: #ffffff;
    padding: 20px;
}

.gallery-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 1200px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #00c6ff;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: #00c6ff;
    color: #0f2027;
    transform: translateX(-5px);
}

.gallery-header h1 {
    font-size: 2rem;
    flex: 1;
}

.gallery-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    width: 100%;
    max-width: 1200px;
}

/* Filter Section */
.filter-section {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    text-transform: capitalize;
}

.filter-btn:hover,
.filter-btn.active {
    background: rgba(0, 198, 255, 0.3);
    border-color: #00c6ff;
    color: #00c6ff;
    box-shadow: 0 5px 15px rgba(0, 198, 255, 0.3);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0, 198, 255, 0.1), rgba(0, 168, 204, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    height: 250px;
}

.gallery-item:hover {
    transform: translateY(-10px);
    border-color: rgba(0, 198, 255, 0.5);
    box-shadow: 0 15px 40px rgba(0, 198, 255, 0.3);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(0.8);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    font-size: 3rem;
    color: #00c6ff;
}

/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.lightbox-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

.lightbox-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 198, 255, 0.3);
}

/* Navigation Buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 5px 15px rgba(0, 198, 255, 0.3);
}

.lightbox-nav.prev {
    left: 10px;
}

.lightbox-nav.next {
    right: 10px;
}

/* Image Info */
.lightbox-info {
    background: rgba(0, 0, 0, 0.6);
    backdropfilter: blur(10px);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 100%;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-info h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #00c6ff;
}

.lightbox-info p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    line-height: 1.5;
}

.image-counter {
    display: inline-block;
    background: rgba(0, 198, 255, 0.2);
    color: #00c6ff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(0, 198, 255, 0.3);
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 900;
}

.loading-spinner.active {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 198, 255, 0.2);
    border-top-color: #00c6ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Keyboard Navigation */
@media (max-width: 768px) {
    .gallery-header {
        flex-direction: column;
        text-align: center;
        align-items: flex-start;
    }

    .gallery-header h1 {
        font-size: 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }

    .gallery-item {
        height: 180px;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .lightbox-nav.prev {
        left: 5px;
    }

    .lightbox-nav.next {
        right: 5px;
    }

    .lightbox-close {
        top: -35px;
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .gallery-container {
        padding: 15px;
    }

    .filter-section {
        gap: 10px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-item {
        height: 150px;
    }

    .lightbox-image {
        max-height: 50vh;
    }
}
