* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #000;
    color: #fff;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    height: 100vh;
    position: fixed;
    width: 100%;
}

/* دکمه برگشت */
.back-button-container {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 100;
}

/* دکمه صدا/بی‌صدا */
.sound-toggle-global {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 100;
}

.sound-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    font-size: 18px;
}

.sound-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.sound-toggle-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: #ff0050;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.back-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-2px);
}

.back-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transform: rotate(180deg); /* چرخش آیکون برای راست به چپ */
}

.video-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    scroll-snap-align: start;
    flex-shrink: 0;
}

.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #000;
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 15px;
    box-sizing: border-box;
}

.video-info {
    margin-bottom: 0;
    flex: none;
    align-self: flex-start;
    width: calc(100% - 80px);
    overflow: hidden;
}

.video-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.video-desc {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
    line-height: 1.4;
    max-height: 3.2em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    object-fit: cover;
}

.username {
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-actions {
    position: absolute;
    right: 20px;
    bottom: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 25px;
    padding: 15px 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 20;
    min-width: 60px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 5px;
    width: 40px;
}

.action-btn:active {
    transform: scale(0.95);
}

.action-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    font-size: 16px;
    transition: all 0.3s;
}

.action-count {
    font-size: 12px;
    font-weight: bold;
}

.like-btn .action-icon {
    color: #fff;
}

.like-btn.active .action-icon {
    color: #ff0050;
    background: rgba(255, 0, 80, 0.2);
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: rgba(255,255,255,0.3);
    z-index: 15;
}

.progress-fill {
    height: 100%;
    background-color: #ff0050;
    width: 0%;
    transition: width 0.1s linear;
}

.swipe-indicator {
    position: absolute;
    top: 50%;
    width: 100%;
    text-align: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 5;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 20px;
    width: 150px;
    margin: 0 auto;
}

.swipe-up {
    top: 80%;
    animation: floatUp 2s infinite;
}

.swipe-down {
    top: 20%;
    animation: floatDown 2s infinite;
}

@keyframes floatUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes floatDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

.controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 5;
}

.play-pause-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255,255,255,0.2);
}

.play-icon, .pause-icon {
    color: white;
    font-size: 30px;
}

.play-icon {
    margin-left: 5px;
}

.video-list {
    position: relative;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
}

.video-item {
    position: relative;
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    flex-shrink: 0;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* حذف استایل category-tabs */
.category-tabs {
    display: none;
}

/* استایل برای اسکرول بار مخفی */
.video-list::-webkit-scrollbar {
    display: none;
}

/* انیمیشن برای انتقال بین ویدئوها */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.video-item.active {
    animation: slideIn 0.3s ease-out;
}

/* بهبود اسکرول برای موبایل */
.video-list {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: y mandatory;
    overscroll-behavior: none;
}

.video-item {
    scroll-snap-stop: always;
}

/* responsive adjustments */
@media (max-width: 768px) {

    .back-button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .back-button svg {
        width: 16px;
        height: 16px;
    }
    
    .sound-toggle-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .video-title {
        font-size: 16px;
    }
    
    .back-button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .back-button svg {
        width: 16px;
        height: 16px;
    }
    
    .video-title {
        font-size: 16px;
    }
    
    .video-desc {
        font-size: 13px;
    }
    
    .action-btn {
        width: 35px;
    }
    
    .action-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .video-info {
        width: calc(100% - 70px);
    }
}

/* بهبود عملکرد اسکرول */
.video-list {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* جلوگیری از کشیدن تصویر */
.video-player {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* بهبود عملکرد لمسی */
.video-container {
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
}