/* ═══════════════════════════════════════
   Reels — immersive full-screen feed
   (mirrors the mobile app's Reels tab)
═══════════════════════════════════════ */

body.reels-immersive {
    overflow: hidden;
}

body.reels-immersive .mainHeaderWrapper,
body.reels-immersive .mainFooterWrapper {
    display: none !important;
}

.reels-app {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: #000;
    direction: rtl;
}

.reels-back-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 30;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #00000066;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 15px;
    backdrop-filter: blur(4px);
}

.reels-feed {
    position: relative;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

.reels-feed::-webkit-scrollbar {
    display: none;
}

.reels-initial-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reel-spin {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid #ffffff33;
    border-top-color: #fff;
    display: inline-block;
    animation: reel-spin 0.7s linear infinite;
}

@keyframes reel-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------------- Slide ---------------- */

.reel-slide {
    position: relative;
    width: 100%;
    height: 100%;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.reel-media {
    position: relative;
    height: 100%;
    width: min(100%, calc(100dvh * 9 / 16));
    overflow: hidden;
    background: #050505;
}

.reel-video,
.reel-fallback-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.reel-tap-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.reel-center-icons {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.reel-pause-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #00000055;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.reel-heart-burst {
    color: #fff;
    font-size: 100px;
    text-shadow: 0 4px 20px #00000080;
    opacity: 0;
    transform: scale(0);
}

.reel-heart-burst.burst {
    animation: reel-heart-burst 0.7s ease;
}

@keyframes reel-heart-burst {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    30% {
        opacity: 1;
        transform: scale(1.15);
    }
    45% {
        opacity: 1;
        transform: scale(1);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

.reel-mute-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #00000066;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    backdrop-filter: blur(4px);
}

.reel-gradient {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 42%;
    background: linear-gradient(0deg, #000000c7, transparent);
    z-index: 2;
    pointer-events: none;
}

.reel-action-bar {
    position: absolute;
    left: 12px;
    bottom: 130px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}

.reel-action-bar button {
    background: none;
    border: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 30px;
    cursor: pointer;
    text-shadow: 0 2px 8px #00000080;
}

.reel-action-bar .cnt {
    font-size: 11px;
    font-family: inherit;
}

.reel-like-btn.liked i {
    color: #ff3b5c;
}

.reel-like-btn i,
.reel-comment-btn i {
    transition: transform 0.15s;
}

.reel-like-btn:active i {
    transform: scale(1.25);
}

.reel-caption-wrap {
    position: absolute;
    right: 14px;
    left: 66px;
    bottom: 22px;
    z-index: 5;
    color: #fff;
}

.reel-caption-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.reel-caption-text {
    flex: 1;
    min-width: 0;
}

.reel-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reel-caption {
    font-size: 12.5px;
    line-height: 1.7;
    margin: 0;
    color: #eee;
    max-height: 40px;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.reel-caption.expanded {
    max-height: 400px;
}

.reel-caption-more {
    display: inline-block;
    color: #ccc;
    font-size: 11px;
    margin-right: 4px;
    cursor: pointer;
}

.reel-thumb-badge {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #222;
    background-size: cover;
    background-position: center;
    border: 1px solid #ffffff44;
}

.reel-chips-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.reel-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff22;
    backdrop-filter: blur(3px);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 11px;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}

/* ---------------- Comments / Movies drawers ---------------- */

.reels-comments-overlay,
.reels-movies-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    direction: rtl;
}

.reels-comments-overlay[hidden],
.reels-movies-overlay[hidden] {
    display: none;
}

.reels-comments-backdrop,
.reels-movies-backdrop {
    position: absolute;
    inset: 0;
    background: #000000a0;
}

.rc-drawer,
.rm-drawer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 480px;
    margin: 0 auto;
    background: #161616;
    border-radius: 18px 18px 0 0;
    height: 68vh;
    display: flex;
    flex-direction: column;
    animation: rc-slide-up 0.25s ease;
}

@keyframes rc-slide-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.rc-handle {
    width: 36px;
    height: 4px;
    border-radius: 4px;
    background: #ffffff33;
    margin: 10px auto 0;
    flex-shrink: 0;
}

.rc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border-bottom: 1px solid #ffffff14;
    flex-shrink: 0;
}

.rc-head b {
    color: #999;
    font-weight: 400;
    font-size: 12px;
}

.rc-close {
    background: none;
    border: none;
    color: #ccc;
    font-size: 15px;
    cursor: pointer;
    padding: 4px;
}

.rc-list,
.rm-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
}

.rc-loading {
    display: flex;
    justify-content: center;
    padding: 16px;
}

.rc-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
}

.rc-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    background-color: #333;
    object-fit: cover;
}

.rc-body {
    flex: 1;
    min-width: 0;
}

.rc-author-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rc-author {
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
}

.rc-date {
    color: #888;
    font-size: 11px;
}

.rc-content {
    color: #ddd;
    font-size: 13px;
    line-height: 1.8;
    margin: 4px 0 6px;
    word-break: break-word;
}

.rc-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rc-actions button {
    background: none;
    border: none;
    color: #999;
    font-size: 11.5px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.rc-like-btn.liked {
    color: #ff3b5c;
}

.rc-like-btn.liked i {
    font-weight: 900;
}

.rc-replies {
    margin-top: 8px;
    padding-right: 14px;
    border-right: 2px solid #ffffff14;
}

.rc-replies[hidden] {
    display: none;
}

.rc-empty {
    text-align: center;
    color: #777;
    font-size: 12.5px;
    padding: 30px 0;
}

.rc-reply-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1f1f1f;
    color: #ccc;
    font-size: 12px;
    padding: 8px 16px;
    flex-shrink: 0;
}

.rc-reply-banner button {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
}

.rc-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #ffffff14;
    flex-shrink: 0;
}

.rc-composer textarea {
    flex: 1;
    resize: none;
    max-height: 90px;
    background: #232323;
    border: none;
    border-radius: 18px;
    padding: 10px 14px;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.rc-composer button {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: var(--main-rgb, #ff9800);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.rc-composer button:disabled {
    opacity: 0.5;
}

/* ---------------- Movies drawer rows ---------------- */

.rm-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    text-decoration: none;
    border-bottom: 1px solid #ffffff10;
}

.rm-row-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #262626;
    color: var(--main-rgb, #ff9800);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rm-row-title {
    flex: 1;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.rm-row-arrow {
    color: #777;
    font-size: 13px;
}

.reel-side-nav {
    gap: 15px;
    display: flex;
    flex-direction: column;
    margin: 0 10px 0 0;
}

.reel-side-nav button.reel-nav-btn {
    border: none;
    background: #ffffff82;
    border-radius: 100%;
    width: 30px;
    height: 30px;
    padding: 5px 0px 0px 0;
}

@media (max-width: 685px) {
    .reel-side-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .reel-action-bar {
        bottom: 120px;
        left: 8px;
    }

    .reel-caption-wrap {
        right: 10px;
        left: 56px;
    }

    .rc-drawer,
    .rm-drawer {
        max-width: 100%;
        height: 72vh;
    }
}
