/* ============================================
   CSS VARIABLES (Required for gallery styles)
   ============================================ */
:root {
    --primary-red: #fc0404;
    --dark-bg: #1b1f22;
    --light-gray: #212529;
    --text-white: #ffffff;
    --text-gray: #b0b0b0;
    --black: #000000;
}

/* ============================================
   EXPANDABLE GALLERY STYLES
   ============================================ */
.expandable-gallery-wrapper {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-bottom: 40px;
}

.gallery-group {
    width: 100%;
}

.expandable-gallery {
    display: flex;
    gap: 16px;
    height: 384px;
    width: 100%;
}

.gallery-item-expandable {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 10px;
    flex: 1;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item-expandable:hover {
    flex: 2;
}

.gallery-img-expandable {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.gallery-item-expandable:hover .gallery-img-expandable {
    transform: scale(1.05) translateZ(0);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item-expandable:hover .gallery-overlay {
    opacity: 1;
}

/* ============================================
   GALLERY MODAL STYLES
   ============================================ */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000;
    align-items: center;
    justify-content: center;
}

.gallery-modal.active {
    display: flex;
}

.gallery-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.gallery-modal-content {
    position: relative;
    z-index: 20001;
    width: 90%;
    max-width: 1000px;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20005;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: var(--text-white);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.gallery-modal-close:hover {
    background: rgba(252, 4, 4, 0.8);
    transform: rotate(90deg);
}

.gallery-modal-close svg {
    width: 24px;
    height: 24px;
}

.gallery-modal-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
}

.gallery-modal-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: imageSlideIn 0.3s ease;
}

@keyframes imageSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20002;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: var(--text-white);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.gallery-nav-btn:hover {
    background: rgba(252, 4, 4, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav-btn svg {
    width: 28px;
    height: 28px;
}

.gallery-nav-prev {
    left: 20px;
}

.gallery-nav-next {
    right: 20px;
}

.gallery-modal-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-white);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 20002;
}

/* ============================================
   GALLERY SECTION
   ============================================ */
.gallery-section {
    background-color: var(--dark-bg);
    padding: 100px 0;
    position: relative;
}

/* Gallery Header */
.gallery-header {
    text-align: center;
    margin-bottom: 50px;
}

.gallery-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: 3px;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
    padding-bottom: 20px;
}

.gallery-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    transform: none;
    width: 150px;
    height: 5px;
    background: linear-gradient(to right, var(--primary-red), transparent);
}

.gallery-subtitle {
    font-size: 1.1rem;
    color: var(--text-gray);
    font-weight: 400;
    margin-top: 10px;
    margin-bottom: 0;
}

/* Gallery Buttons Container */
.gallery-buttons {
    max-width: 600px;
    margin: 0 auto;
}

/* Instagram Button */
.btn-instagram {
    border-width: 2px;
    padding: 12px 30px;
    border-radius: 50px;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-instagram:hover {
    background: #d62976;
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    border-color: transparent;
    box-shadow: 0 10px 30px rgba(214, 41, 118, 0.4);
    transform: translateY(-3px);
}

/* Instagram Button Custom */
.btn-instagram-custom {
    background: transparent;
    color: var(--text-white);
    border: 2px solid var(--text-white);
    padding: 12px 30px;
    border-radius: 50px;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    border-width: 2px;
}

.btn-instagram-custom:hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    border-color: transparent;
    color: white;
    box-shadow: 0 10px 30px rgba(214, 41, 118, 0.4);
    transform: translateY(-3px);
}

.btn-instagram-custom i {
    font-size: 1.1rem;
}

/* Watch Now Button */
.btn-watch-now {
    background: var(--primary-red);
    color: var(--text-white);
    border: 2px solid var(--primary-red);
    padding: 12px 30px;
    border-radius: 50px;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-watch-now:hover {
    background: transparent;
    color: var(--primary-red);
    border-color: var(--primary-red);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(252, 4, 4, 0.4);
}

.btn-watch-now i {
    font-size: 1.1rem;
}

/* ============================================
   VIDEO MODAL
   ============================================ */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 120000;
    /* above navbar */
    align-items: center;
    justify-content: center;
}

.video-modal.active {
    display: flex;
}

.video-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
}

