/* --- ریست و تنظیمات اولیه --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: #f8f9fa;
    color: #222;
    line-height: 1.7;
    direction: rtl;
}

/* --- هدر اصلی (75px) --- */
.main-header {
    width: 100%;
    height: 75px;
    background: #1a1a1a;
    color: white;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.9rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: #3B82F6;
}

.auth-links {
    display: flex;
    gap: 16px;
    font-size: 0.95rem;
}

.auth-links a,
.auth-links span {
    color: white;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* --- منوی دسته‌بندی‌ها --- */
.category-menu {
    background: white;
    padding: 0.8rem 0;
    overflow-x: auto;
    white-space: nowrap;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
    text-align:center;
}

.menu-item {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 4px;
    color: #555;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background: #e0e0e0;
    color: #1E40AF;
}

.menu-item.active {
    background: #1E40AF;
    color: white;
    font-weight: 500;
}

/* --- فاصله بعد از منو --- */
.spacer {
    height: 1rem;
    background: #f8f9fa;
}

/* --- صفحه دو ستونه (25% و 75%) --- */
.page-layout {
    display: grid;
    grid-template-columns: 25% 75%;
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}



@media (max-width: 768px) {
    .page-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        margin-bottom: 1.5rem;
    }
}
/* --- سایدبار --- */
.sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    align-self: start;
    position: sticky;
    top: 90px;
}

.sidebar h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #222;
    border-bottom: 2px solid #1E40AF;
    padding-bottom: 0.5rem;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-link {
    display: block;
    padding: 0.6rem 1rem;
    color: #555;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background: #f0f0f0;
    color: #1E40AF;
}

.sidebar-link.active {
    background: #1E40AF;
    color: white;
}

/* --- محتوای اصلی --- */
.main-content {
    display: flex;
    flex-direction: column;
}

/* --- تب‌ها: داغ / تازه --- */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.6rem 1.2rem;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px 8px 0 0;
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.tab:hover {
    background: #e0e0e0;
}

.tab.active {
    background: white;
    color: #1E40AF;
    border-bottom: 2px solid white;
    font-weight: bold;
}

/* --- لیست لینک‌ها --- */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* --- هر آیتم لینک --- */
.link-item {
    display: grid;
    grid-template-columns: 80px 1fr 120px;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    align-items: start;
}

/* --- بخش رأی (چپ) --- */
.vote-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    width: 100%;
}

.vote-up,
.vote-down {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    font-size: 1.2rem;
    cursor: pointer;
    font-weight: bold;
}

.vote-up {
    background: #1E40AF;
    color: white;
}

.vote-down {
    background: #d9534f;
    color: white;
}

.vote-count {
    font-weight: bold;
    color: #333;
    font-size: 0.95rem;
}

.vote-up:hover {
    background: #1E3A8A;
}

.vote-down:hover {
    background: #c9302c;
}

/* --- محتوای لینک --- */
.link-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.link-title a {
    font-size: 1.2rem;
    font-weight: 500;
    color: #1E40AF;
    text-decoration: none;
    line-height: 1.4;
}

.link-title a:hover {
    text-decoration: underline;
}

/* --- اطلاعات زیر عنوان --- */
.link-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: #555;
}

/* --- تامپنیل و توضیح --- */
.link-body {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    align-items: start;
}

.thumbnail {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
    flex-shrink: 0;
}

.link-desc {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
    flex: 1;
}

/* --- دکمه "نظر دهید" (راست) --- */
.comment-btn {
    display: flex;
    align-items: start;
}

.comment-btn a {
    background: #f0f0f0;
    color: #333;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
}

.comment-btn a:hover {
    background: #1E40AF;
    color: white;
}

