﻿
:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --accent: #06d6a0;
    --accent-red: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --sidebar-width: 70px;
    --sidebar-expanded: 200px;
    --header-height: 60px;
    --pricebar-height:40px;
    --margin-top :100px;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    min-height: 100vh;
    margin: 0;
}

/* === اسکرول بار آبی و مینیمال === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--primary-dark);
    }

/* برای فایرفاکس */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #f1f5f9;
}

/* === سایدبار راست با Bootstrap - رفع مشکل تراز خط === */
.compact-sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -2px 0 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, width 0.3s ease;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 1040;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

    .compact-sidebar:hover {
        width: var(--sidebar-expanded);
        overflow: visible;
    }

@media (max-width: 768px) {
    .compact-sidebar {
        transform: translateX(100%);
        width: 100%;
        max-width: 280px;
        transition: transform 0.3s ease;
        z-index: 1045;
    }

        .compact-sidebar.mobile-open {
            transform: translateX(0);
            box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        }
}

.sidebar-header {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    height: var(--header-height);
    box-sizing: border-box;
}

.sidebar-logo {
    font-size: 1.25rem;
    color: var(--primary);
}

.sidebar-brand {
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
}

.compact-sidebar:hover .sidebar-brand {
    opacity: 1;
}

@media (max-width: 768px) {
    .compact-sidebar.mobile-open .sidebar-brand,
    .compact-sidebar.mobile-open .nav-text,
    .compact-sidebar.mobile-open .section-label {
        opacity: 1 !important;
    }
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: hidden;
    overflow-x: hidden;
    max-height: calc(100vh - var(--header-height));
}

.compact-sidebar:hover .sidebar-nav {
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section {
    margin-bottom: 1rem;
}

.section-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.compact-sidebar:hover .section-label {
    opacity: 1;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 0.125rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    border-right: 3px solid transparent;
    white-space: nowrap;
    font-size: 0.85rem;
}

    .nav-link:hover,
    .nav-link.active {
        background: var(--primary);
        color: white;
        border-right-color: var(--primary);
    }

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-text {
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: 500;
}

.compact-sidebar:hover .nav-text {
    opacity: 1;
}

/* === هدر با Bootstrap - رفع مشکل موبایل === */
.main-header {
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    right: var(--sidebar-width);
    left: 0;
    height: var(--header-height);
    z-index: 1035;
    border-bottom: 1px solid var(--border);
    transition: right 0.3s ease;
}

.compact-sidebar:hover ~ .main-header {
    right: var(--sidebar-expanded);
}

@media (max-width: 768px) {
    .main-header {
        right: 0;
        padding: 0 0.5rem;
    }
}

.search-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

    .search-box:hover {
        background: white;
        border-color: var(--primary);
    }

/* === منوی کاربر با Bootstrap === */
.user-menu-wrapper {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    padding: 0.4rem;
    z-index: 1060;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

    .user-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(4px);
    }

@media (max-width: 768px) {
    .user-dropdown {
        position: fixed;
        top: auto !important;
        bottom: 1rem;
        left: 1rem !important;
        right: 1rem;
        width: auto;
        max-width: none;
        z-index: 1060;
        transform: translateY(16px);
    }

        .user-dropdown.show {
            transform: translateY(0);
        }
}

.dropdown-header {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.4rem;
}

.dropdown-menu-custom {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-item-custom {
    margin-bottom: 0.125rem;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.8rem;
}

    .dropdown-link:hover {
        background: #f1f5f9;
        color: var(--primary);
    }

    .dropdown-link.logout {
        color: var(--danger);
    }

        .dropdown-link.logout:hover {
            background: #fef2f2;
            color: var(--danger);
        }

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.4rem 0;
}

/* === مودال جستجو با Bootstrap === */
.search-modal .modal-dialog {
    max-width: 600px;
}

.search-modal .modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 16px 32px rgba(0,0,0,0.15);
}

.search-modal .modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .search-modal .modal-header .form-control {
        flex: 1;
        border: 1px solid var(--primary);
        border-radius: 6px;
        padding: 0.5rem 0.75rem;
    }

