/* SA Filtered Video Gallery — Sabbir Ahmed */
/* Outer wrapper — fully transparent, no background */
.sa-fvg {
    position: relative;
    background: transparent;
    width: 100%;
    color: #ffffff;
    border: none;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Top box — has the dark background, glow, grid */
.sa-fvg__top-box {
    position: relative;
    background: #04081D;
    border-radius: 20px;
    padding: 28px;
    box-sizing: border-box;
    overflow: hidden;
    isolation: isolate;
    /* border controlled via Elementor Border control */
}

/* ── Header ── */
.sa-fvg__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}
.sa-fvg__header-left { flex-shrink: 0; }
.sa-fvg__title {
    margin: 0 0 3px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}
.sa-fvg__subtitle {
    color: rgba(255,255,255,0.45);
    font-size: 12px;
    line-height: 1.4;
}

/* ── Tabs ── */
.sa-fvg__tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sa-fvg__tabs::-webkit-scrollbar { display: none; }

.sa-fvg__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.09);
    color: rgba(255,255,255,0.70);
    border: 1.5px solid rgba(255,255,255,0.80);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background 0.2s ease, color 0.2s ease;
    line-height: 1;
}
.sa-fvg__tab:hover { background: rgba(255,255,255,0.15); }
.sa-fvg__tab.is-active {
    background: #ffffff;
    color: #04081D;
    border-color: transparent;
}
.sa-fvg__tab:focus-visible {
    outline: 2px solid rgba(255,255,255,0.5);
    outline-offset: 2px;
}
.sa-fvg__tab-icon { display: inline-flex; align-items: center; font-size: 12px; color: currentColor; }
.sa-fvg__tab-icon i { color: currentColor !important; }
.sa-fvg__tab-icon svg { width: 13px; height: 13px; fill: currentColor !important; }
.sa-fvg__tab-label { color: currentColor; }

/* Icon color via CSS variables (set inline on wrapper) */
.sa-fvg__tab:not(.is-active) .sa-fvg__tab-icon,
.sa-fvg__tab:not(.is-active) .sa-fvg__tab-icon i {
    color: var(--sa-fvg-icon-color, currentColor) !important;
}
.sa-fvg__tab:not(.is-active) .sa-fvg__tab-icon svg {
    fill: var(--sa-fvg-icon-color, currentColor) !important;
    color: var(--sa-fvg-icon-color, currentColor) !important;
}
.sa-fvg__tab.is-active .sa-fvg__tab-icon,
.sa-fvg__tab.is-active .sa-fvg__tab-icon i {
    color: var(--sa-fvg-icon-color-active, currentColor) !important;
}
.sa-fvg__tab.is-active .sa-fvg__tab-icon svg {
    fill: var(--sa-fvg-icon-color-active, currentColor) !important;
    color: var(--sa-fvg-icon-color-active, currentColor) !important;
}

/* Tab with image background — label sits on top */
.sa-fvg__tab--has-image {
    position: relative;
    overflow: hidden;
    padding: 0;
    min-width: 120px;
    height: 52px;
    align-items: flex-end;
    justify-content: flex-start;
    border: 1.5px solid rgba(255,255,255,0.80);
}

.sa-fvg__tab-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
    z-index: 0;
    transition: transform 0.4s ease;
}

.sa-fvg__tab--has-image:hover .sa-fvg__tab-thumb {
    transform: scale(1.05);
}

/* Dark gradient overlay for readability */
.sa-fvg__tab-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.70) 0%, rgba(0,0,0,0.10) 60%, transparent 100%);
    z-index: 1;
    border-radius: inherit;
    pointer-events: none;
}

/* Label sits above image */
.sa-fvg__tab--has-image .sa-fvg__tab-label {
    position: relative;
    z-index: 2;
    padding: 8px 12px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Active image tab — brighter overlay */
.sa-fvg__tab--has-image.is-active .sa-fvg__tab-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.50) 0%, rgba(0,0,0,0.05) 60%, transparent 100%);
}
.sa-fvg__tab--has-image.is-active {
    background: transparent;
    color: #ffffff;
    border-color: #ffffff;
}

/* Regular tab label (no image) */
.sa-fvg__tab-label { line-height: 1; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sa-fvg__tab-thumb { transition: none; }
}

/* ── Card strip ── */
.sa-fvg__strip-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
    margin-bottom: 0;
}
.sa-fvg__cards {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    padding-bottom: 2px;
}
.sa-fvg__cards::-webkit-scrollbar { display: none; }

/* ── Card ── */
.sa-fvg__card {
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.sa-fvg__card:focus-visible { outline: 2px solid rgba(255,255,255,0.5); border-radius: 10px; }
.sa-fvg__card.is-hidden { display: none; }
.sa-fvg__card-thumb {
    position: relative;
    width: 160px;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: #1a1f3a;
    border: 1.5px solid rgba(255,255,255,0.12);
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}
.sa-fvg__card:hover .sa-fvg__card-thumb,
.sa-fvg__card.is-active .sa-fvg__card-thumb { border-color: rgba(255,255,255,0.80); }
.sa-fvg__card-thumb img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform 0.35s ease;
}
.sa-fvg__card:hover .sa-fvg__card-thumb img { transform: scale(1.04); }
.sa-fvg__card-placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #1e2547 0%, #12172a 100%);
}

