/* style.css */

/* =========================================
   0. تنظیمات عمومی و Reset (جلوگیری از بریدگی پدینگ‌ها)
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

/* =========================================
   1. تنظیمات فونت و چیدمان پایه (Sticky Footer)
   ========================================= */
@font-face {
    font-family: 'B Yekan';
    src: url('../fonts/BYEKAN.eot');
    src: url('../fonts/BYEKAN.eot?#iefix') format('embedded-opentype'),
         url('../fonts/BYEKAN.woff2') format('woff2'),
         url('../fonts/BYEKAN.woff') format('woff'),
         url('../fonts/BYEKAN.TTF') format('truetype'),
         url('../fonts/BYEKAN.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

html {
    height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
    background-color: #f8fafc;
    color: #1e293b;
    font-family: 'B Yekan', Tahoma, Arial, sans-serif !important;
}

.app-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
    flex: 1;
}

/* =========================================
   2. تنظیمات سایدبار حرفه‌ای و پنل داشبورد (تم روشن/سفید)
   ========================================= */
#sidebar {
    width: 260px;
    min-width: 260px;
    height: 100vh;
    background: #ffffff;
    position: fixed;
    top: 0;
    right: 0;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.05);
    z-index: 1040;
    overflow-y: auto;
    transition: right 0.3s ease-in-out;
    border-left: 1px solid #e9ecef;
}

#sidebar.collapsed {
    right: -260px;
}

/* محتوای اصلی - اصلاح محاسبه عرض و پدینگ */
.main-content {
    flex-grow: 1;
    margin-right: 260px;
    padding: 2rem;
    width: calc(100% - 260px);
    min-height: 100vh;
    background-color: #f4f6f9;
    transition: margin-right 0.3s ease-in-out, width 0.3s ease-in-out;
}

.main-content.expanded {
    margin-right: 0;
    width: 100%;
}

/* پروفایل کاربر در سایدبار */
.sidebar-profile {
    padding: 2rem 1rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    background: #ffffff;
}

.sidebar-profile img {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f8fafc;
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.sidebar-profile h6 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.2rem;
}

.sidebar-profile span {
    font-size: 0.8rem;
    color: #64748b;
}

/* لینک‌های منو */
#sidebar .nav {
    padding: 1rem 0.75rem;
}

#sidebar .nav-link {
    color: #475569;
    padding: 0.85rem 1.2rem;
    margin-bottom: 0.4rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}

#sidebar .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: #94a3b8;
}

#sidebar .nav-link:hover {
    background-color: #f8fafc;
    color: #0d6efd;
}

#sidebar .nav-link:hover i {
    color: #0d6efd !important;
}

#sidebar .nav-link.active {
    background: #0d6efd;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
}

#sidebar .nav-link.active i {
    color: #ffffff !important; 
}

/* استایل اختصاصی خروج */
.logout-link {
    border-radius: 8px;
    transition: all 0.2s;
}

.logout-link:hover {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

.logout-link:hover i {
    color: #ffffff !important;
}

/* =========================================
   3. بدنه اصلی سایت
   ========================================= */
main {
    flex: 1;
    background-color: #f4f6f9;
    color: #1e293b;
}

.hero-section {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: #ffffff;
    padding: 80px 20px;
    text-align: center;
}

.search-card { 
    background: white; 
    border-radius: 1rem; 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); 
}

.search-card input, .search-card select {
    color: #1e293b;
}

/* =========================================
   4. هدر سایت (دسکتاپ) و ناوبری
   ========================================= */
.site-header, .panel-header, .navbar-custom {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 12px 0;
}

