/* ============================================================
   Universal Reels Page Styles
   Accent color is set per-page via JS on .reward-progress-fill
   ============================================================ */

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, #1a1a2e 0%, #0d0d1a 50%, #05050e 100%);
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    color: white;
}

/* ── Header ── */
.kr-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to bottom, rgba(5, 5, 14, 0.95), transparent);
    z-index: 2000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
}

.back-btn {
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.8);
}

.kr-title {
    font-weight: 800;
    letter-spacing: 1px;
    font-size: 1.05rem;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.8);
}

.audio-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Tab Content ── */
.tab-content {
    width: 100%;
    height: 100%;
}

/* ── Articles Tab ── */
#tab-articles {
    position: absolute;
    top: 60px !important;
    bottom: 115px !important;
    left: 0;
    width: 100%;
    height: auto !important;
    overflow-y: scroll;
    background: transparent;
}

/* ── Reels Container ── */
.reels-container {
    position: absolute;
    top: 60px !important;
    bottom: 115px !important;
    left: 0;
    width: 100%;
    height: auto !important;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    background: transparent;
}

.reels-container::-webkit-scrollbar { display: none; }

/* ── Individual Reel ── */
.reel {
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    background: transparent;
}

.yt-container {
    width: 100%;
    flex: 1;
    max-width: 500px;
    position: relative;
}

.yt-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: auto;
}

/* ── Reel Meta (below video) ── */
.reel-meta {
    width: 100%;
    max-width: 500px;
    padding: 10px 15px;
    background: rgba(5, 5, 14, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.1);
    box-sizing: border-box;
    text-align: left;
}

.reel-title {
    margin: 0 0 4px 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.reel-stats {
    font-size: 0.72rem;
    color: #888;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* ── Bottom Tab Bar (iOS style) ── */
.bottom-tab-bar {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    height: 55px;
    background: rgba(28, 28, 30, 0.88);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 2000;
    border-top: 0.5px solid rgba(255,255,255,0.15);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.b-tab {
    background: none;
    border: none;
    color: #8E8E93;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    font-size: 10px;
    font-weight: 500;
    width: 50%;
    height: 100%;
    padding-top: 4px;
}

.b-tab .icon {
    font-size: 1.6rem;
    margin-bottom: 2px;
    filter: grayscale(100%) opacity(0.6);
}

.b-tab.active { color: #0A84FF; }
.b-tab.active .icon { filter: grayscale(0%) opacity(1); }
.b-tab::after { display: none; }

/* ── Swipe Hint ── */
.swipe-hint {
    position: fixed;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    z-index: 1000;
    opacity: 0.9;
    text-shadow: 0 2px 10px rgba(0,0,0,1);
    pointer-events: none;
    animation: pmgBounce 2.5s infinite ease-in-out;
}

.swipe-hint span {
    font-weight: 800;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.swipe-arrow {
    font-size: 2rem;
    margin-top: -5px;
}

@keyframes pmgBounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -15px); }
}

/* ── Reward Progress Bar ── */
#reward-bar-wrap {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    z-index: 1900;
    padding: 6px 14px;
    box-sizing: border-box;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

#reward-bar-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

#reward-bar-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

#reward-progress-track {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.12);
    border-radius: 99px;
    overflow: hidden;
    min-width: 40px;
}

#reward-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: #0A84FF;
    transition: width 0.4s ease;
    box-shadow: 0 0 8px currentColor;
}

#reward-count-text {
    font-size: 0.65rem;
    font-weight: 800;
    color: #aaa;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Reward Modal (Unlock Popup) ── */
.reward-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeInModal 0.4s ease;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.reward-modal-box {
    background: linear-gradient(145deg, #13131f, #1e1e32);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 36px 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0,0,0,0.8);
}

.reward-modal-emoji {
    font-size: 4rem;
    margin-bottom: 12px;
    animation: trophyPop 0.6s ease 0.2s both;
}

@keyframes trophyPop {
    0%   { transform: scale(0) rotate(-15deg); opacity: 0; }
    70%  { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.reward-modal-box h2 {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    margin: 0 0 12px 0;
}

.reward-modal-box p {
    font-size: 0.95rem;
    color: #c0c0d0;
    line-height: 1.6;
    margin: 0;
}

.reward-close-btn {
    margin-top: 24px;
    background: linear-gradient(90deg, #0A84FF, #5e5ce6);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(10, 132, 255, 0.35);
    letter-spacing: 0.5px;
    transition: transform 0.15s ease;
    width: 100%;
}

.reward-close-btn:active {
    transform: scale(0.97);
}

/* ── When reward bar is visible, push reels down ── */
.reels-container.has-reward-bar {
    top: 96px !important; /* 60px header + 36px reward bar */
}

#tab-articles.has-reward-bar {
    top: 96px !important;
}
