/* استایل‌های پایه */
body {
    font-family: 'Vazirmatn', sans-serif;
    background: #f8f9fa;
    margin: 0;
}

/* رنگ‌ها و سایه‌های تکراری */
.site-header,
.site-footer,
.sidebar,
.table-container,
.card,
.job-card,
.request-card,
.table,
form,
.notification-list li,
.container {
    background: #ffffff; /* پس‌زمینه سفید */
}

/* سایه‌های عمومی */
.site-header,
.site-footer {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* سایه هدر و فوتر */
}
.sidebar {
    box-shadow: 2px 0 10px rgba(0,0,0,0.05); /* سایه سایدبار */
}
.table-container,
.card,
.job-card,
.request-card,
.table,
.notification-list li,
form {
    /* سایه کارت‌ها، جدول، و فرم‌ها */
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover,
.job-card:hover,
.notification-list li:hover,
form:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12); /* سایه هاور */
}
.container {
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* شعاع گوشه‌ها */
.table-container,
.card,
.job-card,
.request-card,
.table,
.notification-list li,
form,
.container {
    border-radius: 16px; /* گوشه‌های گرد برای اجزای اصلی محتوا */
}
.sidebar a,
.btn,
.filter-bar select, .filter-bar input, .filter-bar button,
.actions button,
input, select, textarea,
input[type="text"], textarea,
.error,
.status,
.filter select {
    border-radius: 12px; /* گوشه‌های گرد برای اجزای کوچکتر */
}
input[type="text"], textarea, select {
    border-radius: 10px;
}

/* رنگ‌های تکراری: #111827 (مشکی/تیره)، #1f2937 (تیره هاور) */
.site-header .brand-link,
.site-header .primary-navigation a,
.sidebar h2,
.sidebar a,
.topbar h1,
.card h3,
.card span,
.job-info h3,
.notification-info span,
form h2,
.table-card th,
h1,
.btn {
    color: #111827;
}
.btn,
.btn-invite,
.filter-bar button,
form button,
.actions button,
.notification-list a {
    background: #111827; /* پس‌زمینه دکمه‌ها */
    color: white;
    transition: background 0.3s, transform 0.2s;
    border: none;
    border-radius: 12px;
}
.btn:hover,
.filter-bar button:hover,
form button:hover,
.actions button:hover,
.notification-list a:hover {
    background: #1f2937; /* پس‌زمینه دکمه‌ها در هاور */
    transform: translateY(-1px);
}


/* متن‌های تکراری */
.site-header .brand-link,
.sidebar h2,
.site-footer .footer-brand-mark {
    font-weight: 800;
    font-size: 1.2rem;
}
.site-header .primary-navigation a,
.site-footer .footer-links-block a,
.sidebar a {
    font-weight: 500;
}
.topbar h1,
.card span,
form h2,
h1 {
    font-weight: 700;
}
.table th,
.status,
.btn,
.filter-bar button,
form label,
form button,
.request-card p,
.request-card button,
.card h3,
.notification-list a,
.actions .btn,
.container label,
.container .btn {
    font-weight: 600;
}
.card small,
.card p,
.job-meta,
.notification-date,
.table-card td {
    color: #555;
}

/* هدر */
.site-header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.site-header .brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}
.site-header .primary-navigation a {
    margin-left: 1rem;
    text-decoration: none;
    transition: color 0.3s;
}
.site-header .primary-navigation a:hover {
    color: #6b7280;
}

/* فوتر */
.site-footer {
    padding: 1.5rem 2rem;
    text-align: center;
}
.site-footer .footer-brand-mark {
    margin-right: 0.5rem;
}
.site-footer .footer-links-block a {
    margin: 0 0.5rem;
    text-decoration: none;
}
.site-footer .footer-links-block a:hover {
    text-decoration: underline;
}

/* ساختار صفحه اصلی/داشبورد */
.dashboard-container {
    display: flex;
    min-height: calc(100vh - 72px); /* کسر ارتفاع هدر */
    gap: 1rem;
}

/* سایدبار */
.sidebar {
    width: 240px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: calc(100vh - 72px);
}
.sidebar h2 {
    font-size: 20px;
    text-align: center;
    margin-bottom: 1rem;
}
.sidebar a {
    display: block;
    padding: 10px;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
}
.sidebar a.active, .sidebar a:hover {
    background: #111827;
    color: #fff;
}
.sidebar .logout {
    margin-top: auto;
    text-align: center;
}
.sidebar .logout a {
    color: #dc2626;
    text-decoration: none;
}

