/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(155, 89, 182, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 40%, rgba(255, 107, 107, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, #000000 0%, #0a0a0a 25%, #000000 50%, #0f0f0f 75%, #000000 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #ffffff;
    overflow-x: hidden;
    position: relative;
}

/* Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 120px 104px, 60px 52px;
    background-position: 0 0, 60px 26px;
    opacity: 0.02;
    z-index: -1;
    pointer-events: none;
}

/* Header styles */
header {
    padding: 2rem 0;
    text-align: center;
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 10;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-image {
    max-height: 200px;
    max-width: 300px;
    height: auto;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Main content */
main {
    padding: 3rem 2rem;
    min-height: calc(100vh - 200px);
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Gallery grid */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
    align-items: start;
    justify-items: center;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    width: 100%;
    max-width: 600px;
    height: 350px;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Keyboard focus visibility */
.gallery-item:focus {
    outline: 3px solid #00d4ff;
    outline-offset: 4px;
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.35), 0 8px 20px rgba(0,0,0,0.5);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Image overlay */
.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(0, 212, 255, 0.1) 0%,
        rgba(155, 89, 182, 0.1) 25%,
        rgba(255, 107, 107, 0.1) 50%,
        rgba(254, 202, 87, 0.1) 75%,
        rgba(0, 212, 255, 0.1) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* Loading animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty gallery message */
.empty-gallery {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.6);
}

.empty-gallery h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.empty-gallery p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem 0;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    text-align: center;
}

.footer-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    main {
        padding: 2rem 1rem;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .gallery-item {
        height: 280px;
        max-width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .footer-links {
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gallery-item {
        height: 250px;
    }
    
    main {
        padding: 1.5rem 0.5rem;
    }
}

/* Lightbox styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(30px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1001;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    transition: all 0.3s ease;
    pointer-events: all;
    z-index: 1002;
}

.lightbox-prev:disabled,
.lightbox-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.3);
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

.lightbox-prev:hover:not(:disabled),
.lightbox-next:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev:focus:not(:disabled),
.lightbox-next:focus:not(:disabled),
.lightbox-close:focus {
    outline: 3px solid #00d4ff;
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.35);
}

/* Lightbox adjustments */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95vw;
        max-height: 85vh;
    }
    
    .lightbox img {
        max-width: 95vw;
        max-height: 85vh;
    }
    
    .lightbox-close {
        top: -40px;
        font-size: 1.5rem;
        width: 35px;
        height: 35px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 1.5rem;
        width: 50px;
        height: 50px;
    }
    
    .lightbox-prev {
        left: 20px;
    }
    
    .lightbox-next {
        right: 20px;
    }
}

@media (max-width: 480px) {
    .lightbox-content {
        max-width: 98vw;
        max-height: 80vh;
    }
    
    .lightbox img {
        max-width: 98vw;
        max-height: 80vh;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
}

/* High-resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .gallery-item {
        border-width: 1px;
    }
}
