/* ═══════════════════════════════════════════════════════════════
   Social Reels Showcase — Frontend Styles
   Author: Xrush.agency
═══════════════════════════════════════════════════════════════ */

/* ─── Reset & Base ───────────────────────────────────────────── */

.srs-showcase *,
.srs-showcase *::before,
.srs-showcase *::after,
.srs-modal *,
.srs-modal *::before,
.srs-modal *::after { box-sizing: border-box; }

/* ─── Showcase Container ─────────────────────────────────────── */

.srs-showcase {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 8px 0;
}

.srs-track-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── Horizontal Track ───────────────────────────────────────── */

.srs-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding: 8px 4px 12px;
    flex: 1;
    scrollbar-width: none;
    will-change: scroll-position;
    touch-action: pan-x;
}
.srs-track::-webkit-scrollbar { display: none; }

/* ─── Reel Card ──────────────────────────────────────────────── */

.srs-reel-card {
    flex: 0 0 calc(20% - 12px);
    min-width: 130px;
    max-width: 180px;
    cursor: pointer;
    scroll-snap-align: start;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease;
    outline: none;
}

.srs-reel-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 48px rgba(0,0,0,.28);
}

.srs-reel-card:focus-visible {
    outline: 3px solid #ff3b5c;
    outline-offset: 3px;
}

.srs-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16;
    background: #1a1d2e;
    overflow: hidden;
}

.srs-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

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

.srs-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1d2e, #2d2340);
}

.srs-card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.1) 55%, transparent 100%);
    pointer-events: none;
}

.srs-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%) scale(0.85);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,.2);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all .25s ease;
    border: 1.5px solid rgba(255,255,255,.4);
}

.srs-play-icon svg { width: 16px; height: 16px; margin-left: 2px; }

.srs-reel-card:hover .srs-play-icon {
    opacity: 1;
    transform: translate(-50%,-50%) scale(1);
}

.srs-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 10px 12px;
}

.srs-card-title {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0,0,0,.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Nav Arrows ─────────────────────────────────────────────── */

.srs-nav {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e8eaf0;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s ease;
    color: #1a1d2e;
    z-index: 2;
}

.srs-nav svg { width: 18px; height: 18px; }

.srs-nav:hover {
    background: #ff3b5c;
    color: #fff;
    border-color: #ff3b5c;
    transform: scale(1.08);
}

.srs-nav:disabled {
    opacity: .35;
    pointer-events: none;
}

/* ─── Lazy Load ──────────────────────────────────────────────── */

.srs-lazy {
    transition: opacity .3s ease;
}
.srs-lazy:not([data-loaded]) { opacity: 0; }
.srs-lazy[data-loaded]       { opacity: 1; }

/* ─── Modal Backdrop ─────────────────────────────────────────── */

.srs-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.86);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    backdrop-filter: blur(6px);
}
.srs-modal-backdrop.srs-active {
    opacity: 1;
    pointer-events: all;
}

/* ─── Modal ──────────────────────────────────────────────────── */

.srs-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.92);
    z-index: 99999;
    width: min(90vw, 420px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, transform .3s cubic-bezier(.34,1.2,.64,1);
}

.srs-modal.srs-active {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

/* Close Button */
.srs-modal-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 40px;
    height: 40px;
    background: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all .2s;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
    color: #1a1d2e;
}
.srs-modal-close svg { width: 18px; height: 18px; }
.srs-modal-close:hover { background: #ff3b5c; color: #fff; transform: scale(1.08) rotate(90deg); }

/* Nav Arrows */
.srs-modal-nav {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: all .2s;
    flex-shrink: 0;
}
.srs-modal-nav svg { width: 20px; height: 20px; }
.srs-modal-nav:hover { background: rgba(255,255,255,.25); transform: scale(1.08); }
.srs-modal-nav:disabled { opacity: .25; pointer-events: none; }

/* ─── Viewer Container ───────────────────────────────────────── */

.srs-modal-viewer {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16;
    border-radius: 20px;
    overflow: hidden;
    background: #0a0a0f;
    box-shadow: 0 32px 80px rgba(0,0,0,.7);
}

/* Loading Spinner */
.srs-modal-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0f;
    z-index: 5;
    transition: opacity .3s;
}
.srs-modal-loading.srs-hidden { opacity: 0; pointer-events: none; }

.srs-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255,255,255,.12);
    border-top-color: #ff3b5c;
    border-radius: 50%;
    animation: srs-spin .7s linear infinite;
}

