﻿/* Gallery CSS - Matches Home page exactly */

/* Fix: Remove max-width constraint to match Home page */
.cave-booking .container {
   /* max-width: 1000px;*/
    margin: 0 auto;
    padding: 2rem;
    background: var(--container-bg, #fcfaf7);
    border-radius: 2.5rem;
    box-shadow: 0 30px 50px -20px rgba(0,0,0,0.2);
}

/* --- Match Home page card styles exactly --- */
.gallery-card {
    border: 1px solid var(--card-border, #6A8D92);
    border-radius: 1.2rem;
    overflow: hidden;
    transition: 0.2s;
    background: var(--card-bg, #FAF6EF);
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

    .gallery-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px -10px rgba(0,0,0,0.12);
        border-color: var(--card-title);
    }

    .gallery-card .card-img-top {
        width: 100%;
        height: 200px;
        object-fit: cover;
        background: #f0f0f0;
    }

    .gallery-card .card-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0.5rem 1.2rem 0.5rem;
        text-align: center;
    }

    .gallery-card .card-title {
        font-size: 1.6rem;
        font-weight: 600;
        color: var(--card-title);
        margin-bottom: 0rem;
        padding-bottom: 0.5rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-decoration: none !important;
    }

    .gallery-card .card-link,
    .gallery-card .card-link:hover,
    .gallery-card .card-link:focus {
        text-decoration: none !important;
        color: inherit;
    }

.btn-back {
    background: #e5dfd7;
    color: #385542;
    border-radius: 40px;
    border: none;
    padding: 0.5rem 1.5rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

    .btn-back:hover {
        background: #d4cbbc;
        transform: translateY(-2px);
        color: #385542;
    }

.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

    .empty-state i {
        font-size: 3rem;
        color: #cdbfb0;
        margin-bottom: 1rem;
    }

    .empty-state h5 {
        color: #2f4a3b;
        margin-bottom: 0.5rem;
    }

    .empty-state p {
        color: #8f9e95;
    }

/* --- Gallery Modal - NO SCROLLING --- */
.gallery-modal .modal-dialog {
    max-width: 95vw;
    width: 95vw;
    margin: 0.5rem auto;
}

.gallery-modal .modal-content {
    border-radius: 2rem;
    overflow: hidden;
    max-height: 95vh;
}

.gallery-modal .modal-header {
    border-bottom: 1px solid #e0d6cc;
    padding: 0.5rem 1.5rem;
    flex-shrink: 0;
}

    .gallery-modal .modal-header .btn-close {
        font-size: 1.5rem;
    }

.gallery-modal .modal-title {
    font-size: 1.3rem;
    color: #2f4a3b;
    font-weight: 600;
}

.gallery-modal .modal-body {
    padding: 0.5rem 1rem;
    flex: 1;
    overflow: visible;
}

.gallery-modal .modal-footer {
    flex-shrink: 0;
    padding: 0.3rem 1.5rem;
    border-top: 1px solid #e0d6cc;
}

/* --- Carousel --- */
.gallery-carousel {
    border-radius: 1rem;
    overflow: hidden;
    background: #f5f3f0;
    position: relative;
}

    .gallery-carousel .carousel-inner {
        position: relative;
        width: 100%;
        overflow: hidden;
        background: #f5f3f0;
        min-height: 150px;
    }

        .gallery-carousel .carousel-inner img {
            width: 100%;
            height: auto;
            max-height: 55vh;
            object-fit: contain;
            background: #f5f3f0;
        }

    .gallery-carousel .carousel-item {
        display: none;
        position: relative;
        transition: transform 0.6s ease-in-out;
    }

        .gallery-carousel .carousel-item.active {
            display: block;
        }

    .gallery-carousel .carousel-control-prev,
    .gallery-carousel .carousel-control-next {
        position: absolute;
        top: 0;
        bottom: 0;
        z-index: 5;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 10%;
        color: #fff;
        text-align: center;
        opacity: 0.5;
        transition: opacity 0.15s ease;
        background: rgba(0,0,0,0.2);
        border: none;
        cursor: pointer;
    }

    .gallery-carousel .carousel-control-prev {
        left: 0;
    }

    .gallery-carousel .carousel-control-next {
        right: 0;
    }

        .gallery-carousel .carousel-control-prev:hover,
        .gallery-carousel .carousel-control-next:hover {
            opacity: 0.9;
            background: rgba(0,0,0,0.3);
        }

    .gallery-carousel .carousel-control-prev-icon,
    .gallery-carousel .carousel-control-next-icon {
        display: inline-block;
        width: 1.8rem;
        height: 1.8rem;
        background-repeat: no-repeat;
        background-position: 50%;
        background-size: 100% 100%;
    }

    .gallery-carousel .carousel-control-prev-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e");
    }

    .gallery-carousel .carousel-control-next-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    }

/* --- Custom indicators --- */
#galleryIndicators {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    padding: 0;
    margin: 0 15% 0.5rem 15%;
    list-style: none;
    gap: 6px;
    flex-wrap: wrap;
    pointer-events: none;
}

    #galleryIndicators button {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        border: 2px solid rgba(255,255,255,0.9);
        margin: 0;
        padding: 0;
        background: rgba(255,255,255,0.4);
        opacity: 0.7;
        transition: all 0.3s ease;
        text-indent: -9999px;
        cursor: pointer;
        flex-shrink: 0;
        pointer-events: auto;
        box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    }

        #galleryIndicators button.active {
            background: #3b5e4a;
            opacity: 1;
            border-color: #3b5e4a;
            transform: scale(1.3);
            box-shadow: 0 2px 8px rgba(59, 94, 74, 0.5);
        }

        #galleryIndicators button:hover {
            opacity: 1;
            transform: scale(1.15);
        }