/* محتوا (Main) و نوار بالا (Topbar) */
.main {
    flex: 1;
    padding: 2rem;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.topbar h1 {
    font-size: 1.6rem;
    margin: 0 0 1rem 0;
}
.topbar h1 {
    margin: 0;
}

/* جدول عمومی */
.table-container {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}
.table th {
    background: #f0f3f6;
    font-weight: 600;
}

/* استایل‌های جدول متمرکز */
.table-container {
    margin-top: 2rem;
    overflow-x: auto;
}
.table {
    overflow: hidden;
}
.table th {
    background: #f3f4f6;
    color: #111827;
}

/* کارت‌های داشبورد و پروفایل */
.cards {
    margin-top: 2rem;
    gap: 1rem;
    display: grid;
    /* این شامل هر دو تعریف است: */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.card h3 {
    margin: 0.5rem 0;
    font-size: 1rem;
}
.card span {
    font-size: 1.5rem;
}
.card p {
    margin: 0.5rem 0;
    font-size: 14px;
}
.card h3 {
    margin: 0;
    font-size: 1.1rem;
}

/* دکمه‌ها (Button - .btn) */
.btn {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    cursor: pointer;
}
.btn {
    padding: 8px 14px;
    font-size: 14px;
}
.btn-message { background: gray; color: white; }
.btn-delete { background: red; color: white; }
.btn.danger { background: #dc2626; }
.btn.secondary { background: #6c757d; }
.btn.success { background: black; }


/* استایل‌های وضعیت (Status) */
.status {
    padding: 6px 12px;
    font-size: 13px;
    display: inline-block;
}
.status.pending { background: #fff3cd; color: #856404; }
.status.review { background: #d1ecf1; color: #0c5460; }
.status.rejected { background: #f8d7da; color: #721c24; }
.status.invited { background: #c3e6cb; color: #155724; }
.status.hired { background: #b8daff; color: #004085; }
.status.scheduled { background:#c3e6cb; color:#155724; }
.status.completed { background:#b8daff; color:#004085; }
.status.cancelled { background:#f8d7da; color:#721c24; }
.status.pending { background:#ffeeba; color:#856404; }
.status.active { background: darkgreen; color: white;}
.status.expired { background: gray; color: black;}
.status.draft { background: gray; color: #000;}
.status.unread { background: #ffeeba; color: #856404; }
.status.read { background: #d4edda; color: #155724; }


/* استایل‌های فرم (Form) */
form {
    padding: 1.5rem;
    margin-bottom: 2rem;
}
form h2 {
    margin-top: 0;
    font-size: 1.2rem;
}
form label {
    display: block;
    margin-top: 1rem;
}
form input, form select {
    width: 100%;
    padding: 10px;
    margin-top: 0.3rem;
    border: 1px solid #ccc;
}
form button {
    margin-top: 1rem;
    padding: 10px 20px;
    cursor: pointer;
}
/* استایل‌های تکراری input, select, textarea */
input, select, textarea {
    width: 100%;
    padding: 10px;
    margin: .5rem 0 1rem;
    border: 1px solid #ccc;
    font-family: inherit;
}
textarea {
    resize: vertical;
    min-height: 120px;
}
input[type="text"], textarea, select {
    padding: 10px;
    border: 1px solid #ccc;
    font-size: 1rem;
    width: 100%;
}

/* پیام‌ها و خطاها */
.message {
    background: #e9f7ef;
    border: 1px solid #b2dfdb;
    color: #155724;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.success { color: green; margin-bottom: 1rem; }
.error { color: red; margin-bottom: 1rem; }
.error {
    background: #fdecea;
    color: #b91c1c;
    padding: 10px;
    border-radius: 8px;
}

/* کانتینر فرم‌ها */
.forms-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.forms-container form {
    flex: 1;
    min-width: 300px;
    margin-bottom: 0;
}

/* کارت‌های جدول (Table Card) */
.table-card {
    padding: 1.5rem;
    margin-bottom: 2rem;
    overflow-x: auto;
}
.table-card table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}
.table-card th, .table-card td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
}
.table-card th {
    background: #f3f4f6;
    font-weight: 700;
    color: #111827;
}
.table-card tr:hover {
    background: #f9fafb;
}

/* کارت درخواست (Request Card) */
.request-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.request-card p {
    margin: 0 0 1rem 0;
}
.request-card button {
    margin-right: 0.5rem;
    padding: 8px 16px;
    cursor: pointer;
}

/* گرید کارت‌ها */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
.cards-grid > .table-card,
.cards-grid > .request-card,
.cards-grid > form {
    margin-bottom: 0;
}

/* نوار فیلتر (Filter Bar) */
.filter-bar {
    margin-top: 1rem;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-bar select, .filter-bar input, .filter-bar button {
    padding: 6px 10px;
    border: 1px solid #ccc;
    font-size: 14px;
}
.filter {
    margin-top: 1rem;
}
.filter select {
    padding: 6px 10px;
    border: 1px solid #ccc;
}


/* آگهی‌ها (Jobs) */
.jobs {
    margin-top: 2rem;
    display: grid;
    gap: 1rem;
}
.job-card {
    padding: 1.5rem;
}
.job-info h3 {
    margin: 0 0 .5rem 0;
    font-size: 1.1rem;
}
.job-meta {
    font-size: 14px;
}

.actions {
    margin-top: 0.5rem; /* کاهش فاصله از بالا (از 1rem به 0.5rem) */
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem; /* کنترل فاصله بین دکمه‌ها */
        align-items: center; 
}

.actions button,
.actions a { /* مطمئن شوید که این استایل به لینک‌ها هم اعمال می‌شود */
    padding: 6px 10px;
    margin: 0; 
    font-size: 13px;
    /* ✅ خط اضافه شده: رفع مشکل ارتفاع خط */
    line-height: 1;
}
/* اعلان‌ها (Notifications) */
.notification-list {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
    display: grid;
    gap: 1rem;
    
}
.notification-list li {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.notification-list li.new { background: #f0f9ff; }
.notification-list li.resume { border-left: 5px solid #007bff; }
.notification-list li.message { border-left: 5px solid #28a745; }
.notification-list li.interview { border-left: 5px solid #ffc107; }
.notification-list li.expire { border-left: 5px solid #dc2626; }
.notification-info {
    display: flex;
    flex-direction: column;
}
.notification-date {
    font-size: 12px;
    margin-top: 4px;
}
.notification-list a {
    padding: 6px 12px;
    text-decoration: none;
}

/* جزییات پیام (Message) */
.message-preview {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* مدال (Modal) */
#resumeModal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: auto;
}
#resumeModal .resume-wrapper {
    background: #fff;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

/* کانتینر محتوای تکی (مثلاً برای ساخت آگهی یا ویرایش پروفایل) */
.container {
    max-width: 700px;
    margin: 2rem auto;
    padding: 2rem;
}
h1 {
    text-align: center;
}
.container form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
    box-shadow: none;
    background: transparent;
    margin-bottom: 0;
}
.container form:hover {
    transform: none;
    box-shadow: none;
}
.container form label {
    margin-top: 0;
}
.container .btn {
    padding: 10px 20px;
    border: none;
}

/* =========================================
   استایل‌های مخصوص موبایل (Responsive)
   ========================================= */

   @media (max-width: 768px) {

    /* 1. اصلاح کانتینر اصلی و چیدمان */
    .dashboard-container {
        flex-direction: column; /* سایدبار و محتوا زیر هم قرار بگیرند */
    }

    /* 2. تنظیم سایدبار برای موبایل */
    .sidebar {
        width: 100%; /* عرض کامل */
        height: auto;
        min-height: auto;
        flex-direction: row; /* لینک‌ها کنار هم */
        overflow-x: auto; /* اسکرول افقی برای لینک‌ها */
        white-space: nowrap;
        padding: 10px;
        box-sizing: border-box;
        border-bottom: 1px solid #eee;
    }
    
    .sidebar h2 {
        display: none; /* مخفی کردن عنوان سایدبار در موبایل برای صرفه جویی در فضا */
    }

    .sidebar a {
        display: inline-block;
        margin-right: 5px;
        padding: 8px 15px;
        border-radius: 20px;
        font-size: 14px;
    }

    .sidebar .logout {
        margin-top: 0;
        margin-right: auto; /* دکمه خروج به سمت چپ برود */
        padding: 0 10px;
    }

    /* 3. اصلاح هدر سایت */
    .site-header {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        text-align: center;
    }

    .site-header .primary-navigation {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .site-header .primary-navigation a {
        margin-left: 0;
        margin: 0 5px;
    }

    /* 4. محتوای اصلی */
    .main {
        padding: 1rem; /* کاهش پدینگ */
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .topbar h1 {
        font-size: 1.3rem;
    }

    /* 5. گرید کارت‌ها و فرم‌ها */
    .cards, 
    .cards-grid,
    .forms-container {
        grid-template-columns: 1fr; /* تک ستون شدن گریدها */
        display: flex;
        flex-direction: column;
    }
    
    .forms-container form {
        min-width: 100%; /* فرم تمام عرض */
    }

    /* 6. لیست اعلان‌ها */
    .notification-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .notification-list a {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }

    /* 7. جداول */
    .table th, .table td, 
    .table-card th, .table-card td {
        padding: 8px 5px; /* کاهش فضای سلول‌ها */
        font-size: 12px; /* کوچک کردن فونت جدول */
    }
    
    /* اطمینان از اسکرول خوردن جداول */
    .table-container, .table-card {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 8. دکمه‌ها و فیلترها */
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-bar input, 
    .filter-bar select, 
    .filter-bar button {
        width: 100%;
        margin-bottom: 5px;
    }

    .actions {
        justify-content: center;
    }
    
    .actions button {
        flex: 1; /* دکمه‌ها در موبایل هم‌اندازه شوند */
    }

    /* 9. مدال (Modal) */
    #resumeModal .resume-wrapper {
        flex-direction: column;
        width: 95%;
        height: 90vh;
        overflow-y: scroll;
    }

    /* 10. فوتر */
    .site-footer {
        padding: 1rem;
    }
    .site-footer .footer-links-block {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 10px;
    }
}