/* --- Footer --- */
.main-footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 14px;
    color: var(--sidebar-link-color);
    opacity: 0.7;
}
:root {
    --bg-gradient-start: #0a2a4e;
    --bg-gradient-end: #001229;
    --sidebar-bg: rgba(16, 42, 78, 0.5);
    --sidebar-link-color: #c0c8d8;
    --sidebar-active-bg: #1c92ff;
    --sidebar-active-color: #ffffff;
    --text-color: #e0e8f5;
    --title-color: #ffffff;
    --highlight-color: #f0b90b;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(10, 31, 59, 0.7);
    --font-family-fa: 'Vazirmatn', sans-serif;
    --font-family-en: 'Segoe UI', 'Roboto', sans-serif;
}

body {
    margin: 0;
    font-family: var(--font-family-fa);
    background-image: radial-gradient(circle at top left, var(--bg-gradient-start), var(--bg-gradient-end));
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.8;
}

.page-container {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    padding: 30px 0;
    flex-shrink: 0;
    position: relative; /* Ensures stacking context */
    z-index: 10;       /* Places sidebar above other content */
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    color: var(--sidebar-link-color);
    text-decoration: none;
    padding: 15px 30px;
    margin: 5px 0;
    font-size: 16px;
    font-weight: 700;
    border-right: 4px solid transparent;
    transition: all 0.3s ease;
}

.nav-item.active, .nav-item:hover {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-color);
    border-right-color: var(--highlight-color);
}

/* --- Main Content --- */
.main-content {
    flex-grow: 1;
    padding: 30px 50px;
    max-width: 1000px;
    margin: 0 auto;
}

.main-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.logos {
    display: flex;
    gap: 20px;
}

.logo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.logo-item img {
    height: 48px;
    width: 48px;
}

.logo-item span {
    font-size: 12px;
    font-weight: 700;
    color: var(--highlight-color);
    display: none;
}

.language-switcher {
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--sidebar-link-color);
    color: var(--sidebar-link-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background-color: var(--sidebar-link-color);
    color: var(--bg-gradient-end);
}

.lang-btn.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-color);
    border-color: var(--sidebar-active-bg);
}

/* --- Content Article --- */
.content-article h1, .content-article h2, .content-article h3 {
    color: var(--title-color);
    font-weight: 900;
}

.content-article h1 {
    font-size: 2.5em;
    margin-bottom: 0.2em;
    text-align: center;
    text-shadow: 0 0 10px rgba(28, 146, 255, 0.5);
}

.content-article .subheader {
    text-align: center;
    font-size: 1.1em;
    color: var(--sidebar-link-color);
    margin-top: 0;
    margin-bottom: 40px;
    background-color: var(--card-bg);
    padding: 5px 15px;
    border-radius: 8px;
    display: inline-block;
}

.intro-section {
    text-align: center;
    margin-bottom: 60px;
}

.content-block {
    margin-bottom: 50px;
    padding: 30px;
    background-color: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.content-block h2 {
    font-size: 2em;
    border-bottom: 2px solid var(--highlight-color);
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 25px;
}

.content-block h3 {
    font-size: 1.5em;
    margin-top: 30px;
}

.highlight {
    color: var(--highlight-color);
    font-weight: 700;
    font-size: 1.2em;
}

.formula {
    background: #000;
    color: #0f0;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2em;
    margin: 20px 0;
    border: 1px solid #0f0;
}

.highlight-growth {
    font-weight: 700;
    background: linear-gradient(90deg, #1c92ff, #f0b90b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


.options-container, .traders-comparison {
    display: flex;
    gap: 30px;
}

.option-card, .trader-card {
    flex: 1;
    padding: 25px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}
.trader-card.smart {
    border-color: var(--highlight-color);
}
.trader-card .result {
    margin-top: 20px;
    padding: 10px;
    background-color: rgba(240, 185, 11, 0.1);
    color: var(--highlight-color);
    border: 1px solid var(--highlight-color);
    border-radius: 4px;
    font-weight: 700;
}


/* --- Table --- */
.comparison-table {
    display: table;
    width: 100%;
    margin-top: 30px;
    border-collapse: collapse;
}
.table-row {
    display: table-row;
}
.table-row:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.2);
}
.table-cell {
    display: table-cell;
    padding: 15px;
    border: 1px solid var(--border-color);
}
.table-row.header .table-cell {
    background-color: var(--highlight-color);
    color: var(--bg-gradient-end);
    font-weight: 700;
}


/* --- Smart Management Section --- */
.smart-management h2, .final-result-box h3 {
    display: flex;
    align-items: center;
    gap: 15px;
}

.levels {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}
.level-card {
    background-color: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--sidebar-active-bg);
}
.note {
    background: rgba(240, 185, 11, 0.1);
    border-left: 4px solid var(--highlight-color);
    padding: 15px;
    border-radius: 4px;
    margin: 30px 0;
}
.final-result-box {
    background: rgba(28, 146, 255, 0.1);
    border: 1px solid var(--sidebar-active-bg);
    padding: 20px;
    border-radius: 8px;
}