/* --- صفحه‌بندی --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-link {
    padding: 0.6rem 1rem;
    background: #1E40AF;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 40px;
    text-align: center;
}

.page-link:hover {
    background: #1E3A8A;
}

.page-link.active {
    background: #1E3A8A;
    font-weight: bold;
}

/* --- ریسپانسیو --- */
@media (max-width: 768px) {
    .main-header {
        height: 60px;
        padding: 0 15px;
    }

    .logo {
        font-size: 1.6rem;
    }

    .auth-links {
        font-size: 0.9rem;
        gap: 12px;
    }

    .page-layout {
        gap: 1.5rem;
        padding: 0 15px;
    }

    .link-item {
        grid-template-columns: 60px 1fr;
        gap: 0.8rem;
        padding: 0.8rem;
    }

    .vote-up,
    .vote-down {
        width: 26px;
        height: 26px;
        font-size: 1.1rem;
    }

    .link-body {
        flex-direction: column;
    }

    .thumbnail {
        width: 100%;
        height: auto;
    }

    .comment-btn {
        margin-top: 0.5rem;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}


/* --- سایدبار --- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-box {
    background: white;
    padding: 1.2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}

.sidebar-box h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #222;
    border-bottom: 2px solid #1E40AF;
    padding-bottom: 0.5rem;
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    border-bottom: 1px dashed #eee;
}

.sidebar-list li:last-child {
    border-bottom: none;
}

.sidebar-list a {
    color: #1E40AF;
    text-decoration: none;
}

.sidebar-list a:hover {
    text-decoration: underline;
}

/* --- تبلیغات --- */
.ad-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
}

.ad-box h3 {
    margin-bottom: 0.8rem;
    color: white;
    border: none;
}

.ad-content {
    background: rgba(255,255,255,0.1);
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* --- نوار پیشرفت (Progress Bar) --- */
.progress-container {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 0.5rem 0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 10px;
    background: linear-gradient(90deg, #5cb85c, #4cae4c);
    text-align: right;
    color: white;
    font-size: 0.75rem;
    line-height: 20px;
    padding: 0 5px;
    box-sizing: border-box;
}

.progress-bar.warning {
    background: linear-gradient(90deg, #d9534f, #c9302c);
}

/* --- نمودار --- */
.chart-container {
    width: 100%;
    height: 300px;
    margin: 1rem 0;
}

/* --- ریسپانسیو --- */
@media (max-width: 768px) {
    .progress-container {
        height: 18px;
    }
    .progress-bar {
        font-size: 0.7rem;
        line-height: 18px;
    }
}

/* --- هدر مدرن (سازگار با استایل موجود) --- */
.modern-header {
    width: 100%;
    height: 75px;
    background: #1a1a1a;
    color: white;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.modern-header .header-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modern-header .logo {
    font-size: 1.9rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modern-header .logo span {
    color: #3B82F6;
}

.modern-header .header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.95rem;
}

.modern-header .header-greeting {
    color: #d1d5db;
    font-size: 0.95rem;
    font-weight: 400;
}

.modern-header .header-link {
    color: #d1d5db;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.modern-header .header-link:hover {
    color: white;
    background: #333;
}

.modern-header .header-link.logout:hover {
    background: #dc2626;
    color: white;
}

.modern-header .btn-submit {
    background: #3B82F6;
    color: white !important;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
}

.modern-header .btn-submit:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.modern-header .btn-submit:active {
    transform: translateY(0);
}

/* --- ریسپانسیو --- */
@media (max-width: 768px) {
    .modern-header {
        height: 60px;
        padding: 0 15px;
    }

    .modern-header .header-container {
        gap: 1rem;
    }

    .modern-header .header-nav {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .modern-header .header-greeting,
    .modern-header .header-link,
    .modern-header .btn-submit {
        font-size: 0.9rem;
        padding: 0.4rem 0.6rem;
    }

    .modern-header .btn-submit {
        padding: 0.45rem 1rem;
    }
}
.btn-submit {
    background: #3B82F6;
    color: white !important;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
}
.btn-submit:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}