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

:root {
    --primary: #00f0ff;
    --secondary: #ff00ff;
    --accent: #ffff00;
    --dark: #0a0a0f;
    --darker: #050508;
    --light: #e0e0e8;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

html {
    background-color: #0a0a0f;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--dark);
    background-color: #0a0a0f;
    color: var(--light);
    overflow-x: hidden;
    min-height: 100svh;
    position: relative;
    padding-bottom: env(safe-area-inset-bottom);
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(247, 83, 148, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(0, 240, 255, 0.15) 0%, transparent 50%);
    animation: gradientShift 15s ease infinite;
    z-index: 0;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}


.container {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Gallery Header */
.gallery-header {
    padding: 4rem 2rem 2rem;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease-out;
}

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

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(224, 224, 232, 0.7);
    text-decoration: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 0.5rem;
    background: rgba(10, 10, 15, 0.3);
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--light);
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
    transform: translateY(-2px);
}

.gallery-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientFlow 8s ease infinite;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.gallery-date {
    text-align: center;
    margin: -1.5rem 0 1.5rem 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    color: rgba(224, 224, 232, 0.5);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 300;
}

.gallery-meta {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: stretch;
    margin-bottom: 2rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    color: rgba(224, 224, 232, 0.6);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.gallery-meta span {
    padding: 0.5rem 1.5rem;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 0.5rem;
    background: rgba(10, 10, 15, 0.3);
    backdrop-filter: blur(10px);
    transition: color 0.3s ease;
    cursor: default;
    user-select: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-meta span:hover {
    color: rgba(0, 240, 255, 0.7);
}

.gallery-description {
    max-width: 800px;
    min-height: 150px;
    margin: 0 auto;
    padding: 2rem;
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 1rem;
    background: rgba(10, 10, 15, 0.5);
    backdrop-filter: blur(10px);
    position: relative;
    box-sizing: border-box;
}

.gallery-description p {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(224, 224, 232, 0.75);
    font-weight: 300;
    white-space: pre-line;
    letter-spacing: 0.02em;
    margin: 0;
}

/* Image Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 2rem 2rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

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

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 240, 255, 0.1);
    background: rgba(10, 10, 15, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInItem 0.6s ease-out forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0s; }
.gallery-item:nth-child(2) { animation-delay: 0.05s; }
.gallery-item:nth-child(3) { animation-delay: 0.1s; }
.gallery-item:nth-child(4) { animation-delay: 0.15s; }
.gallery-item:nth-child(5) { animation-delay: 0.2s; }
.gallery-item:nth-child(6) { animation-delay: 0.25s; }
.gallery-item:nth-child(7) { animation-delay: 0.3s; }
.gallery-item:nth-child(8) { animation-delay: 0.35s; }
.gallery-item:nth-child(n+9) { animation-delay: 0.4s; }

@keyframes fadeInItem {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-item:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 240, 255, 0.2);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

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

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    background: rgba(5, 5, 8, 1);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
    margin: 0;
    box-sizing: border-box;
}

.lightbox::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(247, 83, 148, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(0, 240, 255, 0.15) 0%, transparent 50%);
    animation: gradientShift 15s ease infinite;
    z-index: -1;
}

.lightbox.active {
    display: flex;
    animation: fadeInLightbox 0.3s ease-out;
}

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

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    animation: scaleInContent 0.4s ease-out;
    overflow: visible;
    z-index: 10;
    perspective: 1000px;
}

@keyframes scaleInContent {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-image-container {
    position: relative;
    width: 90vw;
    height: 70vh;
    max-width: 90vw;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
}

.lightbox-image-card {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none;
    transform-origin: center center;
    will-change: transform;
}

.lightbox-image-card.animating {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-image-card.transitioning {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.lightbox-image-card.behind {
    z-index: 0;
    opacity: 0.4;
    transform: scale(0.95) translateY(20px);
}

.lightbox-image-card.current {
    z-index: 1;
}

.lightbox-image-card.exiting {
    z-index: 2;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.2);
    pointer-events: none;
    user-select: none;
    display: block;
}

.lightbox-info {
    text-align: center;
    max-width: 600px;
    width: 100%;
    padding: 1.5rem;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 0.5rem;
    background: rgba(10, 10, 15, 0.5);
    backdrop-filter: blur(10px);
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeInUpInfo 0.4s ease-out 0.3s backwards;
    transition: opacity 0.15s ease;
}

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

.lightbox-info h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 0.5rem 0;
    letter-spacing: 0.05em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    flex-shrink: 0;
    min-height: 0;
}

.lightbox-info p {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgba(224, 224, 232, 0.75);
    word-wrap: break-word;
    white-space: pre-line;
    overflow-wrap: break-word;
    word-break: break-word;
    margin: 0;
    flex-shrink: 0;
    min-height: 0;
}

.lightbox-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: rgba(10, 10, 15, 0.9);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
    animation: fadeInButton 0.4s ease-out 0.2s backwards;
}

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

.lightbox-close:hover {
    background: rgba(10, 10, 15, 1);
    border-color: rgba(0, 240, 255, 0.6);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary);
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(10, 10, 15, 0.9);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
    animation: fadeInButton 0.4s ease-out 0.2s backwards;
}

.lightbox-nav:hover {
    background: rgba(10, 10, 15, 1);
    border-color: rgba(0, 240, 255, 0.6);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.lightbox-nav svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Swipe indicators for mobile */
.lightbox-swipe-hint {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 50px;
    background: transparent;
    border: none;
    border-radius: 0;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10001;
    animation: pulseHint 2s ease-in-out infinite;
}

.lightbox-swipe-hint svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
    opacity: 0.4;
}

.lightbox-swipe-hint.left {
    left: 0.5rem;
}

.lightbox-swipe-hint.right {
    right: 0.5rem;
}

@keyframes pulseHint {
    0%, 100% {
        opacity: 0.4;
        transform: translateY(-50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-50%) scale(1.1);
    }
}

@media (max-width: 768px) {
    .lightbox-swipe-hint {
        display: flex;
    }
}

.loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1002;
}

