/*
 * VestHub Custom Stylesheet (Final Fix for Light Mode Headers)
 */

/* =================================== */
/* == 1. Imports & Root Variables == */
/* =================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  --bs-primary: #00b0f0; 
  --bs-primary-rgb: 0, 176, 240;
  --vh-dark-blue: #0d253f;
}

html {
  font-size: 15px; /* Scale down base typography for a more professional look */
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  max-width: 100%;
}

/* تنظیمات پایه برای حالت روشن */
[data-bs-theme="light"] body {
    background-color: #f4f6f9;
    color: #333;
    background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
    background-size: 24px 24px;
}

/* تنظیمات فونت فارسی */
html[lang="fa"] body {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
}

/* =================================== */
/* ==   2. General Site Styles      == */
/* =================================== */

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

.navbar-logo {
    height: 60px !important;
    width: auto;
    margin-top: 5px;
}

/* Transparent Header Overlay */
.navbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
    background-color: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
}
.navbar .nav-link, .navbar .navbar-brand {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Hero Section */
.hero-section {
  background-image: 
    linear-gradient(rgba(13, 37, 63, 0.85), rgba(13, 37, 63, 0.85)), 
    url('../images/hero_background.png');
  background-size: cover;
  background-position: center;
  padding: 6rem 0;
  color: white;
}
.hero-section .display-3 { font-weight: 700; font-size: 3rem !important; }
.hero-section .btn-primary, .hero-section .btn-outline-light { padding: 0.75rem 1.5rem; }
.hero-section h1, .hero-section p.lead {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Trusted By Section */
.trusted-by-section {
    background-color: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    color: rgba(255, 255, 255, 0.5);
}
.exchange-logo {
    height: 30px;
    width: auto;
    opacity: 0.5;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}
.exchange-logo:hover {
    opacity: 1;
    filter: grayscale(0%);
}

/* Performance Section */
.performance-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d253f 100%);
    color: #ffffff !important;
    padding: 5rem 0;
}
.performance-section h1, .performance-section h2, .performance-section p, .performance-section .text-muted {
    color: #ffffff !important;
}
.performance-section .feature-icon { color: var(--bs-primary) !important; }

/* Features */
.trust-bar-icon, .feature-icon {
  font-size: 2.5rem;
  color: var(--bs-primary);
  margin-bottom: 1rem;
}
.feature-icon { font-size: 3rem; }

/* Footer */
.footer-links a:hover {
  text-decoration: underline !important;
  color: var(--bs-primary) !important;
}

/* =================================== */
/* ==   3. Bootstrap Overrides      == */
/* =================================== */

.btn-primary {
  --bs-btn-hover-bg: #0099d1;
  --bs-btn-hover-border-color: #0099d1;
}
.btn-outline-primary {
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-btn-hover-color: #fff;
}
.card-header {
    background-color: var(--bs-tertiary-bg);
    border-bottom-color: var(--bs-border-color);
}
code {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-danger);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
}

/* == Professional UI Refinements == */

/* 1. Refine Container Width (More Whitespace) */
@media (min-width: 1400px) {
    .container { max-width: 1140px !important; }
}

/* 2. Scale Down Typography */
h1, .h1 { font-size: 2.2rem !important; }
h2, .h2 { font-size: 1.8rem !important; }
h3, .h3 { font-size: 1.5rem !important; }
.display-4 { font-size: 2.2rem !important; }
p.lead { font-size: 1.1rem !important; line-height: 1.6; }

/* 3. Refine Components */
.card-body { padding: 1.25rem !important; }
.btn-lg { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; font-size: 1rem !important; }


/* =================================== */
/* ==  4. Page-Specific Styles      == */
/* =================================== */

