/* ===========================
   Menu Reels Page — Instagram-style vertical scroll
   Themed with Lively Menu accent colors
   Only active when body has .reels-active class
   =========================== */

/* Loading / Empty pages */
.rl-loading-page,
.rl-empty-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #0a0a0f;
    color: #ffffff;
    font-family: var(--font-body, ui-sans-serif, system-ui, -apple-system, sans-serif);
}

.rl-loading-page p,
.rl-empty-page p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

.rl-empty-page i {
    font-size: 56px;
    color: rgba(255, 255, 255, 0.15);
}

.rl-empty-page h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.rl-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--dm-accent, #c8956c);
    border-radius: 50%;
    animation: rlSpin 0.8s linear infinite;
}

@keyframes rlSpin {
    to { transform: rotate(360deg); }
}

.rl-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--dm-accent, #c8956c);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.rl-back-link:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--dm-accent, #c8956c);
}

/* ===========================
   Close & Counter (floating UI)
   =========================== */
.rl-close-btn {
    position: fixed;
    top: max(env(safe-area-inset-top, 0px), 12px);
    left: max(env(safe-area-inset-left, 0px), 14px);
    z-index: 100;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.rl-close-btn:hover {
    transform: scale(1.1);
    color: #ffffff;
}

.rl-counter {
    position: fixed;
    top: max(env(safe-area-inset-top, 0px), 18px);
    right: max(env(safe-area-inset-right, 0px), 16px);
    z-index: 100;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-body, ui-sans-serif, system-ui, sans-serif);
}

.rl-counter span:first-child {
    color: #ffffff;
    font-size: 13px;
}

/* ===========================
   Reels Container (scroll-snap)
   =========================== */
.rl-container {
    height: 100vh;
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: #0a0a0f;
}

.rl-container::-webkit-scrollbar {
    display: none;
}

/* ===========================
   Individual Reel Item
   =========================== */
.rl-item {
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0a0a0f;
}

/* ===========================
   Media (video / image)
   =========================== */
.rl-media {
    position: relative;
    flex: 0 0 55%;
    min-height: 0;
    overflow: hidden;
    z-index: 1;
}

.rl-media img,
.rl-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Poster image sits on top of video until video plays */
.rl-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 3;
    transition: opacity 0.4s ease;
}

.rl-poster.rl-poster-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Play button overlay */
.rl-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.rl-play-btn i {
    margin-left: 3px; /* visual centering for play icon */
}

.rl-play-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translate(-50%, -50%) scale(1.1);
}

.rl-play-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.rl-play-btn.rl-play-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.rl-media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f1520, #0a0a0f);
    color: rgba(255, 255, 255, 0.08);
    font-size: 6rem;
}

/* Gradient fade bridging media into content */
.rl-media-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(10, 10, 15, 0.25) 35%,
        rgba(10, 10, 15, 0.65) 65%,
        #0a0a0f 100%
    );
    pointer-events: none;
    z-index: 4;
}

/* ===========================
   Content Overlay
   =========================== */
.rl-content {
    flex: 1;
    min-height: 0;
    z-index: 10;
    padding: 0 20px max(env(safe-area-inset-bottom, 0px), 20px);
    margin-top: -32px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    font-family: var(--font-body, ui-sans-serif, system-ui, -apple-system, sans-serif);
}

.rl-content::-webkit-scrollbar {
    display: none;
}

/* Company badge */
.rl-company {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
}

.rl-company-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.rl-company-icon-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

.rl-company-name {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--dm-accent, #c8956c);
}

/* Group tag */
.rl-group-tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 3px 10px;
}

/* Title */
.rl-title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* Featured badge */
.rl-featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    background: var(--dm-accent, #c8956c);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: 8px;
}

.rl-featured-badge i {
    font-size: 10px;
}

/* Divider */
.rl-divider {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--dm-accent, #c8956c), transparent);
    border-radius: 2px;
}

/* Description */
.rl-desc {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    white-space: pre-line;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price */
.rl-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dm-accent, #c8956c);
    font-family: var(--font-heading, var(--font-body));
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

/* Featured CTA button */
.rl-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--dm-accent, #c8956c);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(200, 149, 108, 0.3);
    margin-top: 2px;
}

.rl-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(200, 149, 108, 0.45);
    color: #ffffff;
}

.rl-cta-btn:active {
    transform: scale(0.97);
}

.rl-cta-btn i {
    font-size: 14px;
}

/* View full menu button */
.rl-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rl-menu-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.rl-menu-btn i {
    font-size: 14px;
    color: var(--dm-accent, #c8956c);
}

/* ===========================
   Scroll Hint (auto-hides)
   =========================== */
.rl-scroll-hint {
    position: fixed;
    bottom: max(env(safe-area-inset-bottom, 0px), 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    pointer-events: none;
    animation: rlHintPulse 2s ease-in-out infinite;
    transition: opacity 0.4s ease;
    font-family: var(--font-body, ui-sans-serif, system-ui, sans-serif);
}

.rl-scroll-hint.rl-hint-hidden {
    opacity: 0;
}

.rl-scroll-hint-arrow {
    font-size: 18px;
    animation: rlHintBounce 1.5s ease-in-out infinite;
}

@keyframes rlHintBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes rlHintPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ===========================
   Desktop adjustments
   =========================== */
@media (min-width: 600px) {
    .rl-container {
        max-width: 480px;
        margin: 0 auto;
        border-left: 1px solid rgba(255, 255, 255, 0.05);
        border-right: 1px solid rgba(255, 255, 255, 0.05);
    }

    .rl-close-btn {
        left: max(calc(50% - 240px + 14px), 14px);
    }

    .rl-counter {
        right: max(calc(50% - 240px + 14px), 14px);
    }

    .rl-title {
        font-size: 1.7rem;
    }
}
