/* ============================================================
   V — تم مینیمال فلت پاستیلی (پریوینکل / اسلیت)
   ============================================================ */

:root {
    --primary-color: #7b8cf0;
    --primary-dark: #6274e4;
    --primary-deep: #5163d0;
    --secondary-color: #94a3f4;
    --accent-color: #7b8cf0;
    --gold: #7b8cf0;
    --gold-dark: #6274e4;
    --gold-soft: rgba(123, 140, 240, 0.12);
    --green-soft: rgba(123, 140, 240, 0.08);
    --bg-color: #f7f8fc;
    --surface: #ffffff;
    --text-color: #3f4759;
    --text-muted: #8b93a7;
    --border-color: #e8ebf4;
    --shadow-sm: 0 1px 2px rgba(63, 71, 89, 0.05);
    --shadow-md: 0 4px 12px rgba(63, 71, 89, 0.06);
    --shadow-lg: 0 10px 28px rgba(63, 71, 89, 0.08);
    --pattern-light: none;
    --pattern-dark: none;
}

* {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: var(--pattern-light);
    background-size: 72px 72px;
    color: var(--text-color);
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* ============================================================
   نوار بالایی — سبز زمردی با خط طلایی
   ============================================================ */
.navbar-modern {
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-deep) 100%);
    background-image: var(--pattern-dark), linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-deep) 100%);
    background-size: 72px 72px, 100% 100%;
    padding: 0.9rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: none;
    box-shadow: 0 10px 30px rgba(63, 71, 89, 0.25);
}

/* خط طلایی ظریف زیر نوار */
.navbar-modern::after {
    content: '';
    position: absolute;
    right: 0;
    left: 0;
    bottom: -3px;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 18%, #c7d2fe 50%, var(--gold) 82%, transparent 100%);
}

/* Brand */
.brand-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.35rem;
    color: #ffffff !important;
    text-decoration: none;
    padding: 0.35rem 0;
    transition: color 0.25s ease;
}

.brand-modern:hover {
    color: #ffffff !important;
}

.brand-icon {
    color: var(--gold);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(123, 140, 240, 0.55);
    border-radius: 999px 999px 10px 10px;
    padding: 6px;
    width: 44px;
    height: 44px;
    transition: all 0.25s ease;
}

.brand-modern:hover .brand-icon {
    background: rgba(123, 140, 240, 0.15);
    transform: translateY(-1px);
}

.brand-text {
    background: linear-gradient(180deg, #eef1fd 0%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.01em;
}

/* لینک‌های ناوبری */
.nav-links-modern {
    gap: 0.25rem;
}

.nav-link-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem !important;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.82) !important;
    transition: all 0.25s ease;
    position: relative;
    margin: 0 0.15rem;
}

.nav-link-modern::before {
    content: '';
    position: absolute;
    bottom: 0.2rem;
    right: 50%;
    transform: translateX(50%);
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-link-modern:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.07);
}

.nav-link-modern:hover::before {
    width: 55%;
}

.nav-link-modern.active {
    color: #ffffff !important;
    background: rgba(123, 140, 240, 0.16);
    font-weight: 700;
}

.nav-link-modern.active::before {
    width: 55%;
}

.nav-icon {
    flex-shrink: 0;
    opacity: 0.9;
}

/* دکمه همبرگری */
.custom-toggler {
    border: 1px solid rgba(123, 140, 240, 0.6);
    border-radius: 10px;
    padding: 0.45rem 0.7rem;
    transition: all 0.25s ease;
}

.custom-toggler:hover {
    background: rgba(123, 140, 240, 0.15);
}

.custom-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(123, 140, 240, 0.35);
}

.custom-toggler .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28230, 208, 148, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* دکمه‌های نوار بالایی */
.btn-nav-outline,
.btn-nav-primary,
.btn-nav-user,
.btn-nav-danger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.25s ease;
    border: 1px solid;
    white-space: nowrap;
}

.btn-nav-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.btn-nav-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.7);
    color: #ffffff;
}