/* --- Thumbnail Strip --- */
.gallery-thumbnails-strip {
    display: flex;
    gap: 5px;
    padding: 8px 0 3px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

    .gallery-thumbnails-strip::-webkit-scrollbar {
        height: 3px;
    }

    .gallery-thumbnails-strip::-webkit-scrollbar-track {
        background: #f0ece7;
        border-radius: 4px;
    }

    .gallery-thumbnails-strip::-webkit-scrollbar-thumb {
        background: var(--accent-color, #3b5e4a);
        border-radius: 4px;
    }

.gallery-thumbnail-item {
    flex: 0 0 60px;
    height: 45px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    opacity: 0.6;
    position: relative;
}

    .gallery-thumbnail-item:hover {
        opacity: 0.9;
        transform: scale(1.05);
    }

    .gallery-thumbnail-item.active {
        border-color: var(--accent-color, #3b5e4a);
        opacity: 1;
        transform: scale(1.05);
        box-shadow: 0 2px 8px rgba(59, 94, 74, 0.3);
    }

    .gallery-thumbnail-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .gallery-thumbnail-item .thumb-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .gallery-thumbnail-item:hover .thumb-overlay {
        opacity: 1;
    }

    .gallery-thumbnail-item .thumb-overlay i {
        color: white;
        font-size: 12px;
    }

/* --- Image info --- */
#imageInfo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0 0 0;
    flex-wrap: wrap;
    gap: 4px;
}

#imageName {
    font-weight: 500;
    color: #2f4a3b;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
}

#imageCounter {
    color: #7b8d81;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.no-images {
    text-align: center;
    color: #8f9e95;
    padding: 2rem;
    background: #f5f3f0;
    border-radius: 1rem;
}

    .no-images i {
        font-size: 2.5rem;
        display: block;
        margin-bottom: 0.5rem;
    }

.spinner-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 200px;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .cave-booking .container {
        max-width: 100%;
        padding: 1.5rem;
    }

    .gallery-modal .modal-dialog {
        max-width: 98vw;
        width: 98vw;
    }

    .gallery-modal .carousel-inner img {
        max-height: 45vh;
    }
}

@media (max-width: 768px) {
    .gallery-card .card-title {
        font-size: 1.3rem;
    }

    .gallery-card .card-img-top {
        height: 150px;
    }

    .gallery-modal .modal-title {
        font-size: 1.1rem;
    }

    .gallery-modal .modal-dialog {
        max-width: 100vw;
        width: 100vw;
        margin: 0;
        max-height: 100vh;
    }

    .gallery-modal .modal-content {
        border-radius: 0;
        max-height: 100vh;
    }

    .gallery-modal .modal-body {
        padding: 0.3rem 0.5rem;
    }

    .gallery-modal .modal-header {
        padding: 0.3rem 1rem;
    }

    .gallery-modal .modal-footer {
        padding: 0.2rem 1rem;
    }

    .gallery-carousel .carousel-inner img {
        max-height: 40vh;
    }

    .gallery-carousel .carousel-control-prev,
    .gallery-carousel .carousel-control-next {
        width: 10%;
    }

    #galleryIndicators {
        margin: 0 10% 0.4rem 10%;
    }

        #galleryIndicators button {
            width: 10px;
            height: 10px;
        }

    .gallery-thumbnail-item {
        flex: 0 0 50px;
        height: 38px;
    }
}

@media (max-width: 576px) {
    .cave-booking .container {
        padding: 1rem;
        border-radius: 1.5rem;
    }

    .gallery-card .card-title {
        font-size: 1.1rem;
    }

    .gallery-card .card-img-top {
        height: 120px;
    }

    .gallery-modal .modal-title {
        font-size: 0.9rem;
    }

    .gallery-modal .modal-body {
        padding: 0.2rem 0.3rem;
    }

    .gallery-modal .modal-header {
        padding: 0.2rem 0.8rem;
    }

    .gallery-modal .modal-footer {
        padding: 0.15rem 0.8rem;
    }

    .gallery-carousel .carousel-inner img {
        max-height: 35vh;
    }

    .gallery-carousel .carousel-control-prev,
    .gallery-carousel .carousel-control-next {
        width: 12%;
    }

    .spinner-overlay {
        min-height: 120px;
        padding: 1rem;
    }

    #imageInfo {
        padding: 2px 0 0 0;
    }

    #imageName {
        font-size: 0.7rem;
        max-width: 60%;
    }

    #imageCounter {
        font-size: 0.65rem;
    }

    #galleryIndicators {
        margin: 0 8% 0.3rem 8%;
        gap: 4px;
    }

        #galleryIndicators button {
            width: 8px;
            height: 8px;
        }

    .gallery-thumbnail-item {
        flex: 0 0 40px;
        height: 30px;
    }
}