.video-modal-content {
    position: relative;
    z-index: 120001;
    width: 90%;
    max-width: 1000px;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.video-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: var(--text-white);
    font-size: 1.6rem;
    cursor: pointer;
    z-index: 120002;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.video-modal-close:hover {
    color: var(--primary-red);
    transform: rotate(90deg);
}

.video-wrapper {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(252, 4, 4, 0.3);
    position: relative;
}

.video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
    max-height: 80vh;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet (max-width: 992px) */
@media (max-width: 992px) {

    .services-section,
    .gallery-section {
        padding: 80px 0;
    }

    .gallery-section .section-title {
        font-size: 2.5rem;
    }

    .gallery-cta {
        margin-top: 60px;
        padding: 50px 40px;
    }

    .gallery-cta-title {
        font-size: 2rem;
    }

    .expandable-gallery {
        height: 300px;
    }
}

/* Tablet (max-width: 768px) */
@media (max-width: 768px) {
    .gallery-section {
        padding: 60px 0;
    }

    .gallery-header {
        text-align: left;
        padding: 0;
    }

    .gallery-title {
        font-size: 2rem;
        letter-spacing: 2px;
        display: inline-block;
        text-align: left;
    }

    .gallery-subtitle {
        font-size: 1rem;
        text-align: left;
        padding: 0;
    }

    .gallery-section .section-title {
        font-size: 2.5rem;
    }

    .gallery-cta {
        margin-top: 60px;
        padding: 50px 40px;
    }

    .gallery-cta-title {
        font-size: 2rem;
    }

    /* Expandable Gallery Responsive */
    .expandable-gallery {
        height: 250px;
        gap: 12px;
    }

    .gallery-modal-content {
        width: 95%;
        height: 85vh;
    }

    .gallery-modal-close {
        top: 20px;
        right: 20px;
    }

    .gallery-nav-prev {
        left: 10px;
    }

    .gallery-nav-next {
        right: 10px;
    }

    /* Reduce button width on mobile and ensure centering */

    .btn-instagram-custom,
    .btn-watch-now {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
        flex: 0 0 auto;
        justify-content: center;
        margin-bottom: 15px;
    }

    /* Ensure button container stays centered */
    .gallery-buttons {
        align-items: center;
        flex-direction: column;
        width: 100%;
        padding: 0;
    }

    .btn-instagram {
        justify-content: center;
        margin-bottom: 15px;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .video-wrapper video {
        max-height: 90vh;
    }

    .expandable-gallery {
        height: 180px;
    }
}

/* Small Mobile (max-width: 576px) */
@media (max-width: 576px) {
    .gallery-section .section-title {
        font-size: 1.75rem;
    }

    .gallery-cta-title {
        font-size: 1.5rem;
    }

    .gallery-cta {
        padding: 30px 20px;
    }

    .video-modal-close {
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.8);
        border-radius: 50%;
    }

    .video-wrapper {
        border-radius: 8px;
    }

    .btn-instagram-custom,
    .btn-watch-now {
        font-size: 0.9rem;
        padding: 10px 20px;
        /* Reduced padding as requested */
    }

    .btn-instagram-custom i,
    .btn-watch-now i {
        font-size: 1rem;
    }

    /* Expandable Gallery Mobile */
    .expandable-gallery {
        height: auto !important;
        /* Force auto height */
        flex-direction: row;
        /* Allow side-by-side */
        flex-wrap: wrap;
        gap: 10px;
        /* Spacing between images */
    }

    .gallery-item-expandable {
        flex: none !important;
        /* Disable flex growing */
        width: calc(50% - 5px);
        /* 2 items per row (accounting for 10px gap) */
        height: 150px;
        /* Adjust height for 2-col look */
        border-radius: 12px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        margin-bottom: 0;
    }

    .gallery-img-expandable {
        object-fit: cover;
    }

    .gallery-overlay {
        opacity: 0 !important;
        /* Hide overlay on mobile */
    }

    .gallery-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        background: black;
    }

    .gallery-modal-close {
        width: 45px;
        /* Larger touch target */
        height: 45px;
        top: 20px;
        right: 20px;
        background: rgba(0, 0, 0, 0.6);
        z-index: 20005;
    }

    .gallery-modal-img {
        object-fit: contain;
    }

    .gallery-nav-btn {
        width: 40px;
        height: 40px;
        background: rgba(0, 0, 0, 0.3);
    }

    .gallery-nav-prev {
        left: 10px;
    }

    .gallery-nav-next {
        right: 10px;
    }

    .gallery-modal-counter {
        font-size: 0.8rem;
        padding: 5px 12px;
        bottom: 20px;
    }

    /* Buttons Fix */
    .gallery-buttons {
        display: flex;
        flex-direction: column;
        gap: 15px;
        width: 80%;
        margin: 0 auto;
    }

    .btn-instagram-custom,
    .btn-watch-now {
        width: auto;
        /* Allow button to size to content */
        min-width: 180px;
        /* Optional: minimum width for tappability */
        justify-content: center;
        margin: 0;
    }
}