.search-modal .modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.search-categories {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.search-category {
    background: #f1f5f9;
    border: 1px solid var(--border);
    padding: 0.4rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

    .search-category.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

.search-history {
    display: grid;
    gap: 0.4rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem;
    border-radius: 6px;
    transition: background 0.2s;
    cursor: pointer;
    font-size: 0.8rem;
}

    .history-item:hover {
        background: #f8fafc;
    }

.history-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-text {
    font-weight: 500;
}

.history-category {
    font-size: 0.65rem;
    color: var(--text-secondary);
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.delete-history {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0;
    font-size: 0.8rem;
}

.history-item:hover .delete-history {
    opacity: 1;
}

.delete-history:hover {
    color: var(--danger);
    background: #fef2f2;
}

.quick-searches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.quick-search-item {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
    font-size: 0.8rem;
}

    .quick-search-item:hover {
        background: var(--primary);
        color: white;
        transform: translateY(-1px);
    }

/* === محتوای اصلی === */
.main-content {
    margin-right: var(--sidebar-width);
    margin-top: var(--margin-top);
    padding: 1.5rem;
    flex: 1;
    transition: margin-right 0.3s ease;
    overflow-y: auto;
    max-height: calc(100vh - var(--margin-top));
}

.compact-sidebar:hover ~ .main-content {
    margin-right: var(--sidebar-expanded);
}

@media (max-width: 768px) {
    .main-content {
        margin-right: 0;
        padding: 1rem;
    }
}

/* === overlay برای موبایل === */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1039;
    cursor: pointer;
}

    .sidebar-overlay.active {
        display: block;
    }

/* === دکمه‌های سفارشی === */
.btn-custom-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s;
    font-size: 0.8rem;
}

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

.btn-custom-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.8rem;
}

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

/* === کارت‌های سفارشی === */
.custom-card {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
}

/* === رسپانسیو با Bootstrap - رفع مشکل موبایل === */
@media (max-width: 768px) {
    .d-mobile-none {
        display: none !important;
    }

    .search-container {
        display: none;
    }

    /* رفع مشکل موقعیت آیکون‌ها در موبایل */
    .main-header .container-fluid {
        padding: 0 0.5rem;
    }

    .main-header .row {
        flex-wrap: nowrap;
        margin: 0 -0.25rem;
    }

    .main-header .col-md-6 {
        display: flex;
        align-items: center;
        padding: 0 0.25rem;
        flex: 1;
        min-width: 0;
    }

        .main-header .col-md-6:first-child {
            justify-content: flex-start;
            flex: 1;
        }

        .main-header .col-md-6:last-child {
            justify-content: flex-end;
            flex: 0 0 auto;
        }

    .user-menu-wrapper {
        display: flex;
        align-items: center;
    }

        .user-menu-wrapper #userMenuTrigger {
            padding: 0.25rem;
            margin-right: 0;
        }

    .user-avatar {
        margin-left: 0.25rem !important;
    }

    .user-info {
        display: none !important;
    }

    .btn-custom-primary, .btn-custom-outline {
        display: none !important;
    }

    /* بهبود موقعیت آیکون جستجو در موبایل */
    .search-container-mobile {
        margin-left: 0.5rem;
    }

    /* تنظیمات برای هدر موبایل */
    .page-info {
        margin-right: 0.5rem;
        min-width: 0;
        flex: 1;
    }

        .page-info h1 {
            font-size: 1rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

    #menuToggle {
        margin-left: 0.25rem;
        z-index: 1050;
    }
}

@media (min-width: 769px) {
    .d-desktop-block {
        display: block !important;
    }
}


/* === اسکرول بار آبی و مینیمال === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--primary-dark);
    }

/* برای فایرفاکس */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #f1f5f9;
}

/* === سایدبار راست با Bootstrap - رفع مشکل تراز خط === */
.compact-sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -2px 0 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, width 0.3s ease;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 1040;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

    .compact-sidebar:hover {
        width: var(--sidebar-expanded);
        overflow: visible;
    }

@media (max-width: 768px) {
    .compact-sidebar {
        transform: translateX(100%);
        width: 100%;
        max-width: 250px;
        transition: transform 0.3s ease;
        z-index: 1045;
    }

        .compact-sidebar.mobile-open {
            transform: translateX(0);
        }
}

