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

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.upload-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 40px;
    border: 2px dashed #ddd;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

input[type="text"], select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

.upload-btn {
    background: #007bff;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.upload-btn:hover {
    background: #0056b3;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.event-section {
    margin-bottom: 40px;
}

.event-header {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    padding: 15px 20px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-header:hover {
    background: #e9ecef;
}

.event-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.event-toggle {
    font-size: 20px;
    color: #666;
    transition: transform 0.3s;
}

.event-content {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 20px;
    background: white;
}

.event-content.collapsed {
    display: none;
}

.event-header.collapsed .event-toggle {
    transform: rotate(-90deg);
}

.no-galleries {
    text-align: center;
    color: #666;
    font-style: italic;
}

.gallery-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-preview {
    position: relative;
    width: 100%;
    height: 200px;
    background: #f0f0f0;
}

.gallery-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stack-indicator {
    position: absolute;
    top: -3px;
    right: -3px;
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    border: 2px solid #fff;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: -1;
}

.stack-indicator::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    border: 2px solid #fff;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: -1;
}

.gallery-info {
    padding: 15px;
    background: white;
}

.gallery-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.gallery-meta {
    font-size: 14px;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.download-btn {
    background: #28a745;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
}

.download-btn:hover {
    background: #1e7e34;
}

/* Gallery View Styles */
.gallery-view {
    margin-top: 30px;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.back-btn {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.back-btn:hover {
    background: #545b62;
}

.slideshow-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto 40px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.slide {
    display: none;
    width: 100%;
    height: 500px;
    cursor: pointer;
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.nav-btn:hover {
    background: rgba(0,0,0,0.8);
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

.slide-counter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
}

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

.grid-item {
    cursor: pointer;
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.3s;
}

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

.grid-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

/* Modal for full-size images */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    cursor: pointer;
}

.modal img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .container {
        padding: 20px;
    }
    
    .slideshow-container {
        height: 300px;
    }
    
    .slide {
        height: 300px;
    }
}

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