/**
 * Activity Gallery Styles
 * Photo gallery and lightbox for activities
 * Version: 1.0
 * Date: 2025-11-27
 */

/* ===== Gallery Section ===== */

.activity-gallery-section {
    margin-top: 20px;
    padding: 20px;
    background: var(--card-bg, white);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.gallery-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-title i {
    color: var(--primary-color, #6366f1);
}

.gallery-count {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    margin-left: 8px;
}

/* ===== Upload Button ===== */

.gallery-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary-color, #6366f1);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gallery-upload-btn:hover {
    background: var(--primary-hover, #5558e3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.gallery-upload-btn:disabled {
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text-secondary, #64748b);
    cursor: not-allowed;
    transform: none;
}

.gallery-upload-input {
    display: none;
}

/* ===== Gallery Grid ===== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.gallery-photo-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary, #f8fafc);
}

.gallery-photo-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.gallery-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* ===== Photo Info Overlay ===== */

.gallery-photo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-photo-item:hover .gallery-photo-info {
    opacity: 1;
}

.gallery-photo-uploader {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gallery-photo-date {
    opacity: 0.8;
}

/* ===== Photo Caption ===== */

.gallery-photo-caption {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 13px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-photo-item:hover .gallery-photo-caption {
    opacity: 1;
}

/* ===== Delete Button ===== */

.gallery-photo-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.gallery-photo-item:hover .gallery-photo-delete {
    opacity: 1;
}

.gallery-photo-delete:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* ===== Empty State ===== */

.gallery-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary, #64748b);
}

.gallery-empty i {
    font-size: 64px;
    color: var(--text-tertiary, #cbd5e1);
    margin-bottom: 16px;
}

.gallery-empty p {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary, #64748b);
}

.gallery-empty span {
    font-size: 14px;
    color: var(--text-tertiary, #94a3b8);
}

/* ===== Upload Progress ===== */

.gallery-upload-progress {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
}

.progress-text {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    margin-bottom: 8px;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary, #e2e8f0);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-color, #6366f1);
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* ===== Lightbox ===== */

.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-image-container {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#lightboxImage {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-info {
    text-align: center;
    color: white;
}

.lightbox-caption {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 12px;
}

.lightbox-meta {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.lightbox-counter {
    font-weight: 600;
    color: white;
}

/* ===== Dark Theme ===== */

body.dark-theme .activity-gallery-section {
    background: var(--card-bg-dark, #1e293b);
    border-color: var(--border-color-dark, #334155);
}

body.dark-theme .gallery-title {
    color: var(--text-primary-dark, #f1f5f9);
}

body.dark-theme .gallery-photo-item {
    background: var(--bg-secondary-dark, #0f172a);
}

body.dark-theme .gallery-upload-progress {
    background: var(--bg-secondary-dark, #0f172a);
    border-color: var(--border-color-dark, #334155);
}

/* ===== Christmas Theme ===== */

body.christmas-theme .gallery-upload-btn {
    background: #10b981;
}

body.christmas-theme .gallery-upload-btn:hover {
    background: #059669;
}

body.christmas-theme .activity-gallery-section {
    border-color: #fbbf24;
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .gallery-upload-btn {
        width: 100%;
        justify-content: center;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    #lightboxImage {
        max-height: 60vh;
    }
    
    .lightbox-caption {
        font-size: 16px;
    }
    
    .lightbox-meta {
        font-size: 12px;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .activity-gallery-section {
        padding: 16px;
    }
}
