.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ========================================
   EVENT FILTER BUTTONS
   ======================================== */
.event-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    padding: 1rem;
}

.event-filter-btn {
    background: var(--card-bg);
    color: var(--text-dark);
    padding: 0.8rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: var(--shadow-subtle);
}

.event-filter-btn:hover {
    border-color: var(--coral);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.event-filter-btn.active {
    background: var(--coral);
    color: var(--white);
    border-color: var(--coral);
}

/* ========================================
   GALLERY GRID
   ======================================== */
.gallery-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.gallery-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.gallery-card-image {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.gallery-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-card-image img {
    transform: scale(1.1);
}

.gallery-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(10, 37, 64, 0.95), transparent);
    color: var(--white);
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-card:hover .gallery-card-overlay {
    transform: translateY(0);
}

.gallery-card-overlay h3 {
    color: var(--coral);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.gallery-card-overlay p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ========================================
   NO GALLERY MESSAGE
   ======================================== */
.no-gallery {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: var(--shadow-subtle);
}

.no-gallery-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.no-gallery h2 {
    color: var(--coral);
    margin-bottom: 1rem;
}

.no-gallery p {
    color: var(--text-dark);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* ========================================
   GALLERY MODAL
   ======================================== */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
    padding: 2rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gallery-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: 95%;
    max-height: 95%;
}

.gallery-modal-content img {
    max-width: 80vw;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.gallery-modal-info {
    background: var(--card-bg);
    padding: 1.5rem 2rem;
    border-radius: 10px;
    text-align: center;
    max-width: 80vw;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.gallery-modal-info h2 {
    color: var(--navy-blue);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.modal-event-type {
    color: var(--coral);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.gallery-modal-info p {
    color: var(--text-dark);
    line-height: 1.6;
}

.gallery-modal-close {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--coral);
    color: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-close:hover {
    background: var(--white);
    color: var(--coral);
    transform: rotate(90deg);
}

.gallery-modal-prev,
.gallery-modal-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(232, 166, 135, 0.9);
    color: var(--white);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-prev:hover,
.gallery-modal-next:hover {
    background: var(--coral);
    transform: translateY(-50%) scale(1.1);
}

.gallery-modal-prev {
    left: 1.5rem;
}

.gallery-modal-next {
    right: 1.5rem;
}

/* ========================================
   TABLET RESPONSIVE (768px and below)
   ======================================== */
@media (max-width: 768px) {
    .gallery-container {
        padding: 1rem;
    }

    /* Event Filter */
    .event-filter {
        gap: 0.6rem;
        margin-bottom: 2rem;
        padding: 0.5rem;
    }

    .event-filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        border-radius: 20px;
    }

    /* Gallery Grid - 2 columns on tablet */
    .gallery-grid-new {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .gallery-card-image {
        height: 250px;
    }

    /* Always show overlay on mobile (no hover) */
    .gallery-card-overlay {
        transform: translateY(0);
        background: linear-gradient(to top, rgba(10, 37, 64, 0.9) 0%, rgba(10, 37, 64, 0.7) 50%, transparent 100%);
        padding: 1rem;
    }

    .gallery-card-overlay h3 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }

    .gallery-card-overlay p {
        font-size: 0.8rem;
    }

    /* Gallery Modal */
    .gallery-modal {
        padding: 1rem;
    }

    .gallery-modal-content {
        gap: 1rem;
    }

    .gallery-modal-content img {
        max-width: 95vw;
        max-height: 55vh;
        border-radius: 8px;
    }

    .gallery-modal-info {
        max-width: 95vw;
        padding: 1rem 1.5rem;
    }

    .gallery-modal-info h2 {
        font-size: 1.3rem;
    }

    .modal-event-type {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .gallery-modal-close {
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
    }

    .gallery-modal-prev,
    .gallery-modal-next {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }

    .gallery-modal-prev {
        left: 0.5rem;
    }

    .gallery-modal-next {
        right: 0.5rem;
    }

    /* No Gallery */
    .no-gallery {
        padding: 2rem 1rem;
    }

    .no-gallery-icon {
        font-size: 3.5rem;
    }

    .no-gallery h2 {
        font-size: 1.3rem;
    }

    .no-gallery p {
        font-size: 1rem;
    }
}

/* ========================================
   SMALL PHONE RESPONSIVE (480px and below)
   ======================================== */
@media (max-width: 480px) {
    /* Single column on small phones */
    .gallery-grid-new {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .gallery-card-image {
        height: 280px;
    }

    .event-filter {
        gap: 0.5rem;
    }

    .event-filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        flex: 1 1 auto;
        text-align: center;
        min-width: calc(50% - 0.5rem);
    }

    /* Make "All Events" full width */
    .event-filter-btn:first-child {
        min-width: 100%;
    }

    .gallery-modal-content img {
        max-height: 50vh;
    }

    .gallery-modal-info h2 {
        font-size: 1.1rem;
    }

    .gallery-modal-prev,
    .gallery-modal-next {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATIONS
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* Always show overlay on touch devices */
    .gallery-card-overlay {
        transform: translateY(0);
        background: linear-gradient(to top, rgba(10, 37, 64, 0.85) 0%, rgba(10, 37, 64, 0.5) 60%, transparent 100%);
    }

    .gallery-card:hover {
        transform: none;
    }

    .gallery-card:active {
        transform: scale(0.98);
    }
}