@keyframes srs-spin { to { transform: rotate(360deg); } }

/* Embed */
.srs-modal-embed {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.srs-modal-embed iframe,
.srs-modal-embed video {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    pointer-events: none; /* blocks user from tapping iframe controls */
}

.srs-video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hide native HTML5 video controls completely */
.srs-video-element::-webkit-media-controls             { display: none !important; }
.srs-video-element::-webkit-media-controls-enclosure  { display: none !important; }
.srs-video-element::-webkit-media-controls-panel      { display: none !important; }
.srs-video-element::-webkit-media-controls-play-button { display: none !important; }
.srs-video-element::-webkit-media-controls-timeline   { display: none !important; }
.srs-video-element::-moz-range-thumb                  { display: none !important; }

/* Transparent click-blocker over iframe bottom (where YT controls appear) */
.srs-modal-embed::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 18%;           /* covers YouTube / Vimeo control bar area */
    z-index: 4;
    pointer-events: all;   /* intercepts taps so controls stay hidden */
    background: transparent;
}

/* Unsupported thumbnail display */
.srs-embed-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background: #0a0a0f;
    cursor: pointer;
}
.srs-embed-fallback img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}
.srs-embed-fallback-btn {
    position: relative;
    z-index: 2;
    background: rgba(255,255,255,.9);
    color: #1a1d2e;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background .2s;
}
.srs-embed-fallback-btn:hover { background: #fff; }
.srs-embed-fallback-btn svg { width: 18px; height: 18px; }

/* ─── Overlay / Info ─────────────────────────────────────────── */

.srs-modal-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    background: linear-gradient(0deg, rgba(0,0,0,.88) 0%, rgba(0,0,0,.35) 65%, transparent 100%);
    padding: 28px 20px 20px;
    pointer-events: none;
}

.srs-modal-info { pointer-events: all; }

.srs-modal-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    letter-spacing: -.2px;
    text-shadow: 0 2px 8px rgba(0,0,0,.4);
    cursor: pointer;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.srs-modal-desc {
    margin: 0 0 12px;
    font-size: 13px;
    color: rgba(255,255,255,.78);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.srs-modal-btn {
    display: inline-block;
    padding: 9px 22px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .2s ease, opacity .2s;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
    cursor: pointer;
    letter-spacing: .2px;
}

.srs-modal-btn:hover { transform: translateY(-2px); opacity: .9; }
.srs-modal-btn:empty { display: none; }

/* ─── Dots ───────────────────────────────────────────────────── */

.srs-modal-dots {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
}

.srs-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    transition: all .25s ease;
    cursor: pointer;
}
.srs-dot.srs-dot-active {
    width: 20px;
    border-radius: 3px;
    background: #ff3b5c;
}

/* ─── Swipe Transition ───────────────────────────────────────── */

.srs-modal-viewer.srs-slide-up {
    animation: srs-slide-up .28s cubic-bezier(.4,0,.2,1);
}
.srs-modal-viewer.srs-slide-down {
    animation: srs-slide-down .28s cubic-bezier(.4,0,.2,1);
}

@keyframes srs-slide-up {
    from { transform: translateY(30px); opacity: .4; }
    to   { transform: translateY(0);   opacity: 1; }
}
@keyframes srs-slide-down {
    from { transform: translateY(-30px); opacity: .4; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ─── Responsive ─────────────────────────────────────────────── */

@media (max-width: 768px) {
    .srs-reel-card { flex: 0 0 calc(33.33% - 10px); }
    .srs-modal     { width: min(96vw, 340px); }
}

@media (max-width: 480px) {
    .srs-reel-card { flex: 0 0 calc(50% - 8px); min-width: 110px; }
    .srs-nav       { width: 32px; height: 32px; }
    .srs-nav svg   { width: 14px; height: 14px; }
}

/* ─── Body lock when modal open ──────────────────────────────── */

body.srs-modal-open { overflow: hidden; }

/* ─── Touch swipe hint (first open only) ────────────────────── */

.srs-swipe-hint {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.55);
    color: rgba(255,255,255,.8);
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 20px;
    white-space: nowrap;
    z-index: 6;
    animation: srs-hint-fade 2.4s ease forwards;
    pointer-events: none;
}

@keyframes srs-hint-fade {
    0%   { opacity: 0; }
    15%  { opacity: 1; }
    75%  { opacity: 1; }
    100% { opacity: 0; }
}
