/* --- SWIPER SETUP --- */

.shorts-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.swiper-slide {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
}

.video-section {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    position: relative;
}

.video-card-wrapper {
    position: relative;
    max-width: 450px;
    height: 91%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 20px;
    padding-bottom: 20px;
    box-sizing: border-box;
}

.video-card {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
    overflow: hidden;
    border-radius: 25px;
}

.video-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.following_acc {
    background: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    color: #000 !important;
}

.video-overlay-top {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.no-comments {
    text-align: center;
    margin-top: 50px;
}

.no-comments span {
    font-size: 14px;
}

.video-overlay-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 20px 10px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
    z-index: 10;
    box-sizing: border-box;
}

.video-overlay-actions {
    position: absolute;
    bottom: 100px;
    right: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    z-index: 10;
}

.uploader-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.uploader-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid white;
}

.uploader-info .username {
    font-weight: bold;
    font-size: 14px;
}

.follow-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.follow-btn.following {
    background: white;
    color: black;
    border-color: white;
}

.video-description {
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.4;
    max-width: 90%;
    color: white;
    margin-top: 0;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.action-item span {
    margin-top: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.control-btn {
    background: transparent;
    border: none;
    cursor: pointer;
}

.navigation-buttons {
    position: absolute;
    right: 29%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 50;
}

.nav-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s;
}

.nav-btn:active {
    transform: scale(0.9);
}

.volume-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
}


/* ===PROGRESS BAR CSS === */

.video-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: 50;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    padding-bottom: 0px;
}

.video-progress-track {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    transition: height 0.2s ease, background 0.2s ease;
}

.video-progress-fill {
    height: 100%;
    width: 0%;
    background-color: white;
    position: relative;
}

.video-progress-fill::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(50%, -50%) scale(0);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}


/* === HOVER & DRAGGING STATES === */

.video-progress-container:hover .video-progress-track,
.video-progress-container.is-dragging .video-progress-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.35);
}

.video-progress-container:hover .video-progress-fill::after,
.video-progress-container.is-dragging .video-progress-fill::after {
    transform: translate(50%, -50%) scale(1);
}


/* SIDEBAR STYLES */

.comments-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background-color: #121212;
    border-left: 1px solid #333;
    z-index: 100;
    /* Animation Logic */
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.comments-sidebar.active {
    transform: translateX(0);
    /* Slides in */
}


/* Sidebar Content Styles */

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #333;
    background: #222328;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    color: #fff;
    background: #222328;
}

.sidebar-post-info {
    margin-bottom: 20px;
}

.post-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 14px;
}

.post-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.post-comment-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 14px;
}

.post-comment-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.hashtags-comment {
    font-weight: 600;
    color: white;
}

.hashtag {
    font-weight: bold;
    color: white;
}


/* "More" and "Less" buttons */

.toggle-text-btn {
    font-weight: 700;
    color: #ccc;
    cursor: pointer;
    margin-left: 5px;
}

.toggle-text-btn:hover {
    text-decoration: underline;
    color: white;
}

.sidebar-divider {
    border: 0;
    border-top: 1px solid #a0a0a0;
    margin: 15px 0;
}


/* ---  COMMENT STYLES --- */

.comment-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
    max-width: 100%;
    min-width: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-row.is-reply {
    margin-left: 25px;
    width: calc(100% - 25px);
}

.comment-row.is-reply img {
    width: 24px;
    height: 24px;
}

.comment-row img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
    min-width: 0;
}

.comment-username {
    font-size: 13px;
    font-weight: 600;
    color: #e0e0e0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.comment-time {
    font-size: 11px;
    color: #888;
}

.comment-text {
    font-size: 14px;
    color: white;
    margin-bottom: 6px;
    line-height: 1.3;
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.comment-footer {
    font-size: 12px;
    color: #888;
    font-weight: 500;
    cursor: pointer;
}

.comment-footer:hover {
    color: #ccc;
    text-decoration: underline;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-top: 4px;
    min-width: 24px;
}

.comment-like-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 3px;
}

.comment-remove-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.comment-like-count {
    font-size: 11px;
    color: #888;
    padding-right: 10px;
    padding-bottom: 1px;
}


/* Red Heart for Liked State */

.comment-like-btn.liked svg path {
    fill: #fe2c55;
    stroke: none;
}

.comment-body .user {
    color: #999;
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 4px;
    display: block;
}

.comment-body p {
    font-size: 13px;
    line-height: 1.4;
}

.comment-input-area {
    padding: 15px;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #222328;
    box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.25), 0 -4px 4px 0 rgba(0, 0, 0, 0.25);
}

.comment-input-area input {
    flex: 1;
    background: #333;
    border: none;
    padding: 10px;
    border-radius: 20px;
    color: white;
    outline: none;
}

.send-btn {
    background: none;
    border: none;
    color: #00d2ff;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-user span {
    color: #a7a7a7;
    font-family: Lato, sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.reels-credit {
    display: flex;
    gap: 6px;
    align-items: center;
}

.reels-credit a {
    color: #a7a7a7;
    text-align: center;
    font-family: Lato;
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin: 0;
}


/* --- ANIMATIONS & INTERACTIONS --- */

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s;
    z-index: 10;
}

.video-card.paused .play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.like-btn.liked .heart-icon {
    fill: #fe2c55;
    stroke: #fe2c55;
    animation: heartBounce 0.3s ease-in-out;
}


/* Style untuk Loader */

.video-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    margin-top: -20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    z-index: 5;
    animation: spin 1s linear infinite;
    display: none;
    pointer-events: none;
}

.video-loader.active {
    display: block;
}


/* Animasi Pusing */

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.replies-list {
    display: none;
    margin-top: 10px;
}

.replies-list.active {
    display: block;
}

.view-replies-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 5px 0;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-replies-btn:hover {
    color: #fff;
}

.view-replies-btn::before {
    content: "";
    display: inline-block;
    width: 15px;
    height: 1px;
    background-color: #999;
}

.comment-footer.reply-active {
    font-weight: bold;
}

@media (max-width: 768px) {
    .navigation-buttons {
        display: none !important;
    }
    #commentsSidebar {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 80vh;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
        z-index: 1000;
    }
    #commentsSidebar.active {
        transform: translateY(0);
    }
    #commentsList {
        height: calc(100% - 120px);
        overflow-y: auto;
    }
    #commentsSidebar::before {
        content: "";
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background-color: #ddd;
        border-radius: 2px;
    }
}

.comment-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    /* adjust if needed */
    width: 100%;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
}
