/* --- Global Variables & Basic Reset --- */
:root {
    --video-bg: #111;
    --video-text-primary: #ffffff;
    --video-text-secondary: #e0e0e0;
    --video-accent-color: #007bff;
    --video-action-icon-color: rgba(255, 255, 255, 0.9);
    --video-bottom-nav-bg: #1c1c1e;
    --video-tab-active-bg: rgba(255, 255, 255, 0.2);
    --video-tab-inactive-color: rgba(255, 255, 255, 0.7);
    --font-family-videos: "Cairo", sans-serif;
    --border-radius-videos: 8px;
    --danger-color-auth: #dc3545; /* From auth.css for consistency */
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: var(--font-family-videos);
    background-color: var(--video-bg);
    color: var(--video-text-primary);
    overscroll-behavior-y: contain;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    direction: rtl;
}
.video-player-container {
    width: 100%;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.video-player-container::-webkit-scrollbar {
    display: none;
}
.video-slide {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}
.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.video-overlay-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
    padding-top: 40px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.6) 0%,
        transparent 30%,
        transparent 70%,
        rgba(0, 0, 0, 0.3) 100%
    );
    z-index: 10;
}
.video-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 5px;
}
.live-indicator-container {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}
.live-btn {
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
    display: flex;
    align-items: center;
}
.live-btn i {
    margin-left: 5px;
    font-size: 0.9em;
}
.video-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex: 2;
}
.video-tab {
    background: none;
    border: none;
    color: var(--video-tab-inactive-color);
    font-family: var(--font-family-videos);
    font-size: 1.1em;
    font-weight: 600;
    padding: 5px 0;
    cursor: pointer;
    position: relative;
}
.video-tab.active {
    color: var(--video-text-primary);
}
.video-tab.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 100%;
    height: 2px;
    background-color: var(--video-text-primary);
}
.video-time {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--video-text-primary);
    flex: 1;
    display: flex;
    justify-content: flex-end;
}
.video-side-actions {
    position: absolute;
    bottom: 80px;
    left: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 15;
}
.author-follow {
    text-align: center;
    margin-bottom: 10px;
}
.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
    margin-bottom: -15px;
    position: relative;
    z-index: 1;
    margin-bottom: 5px;
}
.follow-plus-btn {
    background-color: var(--video-accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    cursor: pointer;
    margin: 0 auto 5px auto;
    position: relative;
    z-index: 0;
}
.follow-text {
    display: block;
    font-size: 0.8em;
    color: var(--video-text-secondary);
}
.action-btn {
    background: none;
    border: none;
    color: var(--video-action-icon-color);
    text-align: center;
    cursor: pointer;
}
.action-btn i {
    font-size: 1.8em;
    margin-bottom: 5px;
    display: block;
}
.action-btn span {
    font-size: 0.85em;
    display: block;
    font-weight: 600;
}
.action-btn.like-btn.liked i {
    color: #ff4141;
}
.video-info-bottom {
    color: var(--video-text-primary);
    padding-right: 5px;
    max-width: calc(100% - 80px);
    padding-bottom: 57px;
}
.video-author-name {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 5px;
}
.video-caption {
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 8px;
    color: var(--video-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.video-views {
    font-size: 0.8em;
    color: var(--video-text-secondary);
    display: flex;
    align-items: center;
}
.video-views i {
    margin-left: 5px;
}
.sponsored-tag {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 3px 8px;
    border-radius: var(--border-radius-videos);
    font-size: 0.75em;
    display: inline-block;
    margin-bottom: 10px;
}
.subscribe-bar-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--video-accent-color);
    color: white;
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: var(--border-radius-videos);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}
.subscribe-bar-btn i {
    font-size: 1.1em;
}
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #1c1c1ea1;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #333;
    z-index: 100;
}
.nav-item {
    color: var(--video-tab-inactive-color);
    text-align: center;
    font-size: 0.8em;
    flex-grow: 1;
    padding: 5px 0;
    text-decoration: none;
    position: relative;
}
.nav-item i {
    font-size: 1.5em;
    display: block;
    margin-bottom: 2px;
}
.nav-item.active,
.nav-item:not(.live-nav-btn):hover {
    color: var(--video-text-primary);
}
.nav-item span:not(.live-nav-btn span) {
    position: absolute;
    top: 2px;
    right: calc(50% - 15px);
    background-color: var(--danger-color-auth);
    color: white;
    font-size: 0.7em;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.live-nav-btn {
    background-color: var(--video-text-primary);
    color: var(--video-bottom-nav-bg);
    border-radius: var(--border-radius-videos);
    padding: 8px 18px !important;
    font-weight: 700;
    font-size: 1em !important;
    height: 38px;
    line-height: 22px;
    margin: 0 5px;
    flex-grow: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
}
.live-nav-btn span {
    font-size: inherit;
}
.profile-nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #555;
}
.nav-item.active .profile-nav-icon {
    border-color: white;
}
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1005;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.share-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.share-modal-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background-color: var(--video-bottom-nav-bg);
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    padding: 10px 0 20px 0;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 1006;
    transition: bottom 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
}
.share-modal-sheet.active {
    bottom: 0;
}
.sheet-header {
    display: flex;
    justify-content: center;
    padding-bottom: 10px;
}
.sheet-handle {
    width: 40px;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}
