/* general */
.tag-badge {
    display: inline-block;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 10px;
    font-family: San-francisco-Bold;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background-color: #f1300b;
    color: #fcfcfc;
}

.duration-badge {
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 10px;
    font-family: San-francisco-Semibold;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
}

.views-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8) !important;
}

.views-badge img {
    width: 12px;
    height: 12px;
}

/* reel card */
.reels-section {
    padding-top: 30px;
}

.reels-section .reels-row {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.reels-section .reels-row::-webkit-scrollbar {
    display: none;
}

.reels-section .head-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.reels-section .head-title-row h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-family: San-francisco-Bold;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #0d1014;
}

.reels-section .head-title-row h2 span {
    font-family: San-francisco-Bold;
}

.reels-section .head-title-row h2 span:first-child {
    border-radius: 6px;
    background-color: #f1300b;
    padding: 2px 8px;
    font-size: 13px;
    color: #fcfcfc;
}

.reels-section .head-title-row h2 span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #000;
}

.reels-section .head-title-row a {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-family: San-francisco-Semibold;
    color: #f1300b;
}

.reels-section .reels-row {
    display: flex;
    gap: 12px;
    scroll-snap-type: x;
    overflow-x: auto;
    padding-bottom: 4px;
}

.reels-wrapper {
    padding-bottom: 70px;
}

.all-reels-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.reel-card {
    position: relative;
    width: 150px;
    height: 240px;
    flex-shrink: 0;
    scroll-snap-align: start;
    overflow: hidden;
    border-radius: 12px;
    box-shadow:
        0 1px 2px 0 rgb(0 0 0 / 0.05),
        0 0 0 1px #e2e8f0;
}

.all-reels-row .reel-card {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
}

.reel-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(to top, rgb(0 0 0 / 0.8) 0%, rgb(0 0 0 / 0.1) 50%, transparent 100%);
}

.reel-card .reel-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reel-card .card-head {
    position: absolute;
    top: 8px;
    inset-inline: 8px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reel-card .play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    z-index: 1;
    place-items: center;
    border-radius: 100%;
    background-color: rgba(241, 48, 11, 0.9);
    box-shadow:
        0 10px 15px -3px rgb(0 0 0 / 0.1),
        0 4px 6px -4px rgb(0 0 0 / 0.1);
    cursor: pointer;
}

.reel-card .card-bottom {
    position: absolute;
    inset-inline: 8px;
    bottom: 8px;
    z-index: 1;
}

.reel-card .card-bottom p {
    font-size: 12px;
    font-family: San-francisco-Semibold;
    color: white;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-height: 1.375;
}

.reel-card .card-bottom .views-badge {
    margin-top: 4px;
}

/* reel viewer */
.reels-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
}

.reels-viewer.active {
    display: block;
}

.reels-track {
    height: 100%;
    width: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

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

.reels-slide {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.reels-slide-inner {
    position: relative;
    position: relative;
    height: 100dvh;
    max-height: 900px;
    aspect-ratio: 9 / 16;
    width: auto;
    max-width: 100%;
    background: #000;
    overflow: hidden;
}

.reels-video {
    border-radius: 4px;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #000;
    display: block;
}

.reels-slide-bottom {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    padding: 0 16px;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 15px;
    color: #fff;
}

.reels-slide-bottom span,
.reels-slide-bottom p {
    color: #fff;
}

.reels-slide-info .tag-badge {
    margin-bottom: 8px;
}

.reels-title {
    margin: 8px 0 6px;
    font-size: 16px;
    line-height: 1.4;
}

.reels-slide-info .views-badge {
    font-size: 13px;
}

.reels-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    flex-shrink: 0;
}

.reels-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #fff;
}

.reels-action svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    transition:
        transform 0.15s ease,
        fill 0.15s ease,
        stroke 0.15s ease;
}

.reels-action:active svg {
    transform: scale(0.82);
}

.reels-action.liked svg {
    fill: #f1300b;
    stroke: #f1300b;
}

.reels-action-count {
    font-size: 11px;
    font-family: San-francisco-Semibold;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.reels-share-toast {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-family: San-francisco-Semibold;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 3;
    white-space: nowrap;
}

.reels-share-toast.show {
    opacity: 1;
}

/* video controls */
.reels-pause-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
    z-index: 2;
}

.reels-pause-icon.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.reels-pause-icon svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

.reels-speed-badge {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 12px;
    font-family: San-francisco-Semibold;
    padding: 4px 10px;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 2;
}

.reels-speed-badge.show {
    opacity: 1;
}

.reels-volume-control {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reels-mute-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.reels-mute-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.reels-volume-slider {
    width: 0;
    opacity: 0;
    transition: width 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
    accent-color: #fff;
    cursor: pointer;
}

.reels-volume-control:hover .reels-volume-slider,
.reels-volume-control:focus-within .reels-volume-slider {
    width: 80px;
    opacity: 1;
}

.reels-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    cursor: pointer;
    border: none;
}

.reels-close svg {
    fill: #fff;
}

/* reels share */
.reels-share-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.reels-share-sheet-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.reels-share-sheet {
    width: 100%;
    max-width: 480px;
    background: #1c1c1e;
    border-radius: 16px 16px 0 0;
    padding: 12px 16px 24px;
    transform: translateY(100%);
    transition: transform 0.25s ease;
}

.reels-share-sheet-backdrop.active .reels-share-sheet {
    transform: translateY(0);
}

.reels-share-sheet-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 auto 12px;
}

.reels-share-sheet-title {
    color: #fff;
    font-size: 14px;
    font-family: San-francisco-Semibold;
    text-align: center;
    margin-bottom: 16px;
    opacity: 0.7;
}

.reels-share-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 8px;
    margin-bottom: 16px;
}

.reels-share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.reels-share-option span:last-child {
    color: #fff;
    font-size: 11px;
    font-family: San-francisco-Semibold;
    text-align: center;
}

.reels-share-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
}

.reels-share-icon svg {
    width: 22px;
    height: 22px;
}

.reels-share-cancel {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 14px;
    font-family: San-francisco-Semibold;
    cursor: pointer;
}

.reels-global-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-family: San-francisco-Semibold;
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.reels-global-toast.show {
    opacity: 1;
}

/* loading */
.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 0;
}

.loader span.spinner {
    display: block;
    width: 36px;
    height: 36px;
    border: 5px solid rgba(241, 48, 11, 0.2);
    border-top-color: #f1300b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
