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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.gallery-header {
    text-align: center;
    margin-bottom: 30px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.back-button {
    display: inline-block;
    background: #4ecdc4;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    margin-bottom: 20px;
    transition: background 0.3s ease;
}

.back-button:hover {
    background: #45b8b0;
}

#event-title {
    font-size: 2em;
    color: #333;
    margin-bottom: 10px;
}

#event-date {
    color: #ff6b6b;
    font-size: 1.1em;
    margin-bottom: 5px;
}

#photo-count {
    color: #666;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
    background: white;
    /* Fallback for browsers that don't support aspect-ratio */
    height: 0;
    padding-bottom: 75%; /* 4:3 aspect ratio */
}

/* Use aspect-ratio for modern browsers */
@supports (aspect-ratio: 4/3) {
    .gallery-item {
        height: auto;
        padding-bottom: 0;
        aspect-ratio: 4/3;
    }
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.2em;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.lightbox-close:hover {
    color: #ff6b6b;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 60px;
    font-weight: bold;
    cursor: pointer;
    padding: 20px;
    user-select: none;
    z-index: 1001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: #4ecdc4;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.1em;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 6px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    #event-title {
        font-size: 1.5em;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 40px;
        padding: 10px;
    }
}