.sidebar-header {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    height: var(--header-height);
    box-sizing: border-box;
}

.sidebar-logo {
    font-size: 1.25rem;
    color: var(--primary);
}

.sidebar-brand {
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
}

.compact-sidebar:hover .sidebar-brand {
    opacity: 1;
}

@media (max-width: 768px) {
    .compact-sidebar.mobile-open .sidebar-brand,
    .compact-sidebar.mobile-open .nav-text,
    .compact-sidebar.mobile-open .section-label {
        opacity: 1 !important;
    }
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: hidden;
    overflow-x: hidden;
    max-height: calc(100vh - var(--header-height));
}

.compact-sidebar:hover .sidebar-nav {
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section {
    margin-bottom: 1rem;
}

.section-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.compact-sidebar:hover .section-label {
    opacity: 1;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 0.125rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    border-right: 3px solid transparent;
    white-space: nowrap;
    font-size: 0.85rem;
}

    .nav-link:hover,
    .nav-link.active {
        background: var(--primary);
        color: white;
        border-right-color: var(--primary);
    }

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-text {
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: 500;
}

.compact-sidebar:hover .nav-text {
    opacity: 1;
}

/* === هدر با Bootstrap - رفع مشکل موبایل === */
.main-header {
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    right: var(--sidebar-width);
    left: 0;
    height: var(--header-height);
    z-index: 1035;
    border-bottom: 1px solid var(--border);
    transition: right 0.3s ease;
}

.compact-sidebar:hover ~ .main-header {
    right: var(--sidebar-expanded);
}

@media (max-width: 768px) {
    .main-header {
        right: 0;
        padding: 0 0.5rem;
    }
}

.search-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

    .search-box:hover {
        background: white;
        border-color: var(--primary);
    }

/* === منوی کاربر با Bootstrap === */
.user-menu-wrapper {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    padding: 0.4rem;
    z-index: 1060;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

    .user-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(4px);
    }

@media (max-width: 768px) {
    .user-dropdown {
        position: fixed;
        top: auto !important;
        bottom: 1rem;
        left: 1rem !important;
        right: 1rem;
        width: auto;
        max-width: none;
        z-index: 1060;
        transform: translateY(16px);
    }

        .user-dropdown.show {
            transform: translateY(0);
        }
}

.dropdown-header {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.4rem;
}

.dropdown-menu-custom {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-item-custom {
    margin-bottom: 0.125rem;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.8rem;
}

    .dropdown-link:hover {
        background: #f1f5f9;
        color: var(--primary);
    }

    .dropdown-link.logout {
        color: var(--danger);
    }

        .dropdown-link.logout:hover {
            background: #fef2f2;
            color: var(--danger);
        }

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.4rem 0;
}

/* === مودال جستجو با Bootstrap === */
.search-modal .modal-dialog {
    max-width: 600px;
}

.search-modal .modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 16px 32px rgba(0,0,0,0.15);
}

.search-modal .modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .search-modal .modal-header .form-control {
        flex: 1;
        border: 1px solid var(--primary);
        border-radius: 6px;
        padding: 0.5rem 0.75rem;
    }

.search-modal .modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.search-categories {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.search-category {
    background: #f1f5f9;
    border: 1px solid var(--border);
    padding: 0.4rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

    .search-category.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

.search-history {
    display: grid;
    gap: 0.4rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem;
    border-radius: 6px;
    transition: background 0.2s;
    cursor: pointer;
    font-size: 0.8rem;
}

    .history-item:hover {
        background: #f8fafc;
    }

.history-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-text {
    font-weight: 500;
}

.history-category {
    font-size: 0.65rem;
    color: var(--text-secondary);
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.delete-history {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0;
    font-size: 0.8rem;
}

.history-item:hover .delete-history {
    opacity: 1;
}

.delete-history:hover {
    color: var(--danger);
    background: #fef2f2;
}

.quick-searches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.quick-search-item {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
    font-size: 0.8rem;
}

    .quick-search-item:hover {
        background: var(--primary);
        color: white;
        transform: translateY(-1px);
    }

/* === محتوای اصلی === */
.main-content {
    margin-right: var(--sidebar-width);
    margin-top: var(--margin-top);
    padding: 1.5rem;
    flex: 1;
    transition: margin-right 0.3s ease;
    overflow-y: auto;
    max-height: calc(100vh - var(--margin-top));
}

.compact-sidebar:hover ~ .main-content {
    margin-right: var(--sidebar-expanded);
}

@media (max-width: 768px) {
    .main-content {
        margin-right: 0;
        padding: 1rem;
    }
}

/* === overlay برای موبایل === */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1039;
    cursor: pointer;
}

    .sidebar-overlay.active {
        display: block;
    }

/* === دکمه‌های سفارشی === */
.btn-custom-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s;
    font-size: 0.8rem;
}

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

.btn-custom-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.8rem;
}

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