/* --- LTR and RTL Specific Styles --- */
html[dir="ltr"] body {
    font-family: var(--font-family-en);
}

html[dir="rtl"] body {
    font-family: var(--font-family-fa);
}

html[dir="ltr"] .sidebar {
    order: 1;
}
html[dir="rtl"] .sidebar {
    order: 2;
}

html[dir="ltr"] .main-content {
    order: 2;
}
html[dir="rtl"] .main-content {
    order: 1;
}

html[dir="ltr"] .nav-item {
    border-right: none;
    border-left: 4px solid transparent;
}
html[dir="rtl"] .nav-item {
    border-left: none;
    border-right: 4px solid transparent;
}
html[dir="ltr"] .nav-item.active, html[dir="ltr"] .nav-item:hover {
    border-left-color: var(--highlight-color);
}
html[dir="rtl"] .nav-item.active, html[dir="rtl"] .nav-item:hover {
    border-right-color: var(--highlight-color);
}

html[dir="rtl"] h2 {
    text-align: right;
}
html[dir="ltr"] h2 {
    text-align: left;
}

html[dir="rtl"] .level-card {
    border-left: none;
    border-right: 4px solid var(--sidebar-active-bg);
}
html[dir="rtl"] .note {
    border-left: none;
    border-right: 4px solid var(--highlight-color);
}

/* --- Zero Cost Section --- */
.zero-cost-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin: 40px 0;
}

.cost-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cost-card:hover {
    transform: translateY(-8px);
    border-color: var(--highlight-color);
    box-shadow: 0 8px 20px rgba(240, 185, 11, 0.15);
}

.cost-card-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 20px;
    stroke: var(--highlight-color);
}

.cost-card h4 {
    margin: 0 0 10px 0;
    font-size: 1.25em;
    color: var(--title-color);
    font-weight: 700;
}

.cost-card p {
    margin: 0;
    font-size: 0.95em;
    color: var(--sidebar-link-color);
    line-height: 1.6;
}
/*
==============================================
=== MOBILE RESPONSIVE STYLES ===
==============================================
*/
@media (max-width: 768px) {
    .page-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 10px 0;
        order: 1 !important; /* Ensure it's always on top */
    }

    .sidebar-nav {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
    }

    .nav-item {
        padding: 10px 15px;
        border: none !important;
        border-radius: 20px;
    }

    .nav-item.active, .nav-item:hover {
        border: none !important;
    }

    .main-content {
        padding: 20px 15px;
        order: 2 !important; /* Ensure it's below sidebar */
    }
    
    .main-header-section {
        flex-direction: column;
        gap: 20px;
    }

    .options-container, .traders-comparison {
        flex-direction: column;
        gap: 20px;
    }

    .levels {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .comparison-table, .table-row, .table-cell {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    
    .table-row {
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        overflow: hidden;
    }

    .zero-cost-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .table-row.header {
        display: none;
    }
    
    .table-cell {
        border: none;
        border-bottom: 1px solid var(--border-color);
        padding-left: 50%;
        position: relative;
    }
    
    .table-cell:last-child {
        border-bottom: none;
    }
    
    .table-cell::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        font-weight: bold;
        color: var(--highlight-color);
        text-align: left;
    }
    
    html[dir="rtl"] .table-cell {
        padding-left: 10px;
        padding-right: 50%;
    }
    
    html[dir="rtl"] .table-cell::before {
        left: auto;
        right: 10px;
        text-align: right;
    }

    .content-article h1 {
        font-size: 2em;
    }

    .content-article h2 {
        font-size: 1.6em;
    }
}