/* ================================================================
   GiftWeb Reels Gallery — Frontend Styles v1.1 (9:16 Portrait)
   ================================================================ */

:root {
    --gwvg-radius:     14px;
    --gwvg-modal-z:    99999;
    --gwvg-play-size:  52px;
    --gwvg-gold:       #c9952a;
    --gwvg-easing:     cubic-bezier(.4,0,.2,1);
    --gwvg-transition: all .28s var(--gwvg-easing);
    --gwvg-shadow:     0 6px 28px rgba(0,0,0,.22);
    --gwvg-nav-size:   40px;
}

/* ================================================================
   WRAPPER
   ================================================================ */

.gwvg-gallery-wrap {
    position: relative;
    width: 100%;
    padding: 4px 0 40px;
    box-sizing: border-box;
}

/* ================================================================
   SWIPER — side overflow reveals prev/next peeking cards
   ================================================================ */

.gwvg-swiper {
    padding: 8px 52px 14px !important;
    overflow: visible !important;
    box-sizing: border-box;
}

.gwvg-swiper .swiper-wrapper {
    align-items: stretch;
}

/* Clip the overflow on the outer wrapper so peeking looks clean */
.gwvg-gallery-wrap .swiper {
    overflow: hidden !important;
    border-radius: 4px;
}

/* ================================================================
   9:16 PORTRAIT CARD
   ================================================================ */

.gwvg-reel-card {
    position: relative;
    border-radius: var(--gwvg-radius);
    overflow: hidden;
    box-shadow: var(--gwvg-shadow);
    background: #1a1220;
    cursor: pointer;
    transition: var(--gwvg-transition);
    -webkit-tap-highlight-color: transparent;
    /* strict 9:16 portrait */
    aspect-ratio: 9 / 16;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.gwvg-reel-card:hover {
    transform: translateY(-6px) scale(1.025);
    box-shadow: 0 18px 52px rgba(0,0,0,.34);
}

/* ----------------------------------------------------------------
   Thumbnail area — fills the card body
   ---------------------------------------------------------------- */

.gwvg-thumb-wrap {
    position: relative;
    flex: 1 1 auto;
    overflow: hidden;
    min-height: 0;
    background: linear-gradient(160deg, #1a1220 0%, #2d1b3d 50%, #1a0f2e 100%);
}

.gwvg-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform .45s var(--gwvg-easing);
}

.gwvg-reel-card:hover .gwvg-thumb-img {
    transform: scale(1.07);
}

.gwvg-thumb-placeholder-fe {
    min-height: 180px;
}

/* ----------------------------------------------------------------
   Play overlay
   ---------------------------------------------------------------- */

.gwvg-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(
        ellipse at center,
        rgba(0,0,0,.06) 0%,
        rgba(0,0,0,.28) 100%
    );
    transition: background .25s ease;
}

.gwvg-reel-card:hover .gwvg-play-overlay {
    background: radial-gradient(
        ellipse at center,
        rgba(0,0,0,.02) 0%,
        rgba(0,0,0,.16) 100%
    );
}

.gwvg-play-btn {
    width: var(--gwvg-play-size);
    height: var(--gwvg-play-size);
    border-radius: 50%;
    background: rgba(255,255,255,.90);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #111;
    box-shadow: 0 4px 18px rgba(0,0,0,.38);
    transition: var(--gwvg-transition);
    padding-left: 3px;
    line-height: 1;
    user-select: none;
    pointer-events: none;
}

.gwvg-reel-card:hover .gwvg-play-btn {
    transform: scale(1.16);
    background: #fff;
    box-shadow: 0 8px 28px rgba(0,0,0,.48);
}

/* ----------------------------------------------------------------
   Title bar — fixed strip at card bottom
   ---------------------------------------------------------------- */

.gwvg-slide-title {
    flex: 0 0 auto;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #f3eee8;
    text-align: center;
    background: rgba(10, 6, 18, .90);
    line-height: 1.3;
    letter-spacing: .025em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ================================================================
   NAVIGATION ARROWS
   ================================================================ */

.gwvg-nav-prev,
.gwvg-nav-next {
    --swiper-navigation-color: #444;
    --swiper-navigation-size: 15px;
    width: var(--gwvg-nav-size) !important;
    height: var(--gwvg-nav-size) !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.94) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,.18) !important;
    transition: var(--gwvg-transition);
}