.btn-nav-primary {
    background: linear-gradient(180deg, #8b9af2 0%, var(--gold-dark) 100%);
    border-color: rgba(255, 255, 255, 0.35);
    color: #2f3548;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.btn-nav-primary:hover {
    background: linear-gradient(180deg, #a5b2f6 0%, #6274e4 100%);
    color: #2f3548;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.btn-nav-user {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(123, 140, 240, 0.55);
    color: #ffffff;
    position: relative;
}

.btn-nav-user:hover,
.btn-nav-user:focus,
.btn-nav-user.show {
    background: rgba(123, 140, 240, 0.2);
    color: #ffffff;
    border-color: var(--gold);
}

.btn-nav-user .dropdown-arrow {
    transition: transform 0.3s ease;
    margin-right: 0.25rem;
}

.btn-nav-user.show .dropdown-arrow {
    transform: rotate(180deg);
}

/* منوی کاربر */
.dropdown-menu-modern {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--gold);
    border-radius: 14px;
    box-shadow: var(--shadow-raised);
    padding: 0.5rem;
    margin-top: 0.75rem;
    min-width: 250px;
    animation: dropdownFadeIn 0.25s ease;
}

/* RTL Dropdown positioning */
[dir="rtl"] .dropdown-menu-end {
    left: 0 !important;
    right: auto !important;
    transform-origin: top right;
}

[dir="rtl"] .dropdown-menu-modern.dropdown-menu-end {
    left: 0 !important;
    right: auto !important;
}

#userMenu {
    position: relative;
}

[dir="rtl"] #userMenu .dropdown-menu {
    left: 0 !important;
    right: auto !important;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

.user-info-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, var(--green-soft) 0%, var(--gold-soft) 100%);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 999px 999px 10px 10px;
    background: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-dark) 100%);
    border: 1px solid rgba(123, 140, 240, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e3e8fb;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.2s ease;
    margin: 0.2rem 0;
    text-decoration: none;
}

.dropdown-item-modern:hover {
    background: var(--green-soft);
    color: var(--primary-color);
}

.dropdown-item-modern svg {
    flex-shrink: 0;
}

.dropdown-item-danger {
    color: #e06767;
}

.dropdown-item-danger:hover {
    background: rgba(224, 103, 103, 0.08);
    color: #c94f4f;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--border-color);
    opacity: 0.7;
}

.btn-nav-danger {
    background: transparent;
    border-color: #e06767;
    color: #e06767;
}

.btn-nav-danger:hover {
    background: #e06767;
    color: white;
}

/* ناوبری واکنش‌گرا */
@media (max-width: 991px) {
    .navbar-modern {
        padding: 0.75rem 0;
    }

    .nav-link-modern {
        padding: 0.75rem 1rem !important;
        margin: 0.2rem 0;
    }

    .btn-nav-outline,
    .btn-nav-primary {
        width: 100%;
        justify-content: center;
        margin: 0.25rem 0;
    }

    #authButtons {
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
    }

    #userMenu {
        width: 100%;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
    }

    #userMenu .btn-nav-user {
        width: 100%;
        justify-content: center;
    }

    .dropdown-menu-modern {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* ============================================================
   بخش قهرمان (لندینگ)
   ============================================================ */
.hero-section {
    padding: 3.5rem 1rem 2.5rem;
    margin-bottom: 1.5rem;
}

.hero-medallion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    margin-bottom: 1.5rem;
    color: var(--gold-dark);
    background:
        radial-gradient(circle at 50% 38%, rgba(123, 140, 240, 0.16) 0%, rgba(123, 140, 240, 0.04) 62%, transparent 72%),
        var(--surface);
    border: 1px solid rgba(123, 140, 240, 0.5);
    border-radius: 999px;
    box-shadow: var(--shadow-soft), inset 0 0 0 5px var(--surface), inset 0 0 0 6px rgba(123, 140, 240, 0.35);
}

.hero-kicker {
    font-size: 1.05rem;
    color: var(--gold-dark);
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.1rem);
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    line-height: 1.35;
}

.hero-title .hero-title-accent {
    background: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.08rem;
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto;
    line-height: 2;
}

/* جداکننده تزئینی */
.ornament-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin: 2rem auto 0;
    max-width: 420px;
    color: var(--gold);
}

.ornament-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 100%);
}

.ornament-line:last-child {
    background: linear-gradient(90deg, var(--gold) 0%, transparent 100%);
}