/* === کارت‌های سفارشی - به‌روزرسانی برای محتوای جدید === */
.custom-card {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

    .custom-card:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        transform: translateY(-2px);
    }

/* استایل برای کارت‌های آماری */
.stat-card {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    padding: 1rem;
    transition: all 0.3s ease;
    height: 100%;
}

    .stat-card:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .stat-card .card-icon {
        font-size: 1.5rem;
        color: var(--primary);
    }

    .stat-card .card-value {
        font-size: 1.5rem;
        font-weight: bold;
        margin: 0.5rem 0;
    }

    .stat-card .card-label {
        font-size: 0.85rem;
        color: var(--text-secondary);
    }

/* استایل‌های برای نمودارها */
.chart-container {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

/* === رسپانسیو با Bootstrap - رفع مشکل موبایل === */
@media (max-width: 768px) {
    .d-mobile-none {
        display: none !important;
    }

    .search-container {
        display: none;
    }

    /* رفع مشکل موقعیت آیکون‌ها در موبایل */
    .main-header .container-fluid {
        padding: 0 0.5rem;
    }

    .main-header .row {
        flex-wrap: nowrap;
        margin: 0 -0.25rem;
    }

    .main-header .col-md-6 {
        display: flex;
        align-items: center;
        padding: 0 0.25rem;
        flex: 1;
        min-width: 0;
    }

        .main-header .col-md-6:first-child {
            justify-content: flex-start;
            flex: 1;
        }

        .main-header .col-md-6:last-child {
            justify-content: flex-end;
            flex: 0 0 auto;
        }

    .user-menu-wrapper {
        display: flex;
        align-items: center;
    }

        .user-menu-wrapper #userMenuTrigger {
            padding: 0.25rem;
            margin-right: 0;
        }

    .user-avatar {
        margin-left: 0.25rem !important;
    }

    .user-info {
        display: none !important;
    }

    .btn-custom-primary, .btn-custom-outline {
        display: none !important;
    }

    /* بهبود موقعیت آیکون جستجو در موبایل */
    .search-container-mobile {
        margin-left: 0.5rem;
    }

    /* تنظیمات برای هدر موبایل */
    .page-info {
        margin-right: 0.5rem;
        min-width: 0;
        flex: 1;
    }

        .page-info h1 {
            font-size: 1rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

    #menuToggle {
        margin-left: 0.25rem;
        z-index: 1050;
    }

    /* تنظیمات برای محتوای اصلی در موبایل */
    .page-content .row-cols-md-3 > .col {
        margin-bottom: 1rem;
    }

    .chart-container {
        padding: 0.75rem;
    }
}

@media (min-width: 769px) {
    .d-desktop-block {
        display: block !important;
    }
}


/* === استایل‌های اصلی برای محتوای داشبورد === */
.page-content {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* === کارت‌های آماری === */
.stat-card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
    padding: 1.25rem;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

    .stat-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }

    .stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 4px;
        background: linear-gradient(90deg, var(--primary), var(--accent));
        border-radius: 12px 12px 0 0;
    }

    .stat-card .card-icon {
        font-size: 1.75rem;
        color: var(--primary);
        background: rgba(37, 99, 235, 0.1);
        width: 50px;
        height: 50px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }

    .stat-card:hover .card-icon {
        transform: scale(1.1);
        background: var(--primary);
        color: white;
    }

    .stat-card .card-label {
        font-size: 0.875rem;
        color: var(--text-secondary);
        margin-bottom: 0.5rem;
        font-weight: 500;
    }

    .stat-card .card-value {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 0;
        line-height: 1.2;
    }

    .stat-card a {
        text-decoration: none;
        color: inherit;
        display: block;
        width: 100%;
    }

        .stat-card a:hover {
            color: var(--primary);
        }

