/* ============================================
   پوچ لند - استایل صفحه کانال (کاملاً محلی)
   ============================================ */

@font-face {
    font-family: 'Vazirmatn';
    src: url('/uploads/fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/uploads/fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #0f0f0f;
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, system-ui, sans-serif;
    color: #f1f1f1;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ============================================
   هدر (هماهنگ با index)
   ============================================ */
.yt-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0f0f0f;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.yt-header-left { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

.yt-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}
.yt-logo-icon { color: #ff0000; font-size: 1.6rem; line-height: 1; }
.yt-logo-text .wm-fa { color: #ffb347; font-weight: 700; }

.yt-header-right { display: flex; align-items: center; gap: 8px; margin-right: auto; }

.yt-back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    transition: background 0.2s;
}
.yt-back-link:hover { background: rgba(255,255,255,0.15); }

/* ============================================
   بنر و آواتار کانال
   ============================================ */
.yt-channel-header { position: relative; margin-bottom: 24px; }

.yt-channel-banner {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    position: relative;
    overflow: hidden;
    border-radius: 0 0 24px 24px;
}
.yt-channel-banner.has-banner {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* سایه ملایم برای خوانایی روی بنر */
.yt-channel-banner::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(15,15,15,0.95) 0%, rgba(15,15,15,0.3) 50%, rgba(15,15,15,0) 100%);
    pointer-events: none;
}

.yt-channel-profile {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: flex-end;
    gap: 24px;
    transform: translateY(-50px);
    position: relative;
    z-index: 10;
}

.yt-channel-avatar-big {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 5px solid #0f0f0f;
    background: #1e293b;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    transition: 0.3s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}
.yt-channel-avatar-big:hover { transform: scale(1.02); }

.yt-channel-info { padding-bottom: 15px; flex: 1; min-width: 0; }
.yt-channel-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    line-height: 1.3;
}

.yt-channel-stats {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #ddd;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* دکمه اشتراک‌گذاری */
.yt-share-channel-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}
.yt-share-channel-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(59,130,246,0.5); }

/* ============================================
   تب‌ها
   ============================================ */
.yt-channel-tabs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    gap: 32px;
    margin-bottom: 24px;
}

.yt-tab-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1rem;
    padding: 12px 0;
    cursor: pointer;
    position: relative;
    transition: 0.2s;
    font-family: inherit;
    font-weight: 500;
}
.yt-tab-btn:hover { color: #fff; }
.yt-tab-btn.active { color: #fff; font-weight: 700; }
.yt-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #ffb347;
    border-radius: 3px 3px 0 0;
}

/* ============================================
   محتوای کانال
   ============================================ */
.yt-channel-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 24px;
    flex: 1;
    width: 100%;
}

.yt-tab-content { display: none; }
.yt-tab-content.active { display: block; }

/* گرید ویدیوها (هماهنگ با index) */
.yt-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px 16px;
}
@media (max-width: 1400px) { .yt-videos-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); } }
@media (max-width: 1000px) { .yt-videos-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } }
@media (max-width: 768px) { .yt-videos-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 8px; } }
@media (max-width: 360px) { .yt-videos-grid { grid-template-columns: 1fr; } }

/* انیمیشن ورود */
@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.yt-video-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s;
    animation: cardFadeIn 0.4s ease both;
}
.yt-video-card:hover { transform: translateY(-2px); }

.yt-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1a;
}
.yt-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.yt-video-card:hover .yt-thumbnail img { transform: scale(1.03); }

.yt-video-info { display: flex; gap: 12px; padding: 12px 0 0; }
.yt-video-text { flex: 1; min-width: 0; }

.yt-video-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #f1f1f1;
}

.yt-video-meta {
    font-size: 0.75rem;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

@media (max-width: 768px) {
    .yt-video-title { font-size: 0.82rem; line-height: 1.4; }
    .yt-video-meta { font-size: 0.68rem; }
    .yt-thumbnail { border-radius: 8px; }
}

/* موزیک */
.yt-music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
@media (max-width: 768px) { .yt-music-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.yt-music-card {
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    transition: 0.2s;
    border: 1px solid #272727;
}
.yt-music-card:hover { background: #222; border-color: #3a3a3a; }

.yt-music-thumb { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #0f0f0f; }
.yt-music-content { padding: 10px; }
.yt-music-title { font-size: 0.85rem; font-weight: 700; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-music-artist { font-size: 0.75rem; color: #aaa; }

/* حالت خالی */
.yt-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

/* ============================================
   فوتر
   ============================================ */
.yt-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 20px 24px;
    text-align: center;
    color: #666;
    font-size: 0.8rem;
    margin-top: auto;
}
.yt-footer a { color: #ffb347; font-weight: 700; }
.yt-footer a:hover { text-decoration: underline; }

/* ============================================
   Toast
   ============================================ */
.yt-toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: #27ae60;
    color: #fff;
    padding: 10px 24px;
    border-radius: 50px;
    z-index: 1100;
    display: none;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.yt-toast.show { display: block; }

/* ============================================
   ریسپانسیو
   ============================================ */
@media (max-width: 768px) {
    .yt-header { padding: 8px 10px; gap: 8px; }
    .yt-logo-text { font-size: 1.1rem; }
    .yt-channel-banner { height: 160px; border-radius: 0 0 16px 16px; }
    .yt-channel-profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
        transform: translateY(-50px);
        gap: 12px;
        padding: 0 12px;
    }
    .yt-channel-avatar-big { width: 100px; height: 100px; border-width: 4px; font-size: 2rem; }
    .yt-channel-title { font-size: 1.4rem; }
    .yt-channel-stats { justify-content: center; gap: 10px; font-size: 0.8rem; }
    .yt-channel-info { padding-bottom: 0; display: flex; flex-direction: column; align-items: center; width: 100%; }
    .yt-channel-tabs { padding: 0 12px; gap: 20px; justify-content: center; }
    .yt-tab-btn { font-size: 0.9rem; }
    .yt-channel-content { padding: 0 12px 20px; }
}

@media (max-width: 480px) {
    .yt-channel-title { font-size: 1.2rem; }
    .yt-channel-avatar-big { width: 90px; height: 90px; }
    .yt-tab-btn { font-size: 0.85rem; }
}