/* Gallery Modal Overlay */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 10;
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 1600px;
    height: 85%;
    max-height: 700px;
    border-radius: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
}

.gallery-model-title {
    margin-top: -10px;
    margin-bottom: -30px;
    color: white;
    font-weight: 600
}

.gallery-modal .close-btn {
    position: absolute;
    top: 25px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 25px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1;
}

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

.fullscreen-btn {
    position: absolute;
    bottom: 25px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1;
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.fullscreen-btn svg {
    width: 20px;
    height: 20px;
}

.fullscreen-btn img {
    width: 20px;
    height: 20px;
    /* backdrop-filter: none; */
}

/* Fullscreen mode styles */
.gallery-modal.fullscreen {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
}

.gallery-modal.fullscreen .modal-content {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    padding: 20px;
    background: transparent;
    backdrop-filter: none;
    border: none;
}

.gallery-modal.fullscreen .slider {
    height: 100%;
    padding-top: 10px;
}

.gallery-modal.fullscreen .slider .cards {
    height: calc(100% - 60px);
}

/* In fullscreen mode, show only the active card and hide others */
.gallery-modal.fullscreen .slider .card {
    width: 85%;
    height: 90%;
}

.gallery-modal.fullscreen .slider .card.active {
    transform: translatex(0) scale(1);
    opacity: 1;
    z-index: 1;
}

.gallery-modal.fullscreen .slider .card.left,
.gallery-modal.fullscreen .slider .card.right {
    opacity: 0;
    pointer-events: none;
    transform: translatex(0) scale(1);
}

.gallery-modal.fullscreen .gallery-model-title {
    font-size: 28px;
    margin-top: 10px;
    margin-bottom: 0;
}

/* Change image object-fit to contain in fullscreen for mobile/tablet */
/* .gallery-modal.fullscreen .slider img {
    object-fit: contain;
} */


input[type=radio] {
    display: none;
}

.slider .card {
    position: absolute;
    width: 50%;
    height: 95%;
    left: 0;
    right: 0;
    margin: auto;
    transition: transform .4s ease;
    cursor: grab;
}

.card h2 {
    font-family: "Open Sans", sans-serif;
    color: white;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    /* padding: 12px 16px; */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(3, 3, 3, 0.63);
    background-size: 100% 1px;
    background-position: 0px 0px, 0px 100%;
    background-repeat: no-repeat;
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 10%, rgb(255, 255, 255) 50%, rgb(255, 255, 255) 50%, rgba(255, 255, 255, 0) 90%), linear-gradient(90deg, rgba(255, 255, 255, 0) 10%, rgb(255, 255, 255) 50%, rgb(255, 255, 255) 50%, rgba(255, 255, 255, 0) 90%);
    transition: width 0.3s ease;
}

.card iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.slider {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    /* padding-top: 40px; */
}

.slider .cards {
    position: relative;
    width: 100%;
    height: 100%;
    margin-bottom: 20px;
}

.slider img {
    width: 100%;
    height: 100%;
    /* border-radius: 10px; */
    object-fit: cover;
}

.card.active {
    transform: translatex(0) scale(1);
    opacity: 1;
    z-index: 1;
}

.card.left {
    transform: translatex(-35%) scale(.85);
    opacity: .5;
    z-index: 0;
    pointer-events: none;
}

.card.right {
    transform: translatex(35%) scale(.85);
    opacity: .5;
    z-index: 0;
    pointer-events: none;
}

/* .card.active img {
    box-shadow: 0px 0px 5px 0px rgba(81, 81, 81, 0.47);
} */

/* Navigation arrows */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0);
    border: none;
    font-size: 25px;
    padding: 0px 10px 2px 10px;
    cursor: pointer;
    color: black;
    border-radius: 50%;
    transition: background 0.3s;
}



.nav-btn img {
    background: rgba(0, 0, 0, 0.2);
    filter: invert(1);
    border-radius: 50%;
}

/* .nav-btn img:hover {
    background: rgba(255, 255, 255, 0.87);
} */

.nav-btn.left {
    left: 15px;
}

.nav-btn.right {
    right: 15px;
}

/* Gallery Header Styles */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin-bottom: 20px; */
    flex-wrap: wrap;
    gap: 15px;
}

