        .theme-toggle {
            background-color: transparent;
            border: none;
            outline: none;
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
        }
        
        body:not(.darkTheme) .theme-toggle {
            background-color: #ffffff;
            border: 1px solid #e0e0e0;
        }

        .darkTheme {
            --primary-color: #f4aa10;
            --secondary-color: #c1baba;
            --bg-color: #414143;
            --text-color: #ffffff;
            --border-color: #555555;
            --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }

        .user-avatar {
            width: 33px;
            height: 33px;
            border-radius: 50%;
            overflow: hidden;
            border: 2px solid #e0e0e0;
        }
        
        .avatar-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        /* برای افکت hover */
        .nav-item:hover .user-avatar {
            border-color: #f4aa10;
            transition: border-color 0.3s ease;
        }

        body:not(.darkTheme) .theme-toggle svg {
            color: #000000;
        }
        
        body.darkTheme .theme-toggle {
            background-color: #2e2e2e;
            border: 1px solid #555555;
        }
        
        body.darkTheme .theme-toggle svg {
            color: #ffffff;
        }
        
        .theme-toggle:hover {
            transform: scale(1.1);
        }
        
        body.darkTheme .theme-toggle:hover {
            background-color: #414143;
        }

        body {
            font-family: 'Shabnam', 'Tahoma', sans-serif;
            font-size: 15px;
            direction: rtl;
            text-align: right;
            line-height: 1.5;
            margin: 0;
            padding: 0;
            background: #f8f9fc;
            color: #555555;
            transition: opacity ease-in 0.2s;
        }
        
        body[unresolved] {
            opacity: 0;
            display: block;
            overflow: hidden;
            position: relative;
        }
        
        .darkTheme {
            background: #1f1f20;
            color: #FFFFFF;
        }
        
        /* هدر و نویگیشن */
        header {
            position: fixed;
            width: 100%;
            left: 0;
            top: 0;
            z-index: 1001;
            background-color: #fdfdfd;
            border-bottom: solid 1px #7e7f7f54;
        }
        
        .darkTheme header {
            background-color: #414143;
            border-bottom: solid 1px var(--border-color);
        }
        
        .header-container {
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0px;
        }
        
        .logo {
            width: 30px;
            height: 30px;
        }
        
        .search-container {
            flex: 1;
            max-width: 600px;
            margin: 0 8px;
        }
        
        .search-box {
            display: flex;
            background-color: #f0f0f0;
            border-radius: 24px;
            overflow: hidden;
            transition: all 0.3s ease;
        }
        
        .darkTheme .search-box {
            background-color: #555555;
        }
        
        .search-box:focus-within {
            box-shadow: 0 0 0 2px var(--primary-color);
        }
        
        .search-input {
            flex: 1;
            border: none;
            outline: none;
            padding: 12px 16px;
            background: transparent;
            font-size: 14px;
            color: var(--text-color);
        }
        
        .search-input::placeholder {
            color: var(--secondary-color);
        }
        
        .search-button {
            background: none;
            border: none;
            padding: 0 15px;
            cursor: pointer;
            color: var(--secondary-color);
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .search-button:hover {
            color: var(--primary-color);
        }
        
        .darkTheme .search-button svg {
            color: #d7d7d7; /* تغییر رنگ آیکون جستجو به #d7d7d7 */
        }

        /* استایل‌های هدر از کد اول */
        .header-actions {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .theme-toggle {
            background-color: var(--bg-color);
            border: 1px solid var(--border-color);
            outline: none;
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
        }
        
        .theme-toggle:hover {
            transform: scale(1.1);
            background-color: rgba(0, 0, 0, 0.05);
        }
        
        .darkTheme .theme-toggle:hover {
            background-color: rgba(255, 255, 255, 0.05);
        }
                
        /* محتوای اصلی */
        .main-content {
            margin-top: 70px;
            max-width: 1400px;
            margin-left: auto;
            margin-right: auto;
        }
        
        /* بخش استوری */
        .stories-section {
            margin: 0px 0;
            padding: 0px 0;
        }
        
        .stories-container {
            display: flex;
            overflow-x: auto;
            scrollbar-width: none;
            padding: 10px 0;
            gap: 15px;
        }
        
        .stories-container::-webkit-scrollbar {
            display: none;
        }
        
        .story-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            cursor: pointer;
            min-width: 70px;
        }
        
        .story-avatar {
            width: 64px;
            height: 64px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(82deg, #7e7f7f 0%, #ffcc03 100%);
            padding: 2px;
        }
        
        .story-avatar img {
            width: 58px;
            height: 58px;
            border-radius: 50%;
            border: 2px solid white;
            object-fit: cover;
        }
        
        .story-username {
            margin-top: 5px;
            font-size: 12px;
            text-align: center;
            max-width: 70px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        
        /* تب های دسته بندی */
        .categories-section {
            margin: 0px 0;
            position: sticky;
            top: 50px;
            background-color: #f8f9fc;
            z-index: 99;
            padding: 10px 0;
        }
        
        .darkTheme .categories-section {
            background-color: #1f1f20;
        }
        
        .categories-container {
            display: flex;
            overflow-x: auto;
            scrollbar-width: none;
            gap: 10px;
            padding: 5px 0;
        }
        
        .categories-container::-webkit-scrollbar {
            display: none;
        }
        
        .category-item {
            border: 1px solid #d9d4d4;
            border-radius: 100px;
            padding: 6px 12px;
            font-size: 14px;
            color: #7a7777;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.3s ease;
        }
        
        .darkTheme .category-item {
            color: #fff;
            border-color: #555;
        }
        
        .category-item.active {
            border-color: #f4aa10;
            color: #f4aa10;
            font-weight: 700;
        }
        
        .category-item:hover {
            border-color: #f4aa10;
            color: #f4aa10;
        }
        
        /* شبکه ویدیوها */
        .videos-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 15px;
            margin: 20px 0;
        }
        
        .video-item {
            border-radius: 8px;
            overflow: hidden;
            background: #fff;
            transition: transform 0.3s ease;
            cursor: pointer;
        }
        
        .darkTheme .video-item {
            background: #414143;
        }
        
        .video-item:hover {
            transform: translateY(-5px);
        }
        
        .video-thumbnail {
            position: relative;
            width: 100%;
            padding-bottom: 56.25%; /* نسبت 16:9 */
            overflow: hidden;
        }
        
        .video-thumbnail img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .video-duration {
            position: absolute;
            bottom: 8px;
            left: 8px;
            background: rgba(0,0,0,0.8);
            color: white;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 12px;
        }
        
        .video-quality {
            position: absolute;
            top: 8px;
            right: 8px;
            background: rgba(92, 78, 78, 0.81);
            color: white;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: 700;
        }
        
        .special-badge {
            position: absolute;
            top: 8px;
            left: 8px;
            background: #f4aa10;
            color: white;
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: 700;
        }
        
        .video-info {
            padding: 10px;
        }
        
        .video-title {
            font-size: 14px;
            font-weight: 500;
            margin-bottom: 8px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            height: 40px;
            color: #333;
            line-height: 1.4;
        }
        
        .darkTheme .video-title {
            color: #fff;
        }
        
        .video-meta {
            display: flex;
            align-items: center;
            font-size: 12px;
            color: #737373;
        }
        
        .darkTheme .video-meta {
            color: #c1baba;
        }
        
        .channel-avatar {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            margin-left: 8px;
            object-fit: cover;
        }
        
        .channel-name {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        
        .video-stats {
            display: flex;
            gap: 5px;
            align-items: center;
        }
        
        .loading {
            text-align: center;
            padding: 20px;
            color: #777;
        }
        
        .darkTheme .loading {
            color: #aaa;
        }
        
        /* فوتور */
        footer {
            background-color: #e5e5e5;
            padding: 40px 0 20px;
            margin-top: 40px;
        }
        
        .darkTheme footer {
            background-color: #2e2e2e;
        }
        
        .footer-content {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }
        
        .footer-links {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 20px;
            margin-bottom: 30px;
        }
        
        .footer-column h3 {
            font-size: 16px;
            margin-bottom: 15px;
            color: #333;
        }
        
        .darkTheme .footer-column h3 {
            color: #fff;
        }
        
        .footer-column ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        
        .footer-column li {
            margin-bottom: 8px;
        }
        
        .footer-column a {
            color: #555;
            text-decoration: none;
            font-size: 14px;
        }
        
        .darkTheme .footer-column a {
            color: #fff;
        }
        
        .footer-column a:hover {
            color: #f4aa10;
        }
        
        .footer-bottom {
            border-top: 1px solid #ccc;
            padding-top: 20px;
            text-align: center;
            font-size: 14px;
            color: #777;
        }
        
        .darkTheme .footer-bottom {
            color: #aaa;
        }
        
        /* نویگیشن موبایل */
        .mobile-nav {
            position: fixed;
            bottom: 0;
            width: 100%;
            background-color: #e3e3e3;
            display: flex;
            justify-content: space-around;
            padding: 8px 0;
            z-index: 1000;
        }
        
        .darkTheme .mobile-nav {
            background-color: #2e2e2e;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-decoration: none;
            color: #4a4a4a;
            font-size: 10px;
        }
        
        .darkTheme .nav-item {
            color: #fff;
        }
        
        .nav-icon {
            width: 24px;
            height: 24px;
            margin-bottom: 4px;
        }
        
        .nav-item.active {
            color: #fbbc05;
        }
        
        /* رسپانسیو */
        @media (max-width: 768px) {
            .main-content {
                margin-top: 60px;
                padding: 10px;
            }
            
            .videos-grid {
                grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
                gap: 10px;
            }
            
            .search-container {
                margin: 0 10px;
            }
            
            .categories-section {
                top: 50px;
            }
        }
        
        @media (max-width: 480px) {
            .videos-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            
            .header-container {
                padding: 0 10px;
            }
        }
/* استایل‌های مودال استوری - نسخه اصلاح شده */
.story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.story-modal.active {
    display: flex;
}

.show-modal {
    width: 100%;
    max-width: 400px;
    height: 100%;
    max-height: 700px;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-container {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    background: #212121;
    gap: 5px;
    z-index: 100;
}

.progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    flex: 1;
    overflow: hidden;
    transform-origin: left;
    transition: transform 0.1s linear;
    transform: scaleX(0);
}

.progress.active {
    background: #ffcc00 !important;
    animation: progressAnimation 10s linear forwards;
}

.progress.completed {
    background: rgba(255, 255, 255, 0.3);
    transform: scaleX(1) !important;
}

@keyframes progressAnimation {
    0% { width: 0%; }
    100% { width: 100%; }
}

.show-modal-data {
    position: absolute;
    top: 0px;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    z-index: 90;
}

.flax-container {
    display: flex;
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.max-with {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

/* دکمه کلوز جدید - کنار پروفایل */
.close-story {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 110;
    backdrop-filter: blur(10px);
    font-size: 18px;
    font-weight: bold;
    margin-left: 10px; /* فاصله از پروفایل */
    flex-shrink: 0; /* جلوگیری از تغییر سایز */
}

.close-story:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.avatar-wrapper {
    position: relative;
    margin-left: 10px;
}

.avatar-container {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
}

.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.official-svg {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 15px;
    height: 15px;
    background: #f4aa10;
    border-radius: 50%;
    border: 2px solid #000;
}

#storyUsername {
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    font-size: 14px;
    margin-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reference-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 12px;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    flex-shrink: 0; /* جلوگیری از تغییر سایز */
}

.reference-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.text-container {
    position: absolute;
    bottom: 20px;
    left: 15px;
    right: 15px;
    color: #fff;
    text-align: center;
    z-index: 10;
}

.story-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    cursor: pointer;
    z-index: 80;
}

.story-prev {
    left: 0;
}

.story-next {
    right: 0;
}

.story-time {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-right: 10px;
    white-space: nowrap;
}

/* استایل برای محتوای کاربر */
.user-content {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0; /* برای truncate شدن متن */
}

.user-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.user-text {
    display: flex;
    flex-direction: column;
    margin-right: 10px;
    min-width: 0;
    flex: 1;
}

.username-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* برای موبایل‌ها */
@media (max-width: 768px) {
    .show-modal {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .show-modal-data {
        padding: 15px;
    }
    
    .close-story {
        width: 32px;
        height: 32px;
        margin-left: 8px;
    }
    
    .progress-container {
        top: 15px;
        left: 15px;
        right: 15px;
    }
    
    #storyUsername {
        font-size: 13px;
    }
    
    .story-time {
        font-size: 11px;
    }
    
    .reference-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* رسپانسیو */
@media (max-width: 992px) {
    .container {
        padding: 0 190px;
    }
}

@media (max-width: 480px) {
    .show-modal-data {
        padding: 12px;
    }
    
    .user-content {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .max-with {
        flex: 1;
        min-width: 0;
    }
}