/* ============================================================
   Short Video Page — TikTok-style vertical feed
   ============================================================ */

/* ---------- Page layout ---------- */
.sv-page {
    display: flex;
    height: 100vh;
    max-width: 100vw;
    overflow: hidden;
    background: #000;
    color: #fff;
}

/* ---------- Left sidebar ---------- */
.sv-sidebar--left {
    width: 220px;
    flex-shrink: 0;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 16px;
    gap: 8px;
    background: #111;
    border-right: 1px solid #222;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sv-logo {
    display: block;
    margin-bottom: 16px;
}

.sv-logo img {
    height: 36px;
    width: auto;
}

.sv-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.sv-nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #ccc;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
}

.sv-nav__item:hover,
.sv-nav__item--active {
    background: #1a1a1a;
    color: #fff;
}

.sv-nav__item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* ---------- Main feed ---------- */
.sv-feed {
    flex: 1;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    height: 100vh;
    position: relative;
}

/* hide scrollbar but keep functionality */
.sv-feed::-webkit-scrollbar { display: none; }
.sv-feed { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------- Single video item ---------- */
.sv-item {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background: #000;
}

/* ---------- Player wrapper ---------- */
.sv-player-wrap {
    position: relative;
    height: 100%;
    max-height: 100vh;
    aspect-ratio: 9/16;
    background: #000;
    overflow: hidden;
    max-width: calc(100vh * 9 / 16);
}

@media (max-width: 768px) {
    .sv-player-wrap {
        width: 100%;
        max-width: 100%;
        aspect-ratio: auto;
    }
}

.sv-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

/* ---------- Overlay ---------- */
.sv-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    cursor: pointer;
}

.sv-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.sv-play-icon--show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* ---------- Progress bar ---------- */
.sv-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,.25);
    z-index: 10;
}

.sv-progress__bar {
    height: 100%;
    background: #fe2c55;
    width: 0%;
    transition: width 0.1s linear;
}

/* ---------- Info overlay ---------- */
.sv-info {
    position: absolute;
    bottom: 24px;
    left: 16px;
    right: 80px;
    z-index: 10;
    pointer-events: none;
}

.sv-info__title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 6px;
    text-shadow: 0 1px 3px rgba(0,0,0,.7);
    pointer-events: auto;
}

.sv-info__desc {
    font-size: 0.85rem;
    color: #ddd;
    margin-bottom: 6px;
    text-shadow: 0 1px 2px rgba(0,0,0,.7);
    pointer-events: auto;
}

.sv-info__more {
    background: none;
    border: none;
    color: #aaa;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.sv-info__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    pointer-events: auto;
}

.sv-tag {
    color: #fe2c55;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 600;
}

.sv-tag:hover { text-decoration: underline; }

/* ---------- Action bar (right side) ---------- */
.sv-actions {
    position: absolute;
    right: 16px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 10;
}

.sv-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: transform 0.15s;
}

.sv-action:hover { transform: scale(1.15); }

.sv-action i {
    font-size: 1.6rem;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.5));
}

.sv-action__count {
    font-size: 0.72rem;
    color: #eee;
}

.sv-action--active i { color: #fe2c55; }
.sv-action--active .sv-action__count { color: #fe2c55; }

/* ---------- Comment panel ---------- */
.sv-comment-panel {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 65%;
    background: #1a1a1a;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    z-index: 30;
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.sv-comment-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #333;
    font-weight: 600;
    font-size: 0.95rem;
}

.sv-comment-panel__header button {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 1rem;
}

.sv-comment-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sv-comment-loading {
    text-align: center;
    color: #666;
    padding: 20px;
}

/* Single comment */
.sv-comment {
    display: flex;
    gap: 10px;
}

.sv-comment__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #333;
    flex-shrink: 0;
    object-fit: cover;
}

.sv-comment__body { flex: 1; }

.sv-comment__user {
    font-weight: 600;
    font-size: 0.82rem;
    color: #bbb;
    margin-bottom: 2px;
}

.sv-comment__text {
    font-size: 0.9rem;
    line-height: 1.4;
}

.sv-comment__time {
    font-size: 0.75rem;
    color: #666;
    margin-top: 2px;
}

/* Comment input */
.sv-comment-input {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #333;
    align-items: flex-end;
}

.sv-comment-textarea {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 20px;
    color: #fff;
    padding: 8px 14px;
    resize: none;
    font-size: 0.9rem;
    line-height: 1.4;
    max-height: 80px;
    overflow-y: auto;
}

.sv-comment-textarea:focus { outline: none; border-color: #555; }
.sv-comment-textarea::placeholder { color: #666; }

.sv-comment-submit {
    background: #fe2c55;
    border: none;
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sv-comment-login {
    padding: 12px 16px;
    text-align: center;
    border-top: 1px solid #333;
    font-size: 0.9rem;
}

.sv-comment-login a { color: #fe2c55; }

/* ---------- Infinite scroll ---------- */
.sv-sentinel { height: 10px; }
.sv-loader { text-align: center; padding: 24px; font-size: 1.5rem; color: #666; }
.sv-empty { display: flex; flex-direction: column; align-items: center; justify-content: center;
            height: 100vh; color: #555; gap: 12px; font-size: 1.1rem; }

/* ---------- Toast ---------- */
.sv-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.85);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 9999;
    transition: opacity 0.3s;
    white-space: nowrap;
}

/* ---------- Auth modal ---------- */
.sv-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sv-modal__box {
    background: #1a1a1a;
    color: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 280px;
}

/* ---------- Utility ---------- */
.d-none { display: none !important; }
.d-lg-flex { display: none; }
@media (min-width: 992px) { .d-lg-flex { display: flex !important; } }