/* Auth Pages */
.auth-body {
    background: linear-gradient(-45deg, #0d253f, #1a1a1a, #0d253f);
    background-size: 400% 400%;
    animation: authGradient 15s ease infinite;
    min-height: 100vh;
    color: white;
}
@keyframes authGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.auth-wrapper { min-height: 100vh; }
.auth-card-wrapper { width: 100%; max-width: 500px; }
.auth-card { backdrop-filter: blur(10px); }
[data-bs-theme="dark"] .auth-card {
    background-color: rgba(33, 37, 41, 0.9);
    border: 1px solid #444;
}
.divider-text { font-size: 0.85rem; font-weight: 500; }
.divider-text hr { border-color: #777; }

/* Dashboard Styles */
.dashboard-body { min-height: 100vh; overflow-x: hidden; }

.main-content-wrapper {
    width: 100%;
    overflow-x: hidden;
}

/* Wrapper for charts to prevent overflow */
.chart-responsive-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

canvas {
    max-width: 100% !important;
}

.sidebar {
    width: 280px;
    background-color: var(--bs-tertiary-bg);
    border-inline-end: 1px solid var(--bs-border-color);
    min-height: 100vh;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}
.sidebar .nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--bs-body-color);
    margin-bottom: 0.25rem;
}
.sidebar .nav-link:hover { background-color: var(--bs-secondary-bg); }
.sidebar .nav-link.active { background-color: var(--bs-primary); color: white !important; }
.sidebar .nav-link i { color: var(--bs-secondary-color); }
.sidebar .nav-link.active i { color: white !important; }
.sidebar-footer { border-top: 1px solid var(--bs-border-color); }

.top-bar {
    background-color: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

@media (max-width: 991.98px) { .sidebar { display: none !important; } }
@media (min-width: 992px) { .top-bar { display: none !important; } }

/* Mobile Offcanvas Menu Styles */
.offcanvas-body .nav-link {
    color: var(--bs-body-color);
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.offcanvas-body .nav-link:hover {
    background-color: var(--bs-secondary-bg);
}
.offcanvas-body .nav-link.active {
    background-color: var(--bs-primary);
    color: white !important;
}

[data-bs-theme="dark"] .admin-sidebar { background-color: #111 !important; }

/* Components */
.plan-card {
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-card-bg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.plan-card:hover { transform: translateY(-5px); box-shadow: 0 0.5rem 1rem rgba(0, 176, 240, 0.15) !important; }
.best-value-ribbon {
    position: absolute; top: 15px; right: -30px;
    background-color: var(--bs-primary); color: #fff;
    font-weight: bold; font-size: 0.8rem; padding: 5px 30px;
    transform: rotate(45deg); box-shadow: 0 0 10px rgba(0, 176, 240, 0.5);
}
html[dir="rtl"] .best-value-ribbon {
    right: auto; left: -30px;
    transform: rotate(-45deg);
}

.payment-info-box {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background-color: var(--bs-tertiary-bg);
}
.payment-info-box .form-control { border: none; background: transparent !important; color: var(--bs-body-color); }
.payment-info-box .form-control:focus { box-shadow: none; }
.payment-info-box .list-group-item { background-color: transparent; border-color: var(--bs-border-color); color: var(--bs-body-color); }

.settings-nav .nav-link { color: var(--bs-body-color); font-weight: 500; }
.settings-nav .nav-link.active { background-color: var(--bs-primary); color: white; }
.settings-nav .nav-link:hover { background-color: var(--bs-secondary-bg); }

/* Risk Assessment */
.step-circle {
    width: 30px; height: 30px; border-radius: 50%;
    background-color: var(--bs-secondary-bg); color: var(--bs-secondary-color);
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; flex-shrink: 0;
}
.step.active .step-circle { background-color: var(--bs-primary); color: white; }
.step.completed .step-circle { background-color: #28a745; color: white; }
.step-line { height: 2px; background-color: var(--bs-border-color); flex-grow: 1; }
.btn-group-vertical .btn-outline-secondary { border-color: var(--bs-border-color); color: var(--bs-body-color); }
.btn-check:checked + .btn-outline-secondary { background-color: var(--bs-primary); border-color: var(--bs-primary); color: white; }

.risk-question-group { display: none; }
.risk-question-group.active { display: block; }

/* Status Badges */
.status-verified { background-color: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); border: 1px solid var(--bs-success-border-subtle); }
.status-pending, .status-not-assessed { background-color: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); border: 1px solid var(--bs-warning-border-subtle); }
.status-not-submitted { background-color: var(--bs-secondary-bg-subtle); color: var(--bs-secondary-text-emphasis); border: 1px solid var(--bs-secondary-border-subtle); }
.status-balanced { background-color: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); border: 1px solid var(--bs-primary-border-subtle); }
.status-aggressive { background-color: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); border: 1px solid var(--bs-danger-border-subtle); }
.status-conservative { background-color: var(--bs-info-bg-subtle); color: var(--bs-info-text-emphasis); border: 1px solid var(--bs-info-border-subtle); }

.nav-tabs .nav-link { color: var(--bs-secondary-color); }
.nav-tabs .nav-link.active {
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color) var(--bs-border-color) var(--bs-body-bg);
}
.tab-content { border: 1px solid var(--bs-border-color); border-top: 0; }
.table-bordered { border-color: var(--bs-border-color); }