.gallery-model-title {
    margin: 0;
    color: white;
    font-weight: 600;
    font-size: 24px;
}

.gallery-type-selector {
    position: relative;
    margin-right: 50px;
    margin-top: 10px;
}

.gallery-type-selector select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    padding: 8px 35px 8px 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    appearance: none;
    min-width: 150px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.gallery-type-selector select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.gallery-type-selector select:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.7);
}

.gallery-type-selector select option {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
}

/* Custom dropdown arrow */
.gallery-type-selector::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid white;
    pointer-events: none;
    opacity: 0.7;
}

/* Fullscreen mode adjustments for gallery header */
.gallery-modal.fullscreen .gallery-header {
    margin-bottom: 15px;
}

.gallery-modal.fullscreen .gallery-model-title {
    font-size: 28px;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .modal-content {
        width: 100%;
        height: 70%;
        max-height: 500px;
        padding: 15px;
    }

    .gallery-model-title {
        margin-top: 0px;
        font-size: 14px;
        margin-bottom: -10px;
    }

    .close-btn {
        top: 10px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }

    .fullscreen-btn {
        bottom: 10px;
        right: 15px;
        width: 35px;
        height: 35px;
    }

    .fullscreen-btn svg {
        width: 18px;
        height: 18px;
    }


    /* changing for mobile lanscape  */
    .slider .cards {
        height: 100%;
        width: 70%;
    }

    .slider .card {
        width: 75%;
        height: 100%;
    }

    .card h2 {
        font-size: 16px;
        /* padding: 8px 12px; */
    }

    .nav-btn {
        font-size: 24px;
        padding: 8px 12px;
    }

    /* Fullscreen mode for tablets */
    .gallery-modal.fullscreen .slider .card {
        width: 95%;
        height: 90%;
    }

    .gallery-modal.fullscreen .slider .card.active {
        transform: translatex(0) scale(1);
        opacity: 1;
        z-index: 1;
    }

    .gallery-modal.fullscreen .slider .card.left,
    .gallery-modal.fullscreen .slider .card.right {
        opacity: 0;
        pointer-events: none;
        transform: translatex(0) scale(1);
    }

    .gallery-modal.fullscreen .gallery-model-title {
        font-size: 24px;
        margin-top: 10px;
    }

    .gallery-modal.fullscreen .nav-btn {
        font-size: 20px;
        padding: 6px 10px;
        width: 40px;
        height: 40px;
        z-index: 10;
        display: none;
        /* Hide navigation buttons in mobile fullscreen */
    }

    .nav-btn img {
        background: rgba(255, 255, 255, 0.2);
    }

    /* Adjust button positions for tablet fullscreen */
    .gallery-modal.fullscreen .close-btn {
        top: 4vh;
        right: 20px;
        z-index: 10;
    }

    .gallery-modal.fullscreen .fullscreen-btn {
        bottom: 30px;
        right: 20px;
        z-index: 10;
    }

    .gallery-modal.fullscreen .nav-btn.right {
        right: -3px;
        width: 45px !important;
        height: 52px !important;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        height: 60%;
        max-height: 400px;
        padding: 10px;
        border-radius: 15px;
    }

    .close-btn {
        top: 8px;
        right: 12px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }

    .fullscreen-btn {
        bottom: 8px;
        right: 12px;
        width: 30px;
        height: 30px;
    }

    .fullscreen-btn svg {
        width: 16px;
        height: 16px;
    }

    .slider {
        /* padding-top: 3vh; */
        height: calc(100% - 15px);
    }

    .slider .cards {
        height: 85%;
        width: 90%;
    }

    .slider .card {
        width: 80%;
        height: 100%;
    }

    .nav-btn {
        font-size: 20px;
        padding: 6px 10px;
    }

    .nav-btn img {
        background: rgba(255, 255, 255, 0.2);
    }

    .nav-btn.left {
        left: -15px;
    }

    .nav-btn.right {
        right: 0px;
        width: 45px !important;
        height: 52px !important;
    }

    /* Fullscreen mode for mobile */
    .gallery-modal.fullscreen .modal-content {
        padding: 10px;
    }

    .gallery-modal.fullscreen .slider .card {
        width: 98%;
        height: 85%;
    }

    .gallery-modal.fullscreen .slider .card.active {
        transform: translatex(0) scale(1);
        opacity: 1;
        z-index: 1;
    }

    .gallery-modal.fullscreen .slider .card.left,
    .gallery-modal.fullscreen .slider .card.right {
        opacity: 0;
        pointer-events: none;
        transform: translatex(0) scale(1);
    }

    .gallery-modal.fullscreen .gallery-model-title {
        font-size: 20px;
        margin-top: 5px;
    }

    .gallery-modal.fullscreen .nav-btn {
        font-size: 18px;
        padding: 6px 8px;
        width: 35px;
        height: 35px;
        z-index: 10;
        display: none;
        /* Hide navigation buttons in mobile fullscreen */
    }

    /* Adjust button positions for mobile fullscreen */
    .gallery-modal.fullscreen .close-btn {
        top: 20px;
        right: 15px;
        z-index: 10;
    }

    .gallery-modal.fullscreen .fullscreen-btn {
        bottom: 7vh;
        right: 15px;
        z-index: 10;
    }
}