.sheet-content {
    padding: 0 15px;
}
.sheet-content h4 {
    font-size: 1em;
    margin-bottom: 15px;
    color: var(--video-text-secondary);
}
.send-to-users {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
}
.send-to-users::-webkit-scrollbar {
    height: 3px;
}
.send-to-users::-webkit-scrollbar-thumb {
    background: #555;
}
.user-share-item {
    text-align: center;
    min-width: 60px;
}
.user-share-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 5px;
}
.user-share-item span {
    font-size: 0.75em;
    display: block;
    color: var(--video-text-secondary);
}
.send-to-more {
    background: none;
    border: 1px solid #555;
    color: var(--video-text-secondary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    flex-shrink: 0;
}
.share-via-apps,
.additional-share-options {
    display: flex;
    overflow-x: auto;
    gap: 5px;
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #333;
}
.share-via-apps::-webkit-scrollbar,
.additional-share-options::-webkit-scrollbar {
    display: none;
}
.app-share-item,
.option-share-item {
    text-align: center;
    min-width: 70px;
}
.app-icon,
.option-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 5px auto;
    font-size: 1.5em;
    background-color: #333;
}
.app-share-item span,
.option-share-item span {
    font-size: 0.75em;
    display: block;
    color: var(--video-text-secondary);
}
.app-icon.whatsapp {
    background-color: #25d366;
}
.app-icon.telegram {
    background-color: #0088cc;
}
.app-icon.snapchat {
    background-color: #fffc00;
    color: #000;
}
.app-icon.copy-link,
.app-icon.repost {
    background-color: #555;
}
.option-icon {
    background-color: #444;
    font-size: 1.3em;
}
.comments-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1003;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.comments-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.comments-modal-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background-color: #28282b;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    padding-bottom: 0;
    max-height: 65vh;
    overflow: hidden;
    z-index: 1004;
    transition: bottom 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}
.comments-modal-sheet.active {
    bottom: 0;
}
.comments-modal-sheet .sheet-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #444;
    position: relative;
    flex-shrink: 0;
}
.comments-count-header {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--video-text-secondary);
}
.close-comments-modal-btn {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5em;
    color: var(--video-text-secondary);
    cursor: pointer;
}
.close-comments-modal-btn:hover {
    color: var(--video-text-primary);
}
.comments-list-container {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
}
.comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}
.comment-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.comment-body {
    flex-grow: 1;
}
.comment-author-info {
    margin-bottom: 3px;
}
.comment-author-info strong {
    font-size: 0.85em;
    color: var(--video-text-primary);
    font-weight: 600;
    margin-left: 8px;
}
.comment-author-info .comment-timestamp {
    font-size: 0.75em;
    color: #aaa;
}
.comment-text {
    font-size: 0.9em;
    color: var(--video-text-secondary);
    line-height: 1.5;
    margin-bottom: 5px;
    word-break: break-word;
}
.comment-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}
.reply-to-comment-btn,
.like-single-comment-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 0.8em;
    cursor: pointer;
    font-family: var(--font-family-videos);
}
.reply-to-comment-btn:hover,
.like-single-comment-btn:hover {
    color: var(--video-text-primary);
}
.like-single-comment-btn i {
    margin-left: 4px;
}
.like-single-comment-btn .fa-heart.liked {
    color: #ff4141;
}
.add-comment-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-top: 1px solid #444;
    background-color: #28282b;
    flex-shrink: 0;
}
.my-avatar-add-comment {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}
.add-comment-input {
    flex-grow: 1;
    background-color: #3a3a3c;
    border: none;
    border-radius: 18px;
    padding: 8px 15px;
    color: var(--video-text-primary);
    font-size: 0.9em;
    font-family: var(--font-family-videos);
}
.add-comment-input::placeholder {
    color: #8e8e93;
}
.send-comment-btn {
    background: none;
    border: none;
    color: var(--video-accent-color);
    font-size: 1.4em;
    cursor: pointer;
    padding: 5px;
}
.send-comment-btn:hover {
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 360px) {
    .video-tabs .video-tab {
        font-size: 1em;
    }
    .action-btn i {
        font-size: 1.6em;
    }
    .action-btn span {
        font-size: 0.75em;
    }
    .video-author-name {
        font-size: 1em;
    }
    .video-caption {
        font-size: 0.85em;
    }
    .bottom-nav i {
        font-size: 1.3em;
    }
    .live-nav-btn {
        padding: 6px 12px !important;
        font-size: 0.9em !important;
    }
    .send-to-users {
        gap: 10px;
    }
    .user-share-item {
        min-width: 50px;
    }
    .user-share-item img {
        width: 40px;
        height: 40px;
    }
    .app-share-item,
    .option-share-item {
        min-width: 60px;
    }
    .app-icon,
    .option-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }
}