.header-container, .panel-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand { 
    font-size: 1.5rem; 
    color: #0ea5e9 !important; 
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.main-nav a, .nav-link {
    text-decoration: none;
    color: #475569 !important;
    font-weight: 500;
    padding: 8px 12px !important;
    transition: color 0.2s;
}

.main-nav a:hover, .nav-link:hover, .nav-link.active {
    color: #0ea5e9 !important;
}

/* =========================================
   5. منوی کشویی همبرگری (موبایل و تبلت)
   ========================================= */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 80vw;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    padding: 24px;
    overflow-y: auto;
}

.mobile-sidebar.show {
    right: 0;
}

.navbar-backdrop, .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.navbar-backdrop.show, .sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 992px) {
    .mobile-sidebar { display: none !important; }
    .navbar-backdrop { display: none !important; }
}

/* =========================================
   6. دکمه‌ها و عناصر عمومی
   ========================================= */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background-color: #0d6efd;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0b5ed7;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #0d6efd;
    color: #0d6efd;
}

.btn-outline:hover {
    background-color: #0d6efd;
    color: #fff;
}

.btn-block {
    display: block;
    width: 100%;
}

/* =========================================
   7. بخش‌های محتوایی، کارت‌ها و فرم‌ها
   ========================================= */
.hero-content h1 {
    font-size: 2.3rem;
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-search-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.search-input-group {
    flex: 1;
}

.search-input-group input {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

.features-section, .specialists-section, .about-section, .faq-section {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 10px;
}

.section-title p {
    color: #6c757d;
}

.features-grid, .specialists-grid, .faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature-card, .doctor-card, .faq-item {
    background: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid #eaeaea;
}

.feature-card h3, .faq-item h3 {
    font-size: 1.15rem;
    color: #0d6efd;
    margin-bottom: 10px;
}

.doctor-info h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 5px;
}

.doctor-info .specialty {
    display: block;
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

/* فرم‌های ورود و ثبت‌نام پنل */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 150px);
    padding: 40px 20px;
}

.auth-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 450px;
    border: 1px solid #eaeaea;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #0d6efd;
}

.auth-switch-link, .auth-footer-text {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #6c757d;
}

.auth-switch-link a, .auth-footer-text a {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 500;
}

.auth-switch-link a:hover, .auth-footer-text a:hover {
    text-decoration: underline;
}

.auth-icon-box {
    width: 65px;
    height: 65px;
}

.auth-card-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
}

.auth-card-footer.align-left {
    justify-content: flex-end;
}

.auth-card-footer.align-right {
    justify-content: flex-start;
}

.letter-spacing-2 {
    letter-spacing: 0.25rem;
}

.btn-link:disabled {
    color: #94a3b8 !important;
    cursor: not-allowed;
}

/* =========================================
   8. کارت‌های آماری، اخبار و ابزارک‌های داشبورد
   ========================================= */