/* Hide navigation buttons in mobile fullscreen for all orientations */
@media (max-width: 1024px) {

    .gallery-modal.fullscreen .nav-btn.left,
    .gallery-modal.fullscreen .nav-btn.right {
        display: none !important;
    }

    /* Expand gallery width when navigation buttons are hidden */
    .gallery-modal.fullscreen .slider .cards {
        width: 100%;
    }
}

/* Specifically target mobile devices in landscape mode */
@media (max-width: 1024px) and (orientation: landscape) {

    .gallery-modal.fullscreen .nav-btn.left,
    .gallery-modal.fullscreen .nav-btn.right {
        display: none !important;
    }

    .gallery-modal.fullscreen .close-btn {
        top: 7vh;
    }

    .gallery-modal .slider {
        padding-top: 7vh;
        height: calc(100% - 41px) !important;
    }

    .gallery-modal.fullscreen .slider {
        padding-top: 2vh;
        height: calc(100% - 41px) !important;
    }

}

/* Specifically target mobile devices in portrait mode */
@media (max-width: 1024px) and (orientation: portrait) {

    .gallery-modal.fullscreen .nav-btn.left,
    .gallery-modal.fullscreen .nav-btn.right {
        display: none !important;
    }

    /* changing for mobile lanscape  */
    .gallery-modal.fullscreen .slider {
        padding-top: 5vh;
        height: calc(100% - 20px) !important;
    }
}

/* Mobile responsive styles for gallery header */
@media (max-width: 1024px) {
    /* .gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 15px;
    } */

    .gallery-model-title {
        font-size: 18px;
    }

    .gallery-type-selector select {
        min-width: 120px;
        padding: 6px 30px 6px 10px;
        font-size: 13px;
    }

    .gallery-type-selector::after {
        right: 10px;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-top: 4px solid white;
    }

    .gallery-modal.fullscreen .gallery-model-title {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .gallery-header {
        margin-bottom: 10px;
    }

    .gallery-model-title {
        font-size: 16px;
    }

    .gallery-type-selector select {
        min-width: 110px;
        padding: 5px 25px 5px 8px;
        font-size: 12px;
    }

    .gallery-type-selector::after {
        right: 8px;
        border-left: 3px solid transparent;
        border-right: 3px solid transparent;
        border-top: 3px solid white;
    }

    .gallery-modal.fullscreen .gallery-model-title {
        font-size: 18px;
    }
}

/* iPad Portrait (820px wide) */
@media only screen and (min-device-width: 820px) and (max-device-width: 834px) and (orientation: portrait) {
    .fullscreen-btn {
        width: 50px;
        height: 50px;
    }

    .gallery-modal .close-btn {
        width: 30px;
        height: 35px;
        font-size: 18px;
    }

    .fullscreen-btn svg {
        position: absolute;
        width: 30px;
        height: 30px;
    }
}

/* iPad Landscape (1180px wide) */
@media only screen and (min-device-width: 760px) and (max-device-width: 1194px) and (min-device-height: 450px) and (orientation: landscape) {
    .fullscreen-btn {
        width: 50px;
        height: 50px;
    }

    .fullscreen-btn svg {
        position: absolute;
        width: 30px;
        height: 30px;
    }
}