.loading.active {
    display: block;
}

.loading svg {
    animation: spin 1s linear infinite;
}

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

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

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

@media (max-width: 768px) {
    .gallery-header {
        padding: 2rem 1rem 1rem;
    }
    
    .gallery-date {
        font-size: 1rem;
        margin: -0.5rem 0 1.5rem 0;
    }
    
    .gallery-meta {
        gap: 1rem;
    }
    
    .gallery-meta span {
        padding: 0.375rem 1rem;
        line-height: 1.2;
    }
    
    .gallery-description {
        min-height: 140px;
        padding: 1.5rem;
    }
    
    .gallery-description p {
        font-size: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 1rem;
    }
    
    .lightbox {
        padding: 0 !important;
        touch-action: none;
        width: 100% !important;
        height: 100% !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        position: fixed !important;
        background: #0a0a0f !important;
        margin: 0 !important;
        z-index: 9999 !important;
    }
    
    .lightbox::before {
        content: '' !important;
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        position: fixed !important;
        background: 
            radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.2) 0%, transparent 50%),
            radial-gradient(circle at 80% 80%, rgba(247, 83, 148, 0.2) 0%, transparent 50%),
            radial-gradient(circle at 40% 80%, rgba(0, 240, 255, 0.15) 0%, transparent 50%),
            #0a0a0f !important;
        animation: gradientShift 15s ease infinite !important;
        z-index: -1 !important;
    }
    
    .lightbox-content {
        padding: 0.75rem !important;
        padding-top: calc(3rem + env(safe-area-inset-top, 0px)) !important;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
        padding-left: calc(0.75rem + env(safe-area-inset-left, 0px)) !important;
        padding-right: calc(0.75rem + env(safe-area-inset-right, 0px)) !important;
        max-width: 100vw;
        width: 100vw;
        gap: 0.75rem;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        background: transparent;
    }
    
    .lightbox-image-container {
        width: calc(100vw - 1.5rem);
        height: 58vh;
        max-height: 58vh;
        flex-shrink: 0;
        flex-grow: 0;
        background: transparent;
        border: none;
    }
    
    .lightbox-image-card {
        width: 100%;
        height: 100%;
        background: transparent;
        border: none;
    }
    
    .lightbox-image {
        max-width: 100%;
        max-height: 100%;
        width: 100%;
        height: 100%;
        object-fit: contain;
        border: none !important;
        box-shadow: none !important;
    }
    
    .lightbox-info {
        width: calc(100vw - 1.5rem);
        max-width: calc(100vw - 1.5rem);
        flex: 0 1 auto;
        padding: 0.875rem;
        overflow: hidden;
        min-height: auto;
        max-height: calc(100vh - 58vh - 4.5rem);
        height: auto;
        border: none !important;
        background: rgba(10, 10, 15, 0.7) !important;
    }
    
    .lightbox-info h3 {
        margin-bottom: 0.5rem;
        overflow: hidden;
    }
    
    .lightbox-info p {
        overflow-wrap: break-word;
        word-break: break-word;
        overflow: hidden;
    }
    
    .lightbox-image-card {
        border: none !important;
        box-shadow: none !important;
    }
    
    .lightbox-close {
        width: 44px;
        height: 44px;
        top: calc(0.5rem + env(safe-area-inset-top, 0px)) !important;
        right: calc(0.5rem + env(safe-area-inset-right, 0px)) !important;
    }
    
    .lightbox-nav {
        display: none !important;
    }
}

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

@media (max-width: 480px) {
    .lightbox-content {
        padding-top: calc(2.75rem + env(safe-area-inset-top, 0px)) !important;
    }
    
    .lightbox-image-container {
        height: 60vh;
        max-height: 60vh;
    }
    
    .lightbox-info {
        max-height: calc(100vh - 60vh - 4rem);
    }
}