/* ============================================================
   کارت‌های قابلیت (لندینگ)
   ============================================================ */
.feature-card {
    background: var(--surface);
    border: 1px solid var(--border-color) !important;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

/* خط طلایی بالای کارت */
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 30%, #c7d2fe 50%, var(--gold) 70%, transparent 100%);
    opacity: 0.85;
}

.feature-card .card-body {
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;
}

/* قاب محرابی آیکون */
.feature-arch {
    width: 74px;
    height: 86px;
    margin: 2rem auto 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 14px;
    color: var(--primary-color);
    background: linear-gradient(180deg, var(--gold-soft) 0%, rgba(123, 140, 240, 0.06) 100%);
    border: 1px solid rgba(123, 140, 240, 0.45);
    border-radius: 999px 999px 12px 12px;
    box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px rgba(123, 140, 240, 0.3);
    transition: all 0.25s ease;
}

.feature-card .card-title {
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
}

.feature-card .card-text {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.9;
    margin-bottom: 1rem;
}

.feature-more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--gold-dark);
    font-size: 0.85rem;
    font-weight: 700;
}

.feature-more::after {
    content: '\2190';
    /* فلش چپ برای RTL */
    transition: transform 0.25s ease;
}

.card-link {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.card-link:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-raised) !important;
    border-color: rgba(123, 140, 240, 0.7) !important;
}

.card-link:hover .card-title {
    color: var(--primary-color);
}

.card-link:hover .feature-arch {
    background: linear-gradient(180deg, rgba(123, 140, 240, 0.25) 0%, rgba(123, 140, 240, 0.1) 100%);
    transform: translateY(-3px);
}

.card-link:hover .feature-more::after {
    transform: translateX(-4px);
}

/* ============================================================
   پانوشت
   ============================================================ */
.footer {
    background: transparent;
    border-top: none;
    padding: 1.5rem 0 2rem;
    margin-top: auto;
}

.footer-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    max-width: 480px;
    margin: 0 auto 1rem;
    color: var(--gold);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.container-fluid {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .main-content {
        padding: 1rem 0;
    }

    .hero-section {
        padding: 2rem 0.5rem 1.5rem;
    }
}

/* ============================================================
   مودال‌ها و فرم‌ها
   ============================================================ */
.modal-content {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--gold);
    box-shadow: var(--shadow-raised);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.4rem 1.5rem;
}

.modal-title {
    color: var(--primary-dark);
    font-weight: 800;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-control,
.form-select {
    background-color: #ffffff;
    border-color: var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
}

.form-select:focus,
.form-control:focus {
    background-color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(123, 140, 240, 0.18);
    color: var(--text-color);
}

.btn-primary {
    background: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-dark);
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-deep) 100%);
    border-color: var(--primary-deep);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-outline-secondary {
    color: var(--text-muted);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: var(--green-soft);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ============================================================
   صفحه جستجو
   ============================================================ */
.search-form-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.3s ease;
}

.search-form-card:hover {
    box-shadow: var(--shadow-raised) !important;
}

.input-group {
    border-radius: 10px;
    overflow: hidden;
}

.input-group .btn {
    border-radius: 0;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    border-width: 1px;
    transition: all 0.2s ease;
    min-width: 48px;
}

/* RTL: Input on left, buttons on right */
[dir="rtl"] .input-group .form-control {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-left: none;
}

[dir="rtl"] .input-group .btn:first-of-type {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-right: none;
}

[dir="rtl"] .input-group .btn:last-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-left: none;
}

/* LTR: Input on left, buttons on right */
[dir="ltr"] .input-group .form-control {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-right: none;
}

[dir="ltr"] .input-group .btn:first-of-type {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-left: none;
}

[dir="ltr"] .input-group .btn:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-right: none;
}

.input-group .form-control {
    border-width: 1px;
}

.input-group .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(123, 140, 240, 0.18);
    z-index: 2;
}

.input-group .form-control:focus+.btn,
.input-group .form-control:focus~.btn {
    border-color: var(--primary-color);
}

#searchSettingsBtn.active {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

#searchSettingsBtn.active:hover {
    background-color: var(--primary-deep);
    border-color: var(--primary-deep);
}

