/* ═══════════════════════════════════════════════════
   Volarence Web Stories — Frontend Styles
   ═══════════════════════════════════════════════════ */

:root {
    --vws-primary: #003366;
    --vws-accent:  #E8A020;
    --vws-dark:    #0a0f1e;
    --vws-light:   #f4f7fb;
    --vws-radius:  14px;
    --vws-shadow:  0 8px 32px rgba(0,0,0,0.18);
}

/* ── Grid ── */
.vws-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    padding: 10px 0 30px;
}

/* ── Card ── */
.vws-card {
    cursor: pointer;
    border-radius: var(--vws-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
}
.vws-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--vws-shadow);
}
.vws-card:hover .vws-card-overlay { opacity: 1; }
.vws-card:hover .vws-card-thumb img { transform: scale(1.07); }

.vws-card-thumb {
    position: relative;
    aspect-ratio: 9/16;
    overflow: hidden;
    background: var(--vws-dark);
}
.vws-card-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.vws-card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(0,0,30,0.70) 100%);
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.vws-play-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.6);
    backdrop-filter: blur(6px);
    border-radius: 50%;
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
}

.vws-badge {
    position: absolute; top: 10px; left: 10px;
    background: var(--vws-accent);
    color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.vws-progress-dots {
    position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 3px;
}
.vws-dot {
    width: 5px; height: 5px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
}
.vws-dot:first-child { background: #fff; }

.vws-card-info {
    padding: 10px 12px 12px;
}
.vws-card-info h3 {
    margin: 0 0 4px;
    font-size: 16px; 
    font-weight: 700;
    line-height: 1.3;
    color: var(--vws-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vws-story-date {
    font-size: 11px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 4px;
}
.vws-story-date::before {
    content: '';
    display: inline-block;
    width: 12px; height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* ── Overlay ── */
.vws-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.82);
    z-index: 99998;
    backdrop-filter: blur(4px);
    animation: vwsFadeIn 0.2s ease;
}
.vws-overlay.active { display: block; }

/* ── Popup ── */
.vws-popup {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 99999;
    width: 380px;
    max-width: 95vw;
    max-height: 95vh;
}
.vws-popup.active {
    display: block;
    animation: vwsPopIn 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes vwsPopIn {
    from { transform: translate(-50%, -50%) scale(0.85); opacity: 0; }
    to   { transform: translate(-50%, -50%) scale(1);    opacity: 1; }
}
@keyframes vwsFadeIn {
    from { opacity: 0; } to { opacity: 1; }
}

.vws-popup-inner {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--vws-dark);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.vws-close {
    position: absolute; top: 14px; right: 14px;
    z-index: 10;
    background: rgba(255,255,255,0.15);
    border: none; color: #fff;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
}
.vws-close:hover { background: rgba(255,255,255,0.3); }

/* ── Viewer ── */
.vws-viewer {
    display: flex;
    align-items: center;
    gap: 0;
}
.vws-slide-wrap {
    flex: 1;
    position: relative;
    aspect-ratio: 9/16;
    overflow: hidden;
}

/* ── Slide Content ── */
.vws-slide-content {
    width: 100%; height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.vws-slide-content .vws-slide-bg {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}
.vws-slide-content .vws-slide-text-layer {
    position: relative;
    z-index: 2;
    padding: 28px 22px 30px;
    background: linear-gradient(transparent, rgba(0,0,20,0.85) 35%);
}
.vws-slide-content h2 {
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 10px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.vws-slide-content p {
    color: rgba(255,255,255,0.88);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ── Nav Buttons ── */
.vws-nav {
    position: absolute;
    top: 0; bottom: 0;
    width: 44px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 36px;
    cursor: pointer;
    z-index: 5;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.2s, background 0.2s;
}
.vws-prev { left: 0; }
.vws-next { right: 0; }
.vws-nav:hover { color: #fff; background: rgba(255,255,255,0.08); }
.vws-nav:disabled { opacity: 0.2; cursor: default; }

/* ── Progress Bar ── */
.vws-progress-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(255,255,255,0.2);
    z-index: 6;
}
.vws-progress-fill {
    height: 100%;
    background: var(--vws-accent);
    transition: width 0.3s ease;
    border-radius: 0 2px 2px 0;
}

/* ── Dot Nav ── */
.vws-dots-nav {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 10px;
    background: rgba(0,0,0,0.4);
}
.vws-dots-nav span {
    width: 6px; height: 6px;
    background: rgba(255,255,255,0.35);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.vws-dots-nav span.active {
    background: var(--vws-accent);
    transform: scale(1.4);
}

/* ── Slide Transition ── */
.vws-slide-content.slide-enter-right {
    animation: slideInRight 0.3s ease forwards;
}
.vws-slide-content.slide-enter-left {
    animation: slideInLeft 0.3s ease forwards;
}
@keyframes slideInRight {
    from { transform: translateX(60px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes slideInLeft {
    from { transform: translateX(-60px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

/* ── Tap Zones ── */
.vws-tap-left, .vws-tap-right {
    position: absolute;
    top: 0; bottom: 0; width: 40%;
    z-index: 4; cursor: pointer;
}
.vws-tap-left  { left: 0; }
.vws-tap-right { right: 0; }

/* ── Swipe hint on mobile ── */
.vws-swipe-hint {
    position: absolute;
    bottom: 80px;
    left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,0.55);
    font-size: 11px;
    text-align: center;
    z-index: 6;
    pointer-events: none;
    animation: fadeOut 2s 2s forwards;
}
@keyframes fadeOut { to { opacity: 0; } }

/* ── Empty state ── */
.vws-empty {
    text-align: center; color: #888; padding: 40px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .vws-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
    .vws-popup { width: 100vw; max-width: 100vw; top: 0; left: 0; transform: none; max-height: 100vh; }
    .vws-popup.active { animation: vwsMobileIn 0.3s ease forwards; }
    @keyframes vwsMobileIn {
        from { transform: translateY(40px); opacity: 0; }
        to   { transform: translateY(0);    opacity: 1; }
    }
    .vws-popup-inner { border-radius: 0; height: 100vh; }
    .vws-slide-wrap { aspect-ratio: unset; height: calc(100vh - 60px); }
}
