/* متغیرهای CSS */
:root {
    --primary-color: #f4aa10;
    --secondary-color: #555555;
    --bg-color: #ffffff;
    --text-color: #333333;
    --border-color: #d9d4d4;
    --transition: all 0.3s ease;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dark-theme {
    --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);
}

/* استایل‌های پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.dark-theme .theme-toggle svg {
    color: #ffffff !important;
}
        
body {
    font-family: 'Shabnam', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    direction: rtl;
    text-align: right;
    font-size: 15px;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* هدر */
header {
    position: fixed;
    width: 100%;
    left: 0;
    top: 0;
    z-index: 1001;
    background-color: var(--bg-color);
    border-bottom: solid 1px var(--border-color);
}

.header-container {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.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: var(--transition);
}

.dark-theme .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: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    color: var(--primary-color);
}

.theme-toggle {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    outline: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    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);
}

.dark-theme .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* بخش پروفایل */
.profile-header {
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
    margin-top: 60px;
}

.profile-banner {
    height: 350px;
    background-size: cover;
    background-position: center;
    position: relative;
    filter: blur(10px);
}

.profile-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
}

.profile-info {
    background-color: var(--bg-color);
    padding: 20px;
    position: relative;
    border-radius: 15px;
    margin-top: -100px;
    box-shadow: var(--shadow);
}

.profile-avatar {
    position: absolute;
    top: -60px;
    right: 20px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--bg-color);
    box-shadow: var(--shadow);
    z-index: 10;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-details {
    margin-right: 160px;
    padding-top: 25px;
}

.profile-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-username {
    color: var(--secondary-color);
    font-size: 16px;
    margin-bottom: 10px;
}

.profile-bio {
    margin-bottom: 15px;
    line-height: 1.6;
    max-width: 80%;
    color: var(--text-color);
}

.profile-stats-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.profile-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
}

.stat-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark-theme .stat-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.stat-number {
    font-size: 20px;
    font-weight: bold;
    display: block;
    line-height: 1.2;
    color: var(--text-color);
}

.stat-label {
    font-size: 12px;
    color: var(--secondary-color);
}

.profile-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    width: 290px;
}

.btn {
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Shabnam', sans-serif;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #e09a0e;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.dark-theme .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* تب‌های پروفایل */
.profile-tabs {
    border-bottom: 1px solid var(--border-color);
    margin-top: 20px;
}

.tabs-container {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.tab-item {
    padding: 12px 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    position: relative;
    color: var(--secondary-color);
}

.tab-item.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
}

.tab-item:hover:not(.active) {
    color: var(--primary-color);
    background-color: rgba(0, 0, 0, 0.02);
}

.dark-theme .tab-item:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.02);
}

.tab-content {
    margin-top: 20px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* شبکه ویدیوها */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.video-item {
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-color);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    border: 1px solid var(--border-color);
}

.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;
    transition: transform 0.5s ease;
}

.video-item:hover .video-thumbnail img {
    transform: scale(1.05);
}

.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;
    font-weight: 500;
}

.video-quality {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.video-info {
    padding: 12px;
}

.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: var(--text-color);
    line-height: 1.4;
}

.video-meta {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--secondary-color);
}

.channel-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-left: 8px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.channel-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-stats {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* بخش اطلاعات کاربر */
.user-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.info-card {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.info-card h3 {
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    color: var(--text-color);
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--secondary-color);
    font-size: 14px;
}

.info-item span:last-child {
    color: var(--text-color);
    font-weight: 500;
}

/* نویگیشن موبایل */
.mobile-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: #e3e3e3;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
    border-top: 1px solid #c1bfbf8f;
}

.dark-theme .mobile-nav {
    background-color: #2e2e2e;
    border-top: 1px solid #444;
}

.dark-theme .nav-item {
    color: #fff;
}

.dark-theme .nav-item.active {
    color: #f4aa10; 
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #4a4a4a;
    font-size: 10px;
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.nav-item.active {
    color: #fbbc05;
}


.user-avatar {
    width: 33px;
    height: 33px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-item:hover .user-avatar {
    border-color: var(--primary-color);
}

/* استایل‌های عمومی برای المان‌های مشترک */
.main-content {
    min-height: calc(100vh - 120px);
    padding-bottom: 60px;
}

/* استایل برای اسکرول بار */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* رسپانسیو */
@media (max-width: 992px) {
    .profile-details {
        margin-right: 150px;
    }
    
    .profile-stats {
        gap: 15px;
    }
    
    .container {
        padding: 0 10px;
    }
}

@media (max-width: 768px) {
    .profile-banner {
        height: 200px;
    }
    
    .profile-info {
        margin-top: -50px;
        padding: 15px;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
        top: -40px;
        right: 15px;
        border-width: 3px;
    }
    
    .profile-details {
        margin-right: 100px;
        padding-top: 20px;
    }
    
    .profile-name {
        font-size: 20px;
    }
    
    .profile-bio {
        max-width: 100%;
        font-size: 14px;
    }
    
    .profile-stats-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .profile-stats {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .profile-actions {
        width: 100%;
        justify-content: center;
    }
    
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .user-details {
        grid-template-columns: 1fr;
    }
    
    .header-container {
        padding: 0 10px;
    }
    
    .search-container {
        margin: 0 5px;
    }
}

@media (max-width: 576px) {
    .profile-details {
        margin-right: 0;
        padding-top: 25px;
    }
    
    .profile-stats {
        gap: 8px;
    }
    
    .stat-item {
        padding: 8px 5px;
        flex: 1;
        min-width: 70px;
    }
    
    .stat-number {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .videos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .video-info {
        padding: 8px;
    }
    
    .video-title {
        font-size: 13px;
        height: 36px;
    }
    
    .profile-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-info {
        margin-top: -30px;
    }
    
    .profile-avatar {
        width: 75px;
        height: 75px;
        top: -40px;
    }
    
    .profile-name {
        font-size: 18px;
    }
    
    .profile-username {
        font-size: 14px;
    }

}

@media (max-width: 360px) {
    .container {
        padding: 0 5px;
    }
    
    .profile-stats {
        flex-direction: column;
        gap: 5px;
    }
    
    .stat-item {
        width: 100%;
        text-align: right;
        padding: 5px 0;
    }
    
    .video-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .channel-avatar {
        margin-left: 0;
        margin-right: 8px;
    }
}