/* ── Badge ── */
.sa-fvg__badge {
    position: absolute;
    top: 7px; left: 7px;
    background: rgba(0,0,0,0.55);
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 5px;
    backdrop-filter: blur(4px);
    z-index: 2;
    line-height: 1.4;
}

/* ── Card title ── */
.sa-fvg__card-title {
    margin-top: 6px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ── Arrow button ── */
.sa-fvg__arrow {
    flex-shrink: 0;
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 50%;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    align-self: center;
}
.sa-fvg__arrow:hover { background: rgba(255,255,255,0.22); }
.sa-fvg__arrow:focus-visible { outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px; }

/* ── Preview wrap ── */
.sa-fvg__preview-wrap {
    position: relative;
    /* No background — transparent, only glass card shows */
}

/* ── Preview card — glassmorphism ── */
.sa-fvg__preview {
    border-radius: 18px;
    /* border controlled via Elementor Border control */
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    position: relative;
    /* Glass morphism — exact design match */
}

/* ── Preview inner (aspect ratio container) ── */
.sa-fvg__preview-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0a0a14;
}

@supports not (aspect-ratio: 1) {
    .sa-fvg__preview-inner { padding-bottom: 56.25%; height: 0; }
}

.sa-fvg__preview-inner img.sa-fvg__preview-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.35s ease;
}

.sa-fvg__preview-inner iframe.sa-fvg__preview-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.sa-fvg__preview-inner .sa-fvg__preview-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1f3a 0%, #0d1128 100%);
    color: rgba(255,255,255,0.2);
    font-size: 14px;
}

/* ── Preview play button ── */
.sa-fvg__preview-play {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
    z-index: 5;
    padding: 0;
}

/* Positions */
.sa-fvg__preview-play--bottom_right { bottom: 20px; right: 20px; }
.sa-fvg__preview-play--bottom_left  { bottom: 20px; left: 20px; }
.sa-fvg__preview-play--center {
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.sa-fvg__preview-play--center:hover { transform: translate(-50%, -50%) scale(1.08); }
.sa-fvg__preview-play--bottom_right:hover,
.sa-fvg__preview-play--bottom_left:hover { transform: scale(1.06); }

/* Styles */
.sa-fvg__preview-play--circle_white {
    background: rgba(255,255,255,0.95);
    color: #000000;
    border: none;
}
.sa-fvg__preview-play--circle_glass {
    background: rgba(255,255,255,0.18);
    color: #ffffff;
    border: 1.5px solid rgba(255,255,255,0.50);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.sa-fvg__preview-play--circle_solid {
    background: rgba(255,255,255,0.95);
    color: #000000;
    border: none;
}
.sa-fvg__preview-play--outline {
    background: transparent;
    color: #ffffff;
    border: 1.5px solid rgba(255,255,255,0.80);
}

/* Hover states */
.sa-fvg__preview-play--circle_white:hover { background: #ffffff; }
.sa-fvg__preview-play--circle_glass:hover { background: rgba(255,255,255,0.30); }
.sa-fvg__preview-play--circle_solid:hover { opacity: 0.9; }
.sa-fvg__preview-play--outline:hover { background: rgba(255,255,255,0.12); }

/* Pulse */
.sa-fvg__preview-play--pulse::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    opacity: 0;
    animation: sa-fvg-pulse 2s ease-out infinite;
    z-index: -1;
}
@keyframes sa-fvg-pulse {
    0%   { opacity: 0.5; transform: scale(1); }
    100% { opacity: 0;   transform: scale(1.65); }
}

.sa-fvg__preview-play:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sa-fvg__preview-play svg { width: 40%; height: 40%; margin-left: 6%; fill: currentColor; display: block; }
.sa-fvg__preview-play.is-hidden { display: none; }

/* Transition states */
.sa-fvg__preview-inner.is-loading img { opacity: 0.4; }

/* Mobile */
@media (max-width: 767px) {
    .sa-fvg { padding: 18px; }
    .sa-fvg__header { flex-direction: column; align-items: flex-start; }
    .sa-fvg__tabs { width: 100%; }
    .sa-fvg__preview-play { width: 42px; height: 42px; bottom: 12px; right: 12px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sa-fvg__card, .sa-fvg__card-thumb img,
    .sa-fvg__tab, .sa-fvg__preview-play,
    .sa-fvg__preview-inner img { transition: none; }
}

/* Drag-to-scroll grab cursor */
.sa-fvg__cards { cursor: grab; }
.sa-fvg__cards:active { cursor: grabbing; }

/* Custom icon inside play/arrow */
.sa-fvg__play-custom-icon,
.sa-fvg__arrow-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: inherit;
}
.sa-fvg__play-custom-icon i,
.sa-fvg__play-custom-icon svg,
.sa-fvg__arrow-custom i,
.sa-fvg__arrow-custom svg {
    display: block;
    fill: currentColor;
    color: inherit;
}