.input-group .btn-primary:hover {
    background-color: var(--primary-deep);
    border-color: var(--primary-deep);
    z-index: 3;
}

.btn-group .btn {
    transition: all 0.2s ease;
}

.btn-group .btn:hover {
    transform: translateY(-1px);
}

.btn-group .btn-check:checked+.btn {
    box-shadow: 0 2px 8px rgba(123, 140, 240, 0.3);
}

.result-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border-radius: 12px;
}

.result-card:hover {
    transform: translateY(-2px);
    border-color: rgba(123, 140, 240, 0.6);
    box-shadow: var(--shadow-soft) !important;
}

[data-bs-toggle="tooltip"] {
    cursor: help;
}

#fusionOptionsRow {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

@media (max-width: 768px) {
    .btn-group.flex-wrap .btn {
        flex: 1 1 50%;
        margin-bottom: 0.5rem;
    }

    #fusionOptionsRow .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.alert {
    border-radius: 10px;
    border: none;
}

.text-danger {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ============================================================
   اعلان‌ها (Toast)
   ============================================================ */
.toast {
    border-radius: 14px;
    border: none;
    box-shadow: var(--shadow-raised);
    min-width: 300px;
    max-width: 500px;
}

.toast-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.75rem 1rem;
    font-weight: 700;
}

.toast-body {
    padding: 1rem;
    font-size: 0.95rem;
}

.toast-success {
    background-color: #6274e4;
    color: white;
}

.toast-success .toast-header {
    background-color: rgba(98, 116, 228, 0.92);
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.toast-error,
.toast-danger {
    background-color: #e88585;
    color: white;
}

.toast-error .toast-header,
.toast-danger .toast-header {
    background-color: rgba(201, 79, 79, 0.92);
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.toast-warning {
    background-color: #6274e4;
    color: white;
}

.toast-warning .toast-header {
    background-color: rgba(123, 140, 240, 0.92);
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.toast-info {
    background-color: #2e6f8e;
    color: white;
}

.toast-info .toast-header {
    background-color: rgba(96, 165, 250, 0.92);
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.toast-confirm {
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--gold);
}

.toast-confirm .toast-header {
    background-color: var(--primary-dark);
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.toast-confirm .toast-body {
    color: var(--text-color);
}

.toast-confirm .btn {
    margin: 0 0.25rem;
    min-width: 80px;
}

.toast-icon {
    width: 20px;
    height: 20px;
    margin-left: 0.5rem;
    display: inline-block;
    vertical-align: middle;
}

/* ============================================================
   بلوک کد
   ============================================================ */
.code-block-container {
    position: relative;
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    font-family: 'Courier New', monospace;
    background-color: #fafbfe;
    direction: ltr;
    font-size: 0.95rem;
    line-height: 1.5;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f1eee2;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    border-radius: 8px 8px 0 0;
    min-height: 30px;
}

.code-language {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
}

.copy-code-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    color: #555;
    height: 24px;
    width: 24px;
    min-width: 24px;
}

.copy-code-btn:hover {
    background-color: var(--gold-soft);
    border-color: var(--gold);
    transform: translateY(-1px);
}

.copy-code-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
}

.code-block-content {
    margin: 0;
    padding: 12px 16px;
    background-color: #ffffff;
    overflow-x: auto;
    white-space: pre;
    font-size: 0.95rem;
    line-height: 1.5;
    border: none;
    border-radius: 0;
    color: #2d3748;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    letter-spacing: 0.2px;
}

.language-js,
.language-javascript {
    color: #e44920;
}

.language-python {
    color: #3572A5;
}

.language-html {
    color: #e34c26;
}

.language-css {
    color: #264de4;
}

.language-json {
    color: #000000;
}

@media (max-width: 768px) {
    .code-block-container {
        font-size: 0.9rem;
        margin: 12px 0;
    }

    .code-block-header {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .code-block-content {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

/* ==== FLAT-PASTEL OVERRIDES ==== */

body {
    background-image: none;
}

/* --- navbar: flat & light --- */
.navbar-modern {
    background: #ffffff;
    background-image: none;
    box-shadow: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.65rem 0;
}

.navbar-modern::after {
    display: none;
}

.brand-modern {
    color: var(--text-color) !important;
    gap: 0.6rem;
    font-size: 1.2rem;
}

.brand-modern:hover {
    color: var(--primary-deep) !important;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #e3e8fb;
    color: #5163d0;
    font-weight: 800;
    font-size: 1.2rem;
    line-height: 1;
}

.brand-text {
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: currentColor;
    color: var(--text-color);
}

.nav-link-modern {
    color: var(--text-muted) !important;
}

.nav-link-modern::before {
    display: none;
}

.nav-link-modern:hover {
    color: var(--primary-deep) !important;
    background: #f1f3fc;
}

.nav-link-modern.active {
    color: #5163d0 !important;
    background: #e8edfd;
    font-weight: 700;
}

.custom-toggler {
    border-color: var(--border-color);
}

.custom-toggler:hover {
    background: #f1f3fc;
}

.custom-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(123, 140, 240, 0.2);
}

.custom-toggler .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2863, 71, 89, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* --- nav buttons: flat pastel --- */
.btn-nav-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-nav-outline:hover {
    background: #f1f3fc;
    border-color: #c7d2fe;
    color: var(--primary-deep);
}

.btn-nav-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: none;
}

.btn-nav-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #ffffff;
    transform: none;
    box-shadow: none;
}

.btn-nav-user {
    background: #f1f3fc;
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-nav-user:hover,
.btn-nav-user:focus,
.btn-nav-user.show {
    background: #e8edfd;
    border-color: #c7d2fe;
    color: var(--primary-deep);
}

.btn-nav-danger {
    background: #fdf0f0;
    border-color: #f5d5d5;
    color: #c94f4f;
}

.btn-nav-danger:hover {
    background: #fbe3e3;
    border-color: #efc3c3;
    color: #b34444;
}

/* --- bootstrap buttons: flat --- */
.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: none;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    box-shadow: none;
}

.btn-outline-primary {
    color: #5163d0;
    border-color: #c7d2fe;
}

.btn-outline-primary:hover {
    background: #e8edfd;
    border-color: #a5b2f6;
    color: #4353b8;
}

/* --- cards: flat --- */
.card {
    border: 1px solid var(--border-color) !important;
    border-radius: 16px;
    box-shadow: none !important;
}

.feature-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 18px;
}

.feature-card::before {
    display: none;
}

.card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(63, 71, 89, 0.07) !important;
    border-color: #c7d2fe !important;
}

