﻿/* ===== CONTAINER & HEADER ===== */
.gallery-container {
    padding: 120px 20px 50px 20px; /* Tránh bị navbar đè */
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-header h2 {
    font-size: 3rem;
    font-family: 'Playfair Display', serif;
    margin-bottom: 15px;
}

.gallery-header p {
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

    .filter-bar a {
        padding: 8px 24px;
        border-radius: 30px;
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.1);
        color: white;
        text-decoration: none;
        transition: 0.3s ease;
        backdrop-filter: blur(10px);
    }

        .filter-bar a:hover, .filter-bar a.active {
            background: #00c6ff;
            color: #0f172a;
            font-weight: 500;
            box-shadow: 0 0 15px rgba(0, 198, 255, 0.4);
        }

.upload-btn {
    background: rgba(0, 198, 255, 0.2) !important;
    border-color: #00c6ff !important;
    color: #00c6ff !important;
}

/* ===== MASONRY GRID (KHÔNG LÀM MÉO ẢNH) ===== */
.masonry-grid {
    column-count: 4; /* Chia 4 cột trên PC */
    column-gap: 20px;
}

@media (max-width: 1024px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        column-count: 1;
    }
}

/* ===== CARD ===== */
.card {
    position: relative;
    break-inside: avoid; /* Ngăn ảnh bị cắt đôi giữa 2 cột */
    margin-bottom: 20px;
    border-radius: 16px;
    overflow: hidden;
    cursor: zoom-in;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

    .card img {
        width: 100%;
        display: block; /* Quan trọng để fix lỗi margin dưới của thẻ img */
        transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    }

    .card:hover img {
        transform: scale(1.05);
        filter: brightness(0.8);
    }

/* OVERLAY TEXT */
.overlay {
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    padding: 30px 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    transition: 0.4s ease;
    opacity: 0;
    pointer-events: none;
}

.card:hover .overlay {
    bottom: 0;
    opacity: 1;
}

/* DELETE BUTTON ADMIN */
.delete-form {
    position: absolute;
    top: 15px;
    right: 15px;
    opacity: 0;
    transition: 0.3s;
}

.card:hover .delete-form {
    opacity: 1;
}

.btn-delete {
    background: rgba(255, 59, 48, 0.8);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: 0.3s;
}

    .btn-delete:hover {
        background: #ff3b30;
        transform: scale(1.1);
    }


/* ===== CINEMATIC LIGHTBOX ===== */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(15px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    #lightbox.show {
        display: flex;
        opacity: 1;
    }

.lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
}

#lightbox-img {
    max-width: 85vw;
    max-height: 85vh;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    user-select: none;
}

/* Controls */
.lightbox-close {
    position: fixed;
    top: 25px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

    .lightbox-close:hover {
        color: #ff3b30;
        transform: rotate(90deg);
    }

.arrow {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
}

    .arrow:hover {
        background: white;
        color: black;
    }

    .arrow.left {
        left: -70px;
    }

    .arrow.right {
        right: -70px;
    }

@media (max-width: 768px) {
    .arrow.left {
        left: 10px;
    }

    .arrow.right {
        right: 10px;
    }
}
.upload-btn {
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    color: white;
    text-decoration: none;
}

.card {
    position: relative;
    overflow: hidden;
}

.admin-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: 0.3s;
}

.card:hover .admin-actions {
    opacity: 1;
    transform: translateY(0);
}

/* Nút chung */
.admin-actions a,
.admin-actions button {
    background: rgba(0,0,0,0.6);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: 0.3s;
}

    /* Hover hiệu ứng */
    .admin-actions a:hover {
        background: #00c6ff;
    }

    .admin-actions button:hover {
        background: #ff4d4d;
    }