/* ========== GALLERY PAGE STYLES ========== */

/* Hero */
.gallery-hero {
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-terracotta) 0%, var(--color-terracotta-dark) 100%);
    background-image: var(--paper-texture), linear-gradient(135deg, var(--color-terracotta) 0%, var(--color-terracotta-dark) 100%);
    padding-top: 80px;
    text-align: center;
}

.gallery-hero-content h1 {
    font-family: 'Great Vibes', cursive;
    font-size: 4rem;
    color: var(--color-white);
    margin-bottom: 15px;
}

.gallery-hero-content p {
    font-size: 1.2rem;
    color: var(--color-cream);
    letter-spacing: 2px;
}

/* Upload Section */
.section-upload {
    background-color: var(--color-cream);
    background-image: var(--paper-texture);
}

.upload-container {
    max-width: 600px;
    margin: 0 auto;
}

.upload-form {
    background: var(--color-white);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.upload-form select {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid rgba(205, 122, 88, 0.3);
    border-radius: 10px;
    background: var(--color-white);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.05rem;
    color: var(--color-brown);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b7355' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.upload-form select:focus {
    outline: none;
    border-color: var(--color-terracotta);
    box-shadow: 0 0 0 4px rgba(205, 122, 88, 0.15);
}

/* Upload Area */
.upload-area {
    border: 2px dashed rgba(205, 122, 88, 0.4);
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    background: rgba(205, 122, 88, 0.03);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--color-terracotta);
    background: rgba(205, 122, 88, 0.08);
}

.upload-placeholder svg {
    width: 50px;
    height: 50px;
    color: var(--color-terracotta);
    margin-bottom: 15px;
    opacity: 0.7;
}

.upload-placeholder p {
    font-size: 1.1rem;
    color: var(--color-brown);
    margin-bottom: 5px;
}

.upload-placeholder span {
    font-size: 0.9rem;
    color: var(--color-gold);
}

/* Upload Preview */
.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.upload-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.upload-preview-item img,
.upload-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview-item .remove-file {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-preview-item .video-indicator {
    position: absolute;
    bottom: 3px;
    left: 3px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
}

/* Upload Progress */
.upload-progress {
    display: none;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.upload-progress.active {
    display: flex;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(205, 122, 88, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-terracotta);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--color-gold);
    min-width: 40px;
}

/* Gallery Section */
.section-gallery {
    background-color: var(--color-white);
    background-image: var(--paper-texture);
    min-height: 50vh;
}

/* Gallery Tabs */
.gallery-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.gallery-tab {
    padding: 12px 25px;
    border: 2px solid var(--color-terracotta);
    background: transparent;
    color: var(--color-terracotta);
    border-radius: 50px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-tab:hover,
.gallery-tab.active {
    background: var(--color-terracotta);
    color: var(--color-white);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--color-gold);
}

.gallery-empty svg {
    width: 80px;
    height: 80px;
    opacity: 0.4;
    margin-bottom: 20px;
}

.gallery-empty p {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: var(--color-brown);
}

.gallery-empty span {
    font-size: 1rem;
}

/* Gallery Item */
.gallery-item {
    background: var(--color-cream);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(205, 122, 88, 0.15);
}

.gallery-item-media {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
}

.gallery-item-media img,
.gallery-item-media video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.gallery-item-video-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.gallery-item-video-badge svg {
    width: 14px;
    height: 14px;
}

.gallery-item-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--color-terracotta);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.gallery-item-info {
    padding: 20px;
}

.gallery-item-author {
    font-size: 0.85rem;
    color: var(--color-terracotta);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-item-author svg {
    width: 16px;
    height: 16px;
}

.gallery-item-comment {
    font-size: 1rem;
    color: var(--color-brown);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Load More Button */
.load-more-btn {
    display: block;
    margin: 40px auto 0;
    padding: 15px 40px;
    background: transparent;
    color: var(--color-terracotta);
    border: 2px solid var(--color-terracotta);
    border-radius: 50px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: var(--color-terracotta);
    color: var(--color-white);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
}

.lightbox.active {
    display: flex;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-delete {
    position: absolute;
    top: 20px;
    right: 80px;
    background: rgba(220, 53, 69, 0.8);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-delete svg {
    width: 20px;
    height: 20px;
}

.lightbox-delete:hover {
    opacity: 1;
    background: rgba(220, 53, 69, 1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev svg,
.lightbox-next svg {
    width: 24px;
    height: 24px;
}

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

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 10px;
}

.lightbox-info {
    text-align: center;
    margin-top: 20px;
    color: white;
}

.lightbox-author {
    font-size: 1rem;
    color: var(--color-terracotta);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.lightbox-comment {
    font-size: 1.1rem;
    color: var(--color-cream);
    max-width: 600px;
    margin: 0 auto;
}

/* Nav Active State */
.nav-links a.active {
    color: var(--color-terracotta);
}

.nav-links a.active::after {
    width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-hero-content h1 {
        font-size: 2.8rem;
    }

    .upload-form {
        padding: 25px 20px;
    }

    .gallery-tabs {
        gap: 8px;
    }

    .gallery-tab {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

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

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .gallery-hero {
        min-height: 30vh;
    }

    .gallery-hero-content h1 {
        font-size: 2.2rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