.feature-arch {
    background: #e8edfd;
    color: #5163d0;
    border: none;
    border-radius: 14px;
    box-shadow: none;
}

/* --- hero: flat text --- */
.hero-title,
.hero-title .hero-title-accent {
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: currentColor;
}

.hero-title {
    color: var(--text-color);
}

.hero-title .hero-title-accent {
    color: #5163d0;
}

/* --- footer: flat --- */
.footer {
    background: #ffffff;
    background-image: none;
    border-top: 1px solid var(--border-color);
    box-shadow: none;
}

.footer-text {
    color: var(--text-muted);
}

/* --- forms: soft pastel focus --- */
.form-control,
.form-select {
    border-color: var(--border-color);
    border-radius: 10px;
}

.form-control:focus,
.form-select:focus {
    border-color: #a5b2f6;
    box-shadow: 0 0 0 0.2rem rgba(123, 140, 240, 0.15);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

hr {
    border-color: var(--border-color);
    opacity: 1;
}

/* --- alerts: pastel --- */
.alert-danger {
    background: #fdf0f0;
    border-color: #f5d5d5;
    color: #b34444;
}

.alert-success {
    background: #eaf7f0;
    border-color: #cdebdb;
    color: #2e7d5b;
}

/* --- agent form tabs --- */
.agent-form-tabs {
    gap: 0.4rem;
    background: #f1f3fc;
    padding: 0.35rem;
    border-radius: 14px;
    display: inline-flex;
}

.agent-form-tabs .nav-link {
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.55rem 1.15rem;
}

.agent-form-tabs .nav-link:hover {
    color: var(--primary-deep);
}

.agent-form-tabs .nav-link.active {
    background: #ffffff;
    color: #5163d0;
    box-shadow: 0 1px 3px rgba(63, 71, 89, 0.08);
}

.source-row,
.tool-row {
    background: #fafbfe !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px;
}