/* ========================================================= */
/* == 5. LIGHT MODE OVERRIDES (CRITICAL FIXES) == */
/* ========================================================= */

[data-bs-theme="light"] .card,
[data-bs-theme="light"] .sidebar,
[data-bs-theme="light"] .top-bar,
[data-bs-theme="light"] .admin-sidebar,
[data-bs-theme="light"] .auth-card {
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

/* FIX: محافظت از بخش‌های تیره در برابر تغییر رنگ متن */
[data-bs-theme="light"] .hero-section,
[data-bs-theme="light"] .hero-section *,
[data-bs-theme="light"] .performance-section,
[data-bs-theme="light"] .performance-section *,
[data-bs-theme="light"] .page-header-dark,
[data-bs-theme="light"] .page-header-dark * {
    color: #ffffff !important;
}

/* Tables Fix */
[data-bs-theme="light"] .table-dark {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-color: #dee2e6 !important;
    --bs-table-bg: #ffffff;
    --bs-table-color: #212529;
}
[data-bs-theme="light"] .table-dark th,
[data-bs-theme="light"] .table-dark td {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-color: #dee2e6 !important;
}
[data-bs-theme="light"] .table thead th,
[data-bs-theme="light"] .table-dark thead th {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border-bottom: 2px solid #dee2e6 !important;
}

/* اصلاح رنگ متن در جاهای سفید (به جز هدرهای تیره) */
[data-bs-theme="light"] .text-white:not(.hero-section):not(.hero-section *):not(.performance-section):not(.performance-section *):not(.page-header-dark):not(.page-header-dark *),
[data-bs-theme="light"] .text-white-50:not(.hero-section):not(.hero-section *):not(.performance-section):not(.performance-section *):not(.page-header-dark):not(.page-header-dark *),
[data-bs-theme="light"] .text-light:not(.hero-section):not(.hero-section *):not(.performance-section):not(.performance-section *):not(.page-header-dark):not(.page-header-dark *),
[data-bs-theme="light"] .text-body-secondary:not(.hero-section):not(.hero-section *):not(.performance-section):not(.performance-section *):not(.page-header-dark):not(.page-header-dark *) {
    color: #495057 !important;
}

[data-bs-theme="light"] .bg-dark,
[data-bs-theme="light"] .bg-dark-subtle {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6;
}

[data-bs-theme="light"] .sidebar .nav-link i,
[data-bs-theme="light"] .bi-envelope-paper-fill {
    color: #6c757d !important;
}
[data-bs-theme="light"] .sidebar .nav-link.active i {
    color: #ffffff !important;
}

[data-bs-theme="light"] footer {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-top: 1px solid #dee2e6 !important;
}
[data-bs-theme="light"] footer a,
[data-bs-theme="light"] footer small {
    color: #6c757d !important;
}
[data-bs-theme="light"] footer a:hover {
    color: var(--bs-primary) !important;
}

/* Fix for btn-outline-light visibility inside light sections in light mode */
[data-bs-theme="light"] .bg-dark-subtle .btn-outline-light {
    color: var(--bs-body-color) !important;
    border-color: var(--bs-body-color) !important;
}
[data-bs-theme="light"] .bg-dark-subtle .btn-outline-light:hover {
    background-color: var(--bs-body-color) !important;
    color: #ffffff !important;
}

/* =================================== */
/* ==   6. Mobile Fixes             == */
/* =================================== */

@media (max-width: 991.98px) {
    /* Fix for dropdown menus (like language selector) overflowing screen */
    .dropdown-menu {
        min-width: auto !important;
        width: max-content !important;
        transform: none !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
    }
    html[dir="rtl"] .dropdown-menu {
        left: 0 !important;
        right: auto !important;
    }

    /* Fix for transparent navbar on mobile: Add background to the collapsed menu */
    .navbar-collapse {
        background-color: rgba(13, 37, 63, 0.95);
        backdrop-filter: blur(10px);
        padding: 1rem;
        border-radius: 0.5rem;
        margin-top: 0.5rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    }
}

/* =================================== */
/* ==   7. Comparison Table         == */
/* =================================== */

.comparison-table .highlight-th {
    position: relative;
    overflow: visible !important;
    border: 2px solid #00d084 !important;
    border-bottom: none !important;
    background-color: #212529 !important;
}

.comparison-table .best-choice-badge {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    white-space: nowrap;
}

.comparison-table .highlight-td {
    border-left: 2px solid #00d084 !important;
    border-right: 2px solid #00d084 !important;
    background-color: #212529 !important;
}

.comparison-table .highlight-td-bottom {
    border-bottom: 2px solid #00d084 !important;
}

/* =========================================
   Marketplace Styles (Table & Chart) - FIXED
   ========================================= */

/* Chart Animation */
@keyframes drawChart {
    from { stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
}
.chart-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawChart 2.5s ease-out forwards;
}

/* FIX: Override Bootstrap Variables for the Table in Light Mode */
[data-bs-theme="light"] .comparison-table {
    /* Reset Bootstrap's dark table variables to Light Theme colors */
    --bs-table-bg: #ffffff;
    --bs-table-color: #212529;
    --bs-table-striped-bg: #f3f4f6;  /* Light Gray for stripes */
    --bs-table-striped-color: #212529;
    --bs-table-active-bg: #e5e7eb;
    --bs-table-active-color: #212529;
    --bs-table-hover-bg: #e5e7eb;
    --bs-table-hover-color: #212529;
    
    /* Ensure borders are light */
    --bs-table-border-color: #e5e7eb;
    color: #212529 !important;
    border-color: #e5e7eb !important;
}

/* Ensure Table Header matches Light Theme */
[data-bs-theme="light"] .comparison-table thead th {
    background-color: #f9fafb !important;
    color: #111827 !important;
    border-bottom: 2px solid #e5e7eb !important;
}

/* Vetrix 1 Column Highlight (Mint Green) - Force Override Stripes */
[data-bs-theme="light"] .comparison-table .highlight-th,
[data-bs-theme="light"] .comparison-table .highlight-td {
    background-color: #ecfdf5 !important; /* Mint Green wins over stripes */
    color: #064e3b !important;
    border-left: 1px solid #10b981 !important;
    border-right: 1px solid #10b981 !important;
    box-shadow: none !important; /* Remove any dark shadows */
}

/* Fix Bottom Border for Highlight Column */
[data-bs-theme="light"] .comparison-table .highlight-td-bottom {
    border-bottom: 1px solid #10b981 !important;
}

/* Faded/Gray Text for Competitor Columns */
[data-bs-theme="light"] .comparison-table td:not(.highlight-td) {
    color: #4b5563 !important; /* Cool Gray */
}

/* =========================================
   Index Styles (Calculator & Slider) - FIXED
   ========================================= */

/* Custom Range Slider Styling */
input[type=range]::-webkit-slider-thumb { 
    -webkit-appearance: none; width: 16px; height: 16px; 
    border-radius: 50%; background: #00b0f0; 
    box-shadow: 0 0 10px rgba(0, 176, 240, 0.5); 
    cursor: pointer; margin-top: -5px; 
}
input[type=range]::-webkit-slider-runnable-track { 
    background: rgba(255, 255, 255, 0.2); 
    height: 6px; border-radius: 3px; 
}
/* Slider Track in Light Mode */
[data-bs-theme="light"] input[type=range]::-webkit-slider-runnable-track {
    background: #d1d5db;
}

/* Profit Calculator Container in Light Mode */
[data-bs-theme="light"] .profit-calculator { 
    background-color: #f8f9fa !important; /* Distinct Light Gray */
    border: 1px solid #dee2e6 !important; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important; 
}

/* Text Colors in Calculator (Light Mode) */
[data-bs-theme="light"] .profit-calculator h3, 
[data-bs-theme="light"] .profit-calculator .form-label, 
[data-bs-theme="light"] .profit-calculator .fs-5 span:first-child { 
    color: #111827 !important; 
}

/* Inputs in Light Mode (White background to pop against gray container) */
[data-bs-theme="light"] .profit-calculator .form-select,
[data-bs-theme="light"] .profit-calculator .amount-wrapper { 
    background-color: #ffffff !important; 
    border: 1px solid #ced4da !important; 
    color: #111827 !important; 
}

[data-bs-theme="light"] .profit-calculator input[type="number"] { 
    color: #111827 !important; 
}

/* Result Values in Light Mode */
[data-bs-theme="light"] .profit-calculator .text-white { 
    color: #111827 !important; /* Change total return from white to dark */
}

/* =================================== */
/* ==   8. Swiper Carousel Styles   == */
/* =================================== */

.myPlanSwiper {
    width: 100%;
    overflow: hidden;
    padding: 20px 0 50px 0;
}

.swiper-wrapper {
    display: flex;
}

.swiper-slide {
    height: auto;
    display: flex;
}

.swiper-slide .card {
    width: 100%;
}

.swiper-button-next,
.swiper-button-prev {
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.swiper-button-next:after, .swiper-button-prev:after {
    font-size: 1.2rem;
    font-weight: bold;
}

.swiper-pagination-bullet-active {
    background-color: var(--bs-primary) !important;
}

/* Static Highlight for the Best Plan (Always Active) */
.best-plan-card {
    transform: scale(1.05);
    border: 2px solid #ffc107 !important;
    z-index: 5;
    box-shadow: 0 1rem 3rem rgba(255, 193, 7, 0.15) !important;
}

/* Button style inside the best plan */
.best-plan-card .btn-highlight {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000 !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}
.best-plan-card .btn-highlight:hover {
    background-color: #e0a800 !important;
}

/* Ensure smooth transition */
.plan-card, .btn-primary {
    transition: all 0.3s ease-out;
}

/* Market Ticker Animation */
.market-ticker-section {
    position: relative;
    background-color: #000 !important; /* Pure black */
    z-index: 100;
}

.ticker-track {
    display: flex;
    width: max-content;
    animation: scrollTicker 100s linear infinite; /* Slow smooth scroll */
}

.ticker-track:hover {
    animation-play-state: paused; /* Pause on hover */
}

@keyframes scrollTicker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Move half way (since we duplicated content) */
}

/* Ensure ticker text is legible */
.market-ticker-section span {
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
}