.gwvg-nav-prev { left: 6px !important; }
.gwvg-nav-next { right: 6px !important; }

.gwvg-nav-prev::after,
.gwvg-nav-next::after {
    font-size: 14px !important;
    font-weight: 900 !important;
}

.gwvg-nav-prev:hover,
.gwvg-nav-next:hover {
    background: #fff !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.26) !important;
    --swiper-navigation-color: #222;
}

/* ----------------------------------------------------------------
   Pagination
   ---------------------------------------------------------------- */

.gwvg-pagination { bottom: 10px !important; }

.gwvg-pagination .swiper-pagination-bullet {
    width: 7px;
    height: 7px;
    background: #aaa;
    opacity: .6;
    transition: all .3s ease;
}

.gwvg-pagination .swiper-pagination-bullet-active {
    background: var(--gwvg-gold);
    opacity: 1;
    width: 22px;
    border-radius: 4px;
}

/* ================================================================
   REEL MODE (full-screen vertical scroll)
   ================================================================ */

.gwvg-reel-wrap {
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #888 transparent;
}

.gwvg-reel-item {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 500px;
    scroll-snap-align: start;
    overflow: hidden;
    cursor: pointer;
    background: #0f0f1a;
    flex-shrink: 0;
}

.gwvg-reel-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(.72);
    transition: transform .5s ease;
}

.gwvg-reel-item:hover .gwvg-reel-bg { transform: scale(1.03); }

.gwvg-reel-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: linear-gradient(
        0deg,
        rgba(0,0,0,.55) 0%,
        rgba(0,0,0,.08) 60%,
        transparent 100%
    );
}

.gwvg-reel-play-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(255,255,255,.88);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(0,0,0,.4);
    transition: var(--gwvg-transition);
    padding-left: 5px;
}

.gwvg-reel-play-btn:hover { transform: scale(1.1); background: #fff; }

.gwvg-reel-play-icon { font-size: 26px; line-height: 1; color: #111; }

.gwvg-reel-item-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0,0,0,.6);
    text-align: center;
    padding: 0 20px;
    max-width: 400px;
}

/* ================================================================
   VIDEO MODAL — 9:16 portrait popup
   ================================================================ */

.gwvg-modal {
    position: fixed;
    inset: 0;
    z-index: var(--gwvg-modal-z);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.gwvg-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.90);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: gwvgFadeIn .2s ease;
}

@keyframes gwvgFadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes gwvgSlideUp {
    from { transform: translateY(28px) scale(.94); opacity: 0; }
    to   { transform: translateY(0) scale(1);      opacity: 1; }
}

.gwvg-modal-inner {
    position: relative;
    z-index: 1;
    /* 9:16 — on desktop cap at 380px wide → ~676px tall */
    width: min(380px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    background: #0f0f1a;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(0,0,0,.70);
    animation: gwvgSlideUp .26s var(--gwvg-easing);
    display: flex;
    flex-direction: column;
}

.gwvg-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(0,0,0,.50);
    border: 1.5px solid rgba(255,255,255,.20);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    line-height: 1;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.gwvg-modal-close:hover { background: rgba(0,0,0,.75); }

.gwvg-modal-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 44px 16px 14px;
    background: linear-gradient(0deg, rgba(0,0,0,.85) 0%, transparent 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    z-index: 5;
    pointer-events: none;
    letter-spacing: .025em;
}

/* 9:16 player box */
.gwvg-modal-player {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #000;
    flex-shrink: 0;
}

.gwvg-modal-player iframe,
.gwvg-modal-player video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 900px) {
    .gwvg-swiper { padding: 8px 38px 14px !important; }
    .gwvg-nav-prev { left: 2px !important; }
    .gwvg-nav-next { right: 2px !important; }
}

@media (max-width: 600px) {
    .gwvg-swiper { padding: 8px 28px 14px !important; }
    .gwvg-nav-prev { left: 0 !important; }
    .gwvg-nav-next { right: 0 !important; }
}