/* === نمودارها === */
.chart-container {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

    .chart-container:hover {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }

.chart-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* === استایل‌های سفارشی برای ApexCharts === */
.apexcharts-tooltip {
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
}

.apexcharts-tooltip-title {
    background: var(--primary) !important;
    color: white !important;
    border-bottom: 1px solid var(--border) !important;
    font-weight: 600 !important;
}

.apexcharts-legend-text {
    color: var(--text-primary) !important;
    font-family: 'Vazirmatn', sans-serif !important;
}

.apexcharts-xaxis-label, .apexcharts-yaxis-label {
    fill: var(--text-secondary) !important;
    font-family: 'Vazirmatn', sans-serif !important;
}

/* === استایل‌های برای مقادیر مثبت و منفی === */
.positive-value {
    color: var(--success);
    font-weight: 600;
}

.negative-value {
    color: var(--danger);
    font-weight: 600;
}

/* === رسپانسیو === */
@media (max-width: 768px) {
    .page-content {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

        .stat-card .card-value {
            font-size: 1.25rem;
        }

    .chart-container {
        padding: 1rem;
    }

    .chart-title {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .page-content {
        padding: 0.75rem;
    }

    .stat-card .card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

/* === انیمیشن‌های ظریف === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card, .chart-container {
    animation: fadeInUp 0.5s ease forwards;
}

    .stat-card:nth-child(1) {
        animation-delay: 0.1s;
    }

    .stat-card:nth-child(2) {
        animation-delay: 0.2s;
    }

    .stat-card:nth-child(3) {
        animation-delay: 0.3s;
    }

    .stat-card:nth-child(4) {
        animation-delay: 0.4s;
    }

    .stat-card:nth-child(5) {
        animation-delay: 0.5s;
    }

    .stat-card:nth-child(6) {
        animation-delay: 0.6s;
    }

    .chart-container:nth-child(1) {
        animation-delay: 0.7s;
    }

    .chart-container:nth-child(2) {
        animation-delay: 0.8s;
    }

    .chart-container:nth-child(3) {
        animation-delay: 0.9s;
    }

    .chart-container:nth-child(4) {
        animation-delay: 1.0s;
    }

    .chart-container:nth-child(5) {
        animation-delay: 1.1s;
    }


/* === استایل‌های اصلی برای محتوای داشبورد === */
.page-content {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* === کارت‌های آماری === */
.stat-card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
    padding: 1.25rem;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

    .stat-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }

    .stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 4px;
        background: linear-gradient(90deg, var(--primary), var(--accent));
        border-radius: 12px 12px 0 0;
    }

    .stat-card .card-icon {
        font-size: 1.75rem;
        color: var(--primary);
        background: rgba(37, 99, 235, 0.1);
        width: 50px;
        height: 50px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }

    .stat-card:hover .card-icon {
        transform: scale(1.1);
        background: var(--primary);
        color: white;
    }

    .stat-card .card-label {
        font-size: 0.875rem;
        color: var(--text-secondary);
        margin-bottom: 0.5rem;
        font-weight: 500;
    }

    .stat-card .card-value {
        font-size: 1.4rem;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 0.25rem;
        line-height: 1.2;
    }

    .stat-card .card-change {
        font-size: 0.8rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    .stat-card .positive-change {
        color: var(--success);
    }

    .stat-card .negative-change {
        color: var(--danger);
    }

    .stat-card .neutral-change {
        color: var(--text-secondary);
    }

    .stat-card a {
        text-decoration: none;
        color: inherit;
        display: block;
        width: 100%;
    }

        .stat-card a:hover {
            color: var(--primary);
        }

/* === نمودارها === */
.chart-container {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

    .chart-container:hover {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }

.chart-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* === استایل‌های سفارشی برای ApexCharts === */
.apexcharts-tooltip {
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
}

.apexcharts-tooltip-title {
    background: var(--primary) !important;
    color: white !important;
    border-bottom: 1px solid var(--border) !important;
    font-weight: 600 !important;
}

.apexcharts-legend-text {
    color: var(--text-primary) !important;
    font-family: 'Vazirmatn', sans-serif !important;
}

.apexcharts-xaxis-label, .apexcharts-yaxis-label {
    fill: var(--text-secondary) !important;
    font-family: 'Vazirmatn', sans-serif !important;
}

/* === رسپانسیو === */
@media (max-width: 768px) {
    .page-content {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

        .stat-card .card-value {
            font-size: 1.25rem;
        }

    .chart-container {
        padding: 1rem;
    }

    .chart-title {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .page-content {
        padding: 0.75rem;
    }

    .stat-card .card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

/* === انیمیشن‌های ظریف === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card, .chart-container {
    animation: fadeInUp 0.5s ease forwards;
}

    .stat-card:nth-child(1) {
        animation-delay: 0.1s;
    }

    .stat-card:nth-child(2) {
        animation-delay: 0.2s;
    }

    .stat-card:nth-child(3) {
        animation-delay: 0.3s;
    }

    .stat-card:nth-child(4) {
        animation-delay: 0.4s;
    }

    .stat-card:nth-child(5) {
        animation-delay: 0.5s;
    }

    .stat-card:nth-child(6) {
        animation-delay: 0.6s;
    }

    .chart-container:nth-child(1) {
        animation-delay: 0.7s;
    }

    .chart-container:nth-child(2) {
        animation-delay: 0.8s;
    }

    .chart-container:nth-child(3) {
        animation-delay: 0.9s;
    }

    .chart-container:nth-child(4) {
        animation-delay: 1.0s;
    }

    .chart-container:nth-child(5) {
        animation-delay: 1.1s;
    }

/* استایل برای لینک‌های جستجوی سریع */
.quick-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-search-item {
    display: inline-block;
    padding: 6px 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .quick-search-item:hover {
        background-color: #e9ecef;
        border-color: #0056b3;
        color: #0056b3;
        text-decoration: none;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    /* برای حالت فعال یا focus */
    .quick-search-item:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    }
/* نوار قیمت */
.price-ticker-bar {
    background-color: #1e1f60;
    color: #ffffff;
    height: 40px;
    overflow: hidden;
    position: relative;
    width: 100%;
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    z-index: 100;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

.ticker-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.ticker-track {
    display: inline-flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    padding: 0 20px;
    animation: tickerMove 30s linear infinite;
}

.ticker-item {
    display: flex;
    align-items: center;
    padding: 0 25px;
    height: 100%;
    border-left: 1px solid #333;
    min-width: max-content;
}

    .ticker-item:last-child {
        border-left: none;
    }

    .ticker-item .symbol {
        font-weight: 700;
        margin-left: 8px;
        color: #f8f9fa;
        font-size: 14px;
    }

    .ticker-item .price {
        margin-left: 8px;
        font-family: 'Courier New', monospace;
        font-size: 14px;
        color: #ffffff;
    }

    .ticker-item .change {
        padding: 3px 8px;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 600;
        margin-left: 8px;
        min-width: 70px;
        text-align: center;
    }

        .ticker-item .change.positive {
            background-color: #10b981;
            color: white;
        }

        .ticker-item .change.negative {
            background-color: #ef4444;
            color: white;
        }
@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}


/*@keyframes tickerMove {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(50%);
    }
}*/

/* توقف حرکت هنگام هاور */
.price-ticker-bar:hover .ticker-track {
    animation-play-state: paused;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .price-ticker-bar {
        height: 35px;
    }

    .ticker-item {
        padding: 0 15px;
    }

        .ticker-item .symbol {
            font-size: 12px;
        }

        .ticker-item .price {
            font-size: 12px;
        }

        .ticker-item .change {
            font-size: 11px;
            min-width: 60px;
            padding: 2px 6px;
        }
}