.stat-card {
    transition: all 0.3s ease;
    border-radius: 0.85rem;
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08) !important;
}
.stat-card .icon-bg {
    position: absolute;
    left: -10px;
    bottom: -15px;
    font-size: 4.5rem;
    opacity: 0.12;
    transform: rotate(-10deg);
}
.bg-gradient-blue { background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%); }
.bg-gradient-green { background: linear-gradient(135deg, #198754 0%, #146c43 100%); }
.bg-gradient-amber { background: linear-gradient(135deg, #ffc107 0%, #d39e00 100%); }
.bg-gradient-purple { background: linear-gradient(135deg, #6f42c1 0%, #593196 100%); }

.title-divider {
    height: 3px;
    width: 60px;
    background: linear-gradient(90deg, #0d6efd, #0dcaf0);
    border-radius: 3px;
    margin-top: 6px;
    margin-bottom: 20px;
}
.news-box {
    transition: all 0.2s ease;
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-right-width: 4px !important;
    border-radius: 0.65rem;
}
.news-box:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    background-color: #fafafa;
}
.quick-action-btn {
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    text-decoration: none;
}
.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.05);
    border-color: #0d6efd;
}

/* =========================================
   9. استایل‌های صفحات خاص (پزشک، همکاران، مدال)
   ========================================= */
#documentViewerModal .modal-body img {
    max-height: 80vh;
    object-fit: contain;
}

.doctor-profile-img {
    width: 130px;
    height: 130px;
}

.review-lock-box {
    width: 45px;
    height: 45px;
}

.review-avatar-box {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
}

.review-date-text {
    font-size: 0.78rem;
}

.star-rating-pointer {
    cursor: pointer;
}

.cooperation-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cooperation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08) !important;
}

.cooperation-avatar {
    width: 100px;
    height: 100px;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
   10. فوتر سایت و پنل
   ========================================= */
footer, .site-footer, .panel-footer { 
    background-color: #1e293b; 
    border-top: 1px solid #e9ecef;
    color: #94a3b8; 
    padding: 40px 20px; 
    flex-shrink: 0;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-col h3 {
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 12px;
}

.footer-bottom {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

/* ========================================================== */
/* --- تنظیمات جامع حالت تاریک (Dark Mode Comprehensive) --- */
/* ========================================================== */

[data-bs-theme="dark"] body {
    background-color: #121212 !important;
    color: #e0e0e0 !important;
}

[data-bs-theme="dark"] .app-wrapper {
    background-color: #121212;
}

[data-bs-theme="dark"] #sidebar {
    background: #1e1e1e !important;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.4);
    border-left: 1px solid #2c2c2c;
}

[data-bs-theme="dark"] .sidebar-profile {
    background: linear-gradient(to bottom, #1e1e1e, #181818);
    border-bottom: 1px solid #2c2c2c;
}

[data-bs-theme="dark"] .sidebar-profile h6 {
    color: #ffffff;
}

[data-bs-theme="dark"] .sidebar-profile span {
    color: #a0aec0;
}

[data-bs-theme="dark"] #sidebar .nav-link {
    color: #cbd5e1;
}

[data-bs-theme="dark"] #sidebar .nav-link:hover {
    background-color: #27272a;
    color: #38bdf8;
}

[data-bs-theme="dark"] #sidebar .nav-link.active {
    background: #0284c7;
    color: #ffffff;
}

[data-bs-theme="dark"] .logout-link:hover {
    background-color: #450a0a !important;
    color: #f87171 !important;
}

[data-bs-theme="dark"] .main-content {
    background-color: #121212 !important;
}

[data-bs-theme="dark"] .site-header, 
[data-bs-theme="dark"] .panel-header,
[data-bs-theme="dark"] .navbar-custom {
    background: #1e1e1e !important;
    border-bottom: 1px solid #2c2c2c !important;
}

[data-bs-theme="dark"] .card {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border-color: #2c2c2c !important;
}

[data-bs-theme="dark"] .quick-action-btn {
    background-color: #1e1e1e !important;
    border: 1px solid #2c2c2c !important;
}

[data-bs-theme="dark"] .quick-action-btn span,
[data-bs-theme="dark"] .quick-action-btn i {
    color: #e0e0e0 !important;
}

[data-bs-theme="dark"] .quick-action-btn:hover {
    border-color: #38bdf8 !important;
    background-color: #27272a !important;
}

[data-bs-theme="dark"] .news-box {
    background-color: #1e1e1e !important;
    border-color: #2c2c2c !important;
}

[data-bs-theme="dark"] .news-box:hover {
    background-color: #252529 !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .text-secondary,
[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

/* =========================================
   11. ریسپانسیو و تنظیمات موبایل
   ========================================= */
@media (max-width: 767.98px) {
    #sidebar {
        right: -260px;
    }
    #sidebar.show {
        right: 0;
    }
    .main-content {
        margin-right: 0 !important;
        width: 100% !important;
        padding: 1rem;
    }
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1035;
        display: none;
    }
    .sidebar-backdrop.show {
        display: block;
    }
    .main-nav {
        display: none;
    }
    .hero-search-form {
        flex-direction: column;
    }
}