/* استایل‌های تکمیلی پروژه bestseo — روی قالب app.min.css اعمال می‌شود و از متغیرهای رنگ همان قالب استفاده می‌کند. */

:root {
    --color-orange: #8a5300;
    --color-bg-orange: #fde9c8;
    --color-gray-status: #606060;
    --color-bg-gray-status: #ebebeb;
}

html.dark-theme {
    --color-orange: #fde9c8;
    --color-bg-orange: #5a3b0c;
    --color-gray-status: #c2c2c2;
    --color-bg-gray-status: #333333;
}

/* لوگو متنی */
.brand-logo {
    display: inline-flex;
    align-items: baseline;
    font-family: Arial, sans-serif;
    font-size: 1.6rem;
    font-weight: bold;
    letter-spacing: -0.5px;
    line-height: 45px;
}
.brand-logo-best { color: var(--primary-color); }
.brand-logo-seo { color: var(--secondary-color); }
.login-form-box .brand-logo { font-size: 2rem; line-height: 50px; }

/* وضعیت‌های اضافه */
.status.orange { color: var(--color-orange); background-color: var(--color-bg-orange); }
.status.gray { color: var(--color-gray-status); background-color: var(--color-bg-gray-status); }

/* پیام‌ها */
.app-alert {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.87rem;
    border: 1px solid transparent;
}
.app-alert.success { color: var(--color-green); background-color: var(--color-bg-green); }
.app-alert.error { color: var(--color-red); background-color: var(--color-bg-red); }
.app-alert.info { color: var(--color-bg-info); background-color: var(--color-info); }
.app-alert ul { margin: 0; list-style: none; }
.validation-summary-valid { display: none; }
html.dark-theme .app-alert.error { color: #f1cfcc; background-color: #4a1f1b; }
html.dark-theme .app-alert.success { color: #d6f3e5; background-color: #11402a; }

.field-validation,
.field-validation-error {
    display: block;
    color: var(--color-red);
    font-size: 0.73rem;
    margin: -10px 4px 12px;
}
.field-validation-valid { display: none; }
.input-validation-error { color: var(--color-red); }
.floatingInpuBox:has(.input-validation-error) { border-color: var(--color-red); }

/* کارت‌های آمار پیشخوان */
.stats-row .cell { margin-bottom: 16px; }
.stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    color: var(--primary-color);
    border-right: 4px solid var(--secondary-color);
    height: 100%;
}
.stat-card:hover { color: var(--secondary-color); }
.stat-card.green { border-right-color: var(--color-green); }
.stat-card.orange { border-right-color: #e0a100; }
.stat-card.blue { border-right-color: var(--color-bg-info); }
.stat-title { font-size: 0.8rem; color: var(--color-gray-level-600); }
.stat-value { font-size: 1.7rem; }

/* پنجره‌های SweetAlert2 (راست‌چین، هماهنگ با قالب و تم تیره) */
.bs-swal { direction: rtl; font-family: inherit; border-radius: 18px; background: var(--white-color); color: var(--primary-color); }
.bs-swal .swal2-title { font-size: 1.2rem; color: var(--primary-color); }
.bs-swal .swal2-html-container { color: var(--color-gray-level-700); font-size: 0.9rem; }
.bs-swal .swal2-actions { gap: 10px; }
.bs-swal .swal2-actions .button { margin: 0; min-width: 110px; }
.bs-swal .swal2-validation-message { background: var(--color-bg-red); color: var(--color-red); }
.bs-swal-form { display: flex; flex-direction: column; gap: 14px; text-align: right; margin-top: 8px; }
.bs-swal-form .floatingInpuBox { margin: 0; }
.bs-swal-check { align-self: flex-start; }
.bs-swal .app-alert { margin-bottom: 10px; text-align: right; }
/* تقویم شمسی روی پنجره SweetAlert هم دیده شود */
jdp-container, jdp-overlay { z-index: 3000 !important; }

/* پیشخوان */
.dash { display: flex; flex-direction: column; gap: 24px; }

/* خوشامد */
.dash-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 32px;
    border-radius: 24px;
    color: #fff;
    background: linear-gradient(120deg, #5b35ad 0%, #7c5ee0 55%, #a58bff 100%);
    box-shadow: 0 16px 40px rgba(91, 53, 173, .28);
}
.dash-hero::before, .dash-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .10);
    pointer-events: none;
}
.dash-hero::before { width: 260px; height: 260px; left: -70px; top: -120px; }
.dash-hero::after { width: 180px; height: 180px; left: 180px; bottom: -110px; background: rgba(255, 255, 255, .07); }
.dash-hero-text { position: relative; z-index: 1; max-width: 640px; }
.dash-hero-date { display: inline-block; padding: 4px 12px; border-radius: 20px; background: rgba(255, 255, 255, .18); font-size: .78rem; }
.dash-hero h1 { color: #fff; font-size: 1.6rem; margin: 12px 0 6px; }
.dash-hero p { margin: 0; opacity: .92; font-size: .9rem; line-height: 1.9; }
.dash-hero p strong { font-size: 1.05rem; }
.dash-hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.dash-hero-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px; border-radius: 12px;
    color: #fff; font-size: .85rem;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    transition: background .15s ease, transform .15s ease;
}
.dash-hero-btn:hover { color: #fff; background: rgba(255, 255, 255, .26); transform: translateY(-2px); }
.dash-hero-btn.primary { background: #fff; color: #5b35ad; border-color: #fff; font-weight: bold; }
.dash-hero-btn.primary:hover { color: #5b35ad; background: #f3efff; }
.dash-hero-btn svg { fill: currentColor; }

/* شاخص‌ها */
.dash-kpis { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.dash-kpi {
    --accent: #7c5ee0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 150px;
    padding: 20px 22px;
    border-radius: 20px;
    background: var(--white-color);
    border: 1px solid var(--color-border-3);
    color: var(--primary-color);
    transition: transform .15s ease, box-shadow .15s ease;
}
.dash-kpi::after {
    content: "";
    position: absolute;
    width: 140px; height: 140px;
    left: -40px; bottom: -60px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.dash-kpi:hover { color: var(--primary-color); transform: translateY(-4px); box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 18%, transparent); }
/* آیکن‌ها: رنگ تند و براق با هاله رنگی */
.dash-kpi-icon {
    width: 50px; height: 50px; border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .45), transparent 55%),
        linear-gradient(145deg, color-mix(in srgb, var(--accent) 75%, #fff), var(--accent) 55%, color-mix(in srgb, var(--accent) 80%, #000));
    box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 0 5px color-mix(in srgb, var(--accent) 14%, transparent);
    margin-bottom: 10px;
}
.dash-kpi-icon svg { fill: currentColor; stroke: currentColor; }
.dash-kpi-label { font-size: .82rem; color: var(--color-gray-level-600); }
.dash-kpi-value { position: relative; z-index: 1; font-size: 2rem; line-height: 1.2; color: var(--accent); }
.dash-kpi-value.money { font-size: 1.45rem; }
.dash-kpi-value small { font-size: .75rem; margin-right: 4px; color: var(--color-gray-level-600); font-weight: normal; }
.dash-kpi-note { position: relative; z-index: 1; font-size: .74rem; color: var(--color-gray-level-600); }
.dash-kpi-note.danger { color: var(--color-red); }

/* عنوان بخش‌ها */
.dash-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: -8px; }
.dash-section-title h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.05rem; color: var(--primary-color); }
.dash-section-title .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.dash-section-title .count { padding: 1px 10px; border-radius: 12px; font-size: .75rem; background: var(--color-gray-level-100); color: var(--color-gray-level-700); }

/* دسته بندی‌ها */
.dash-cats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.dash-cat {
    --accent: #7c5ee0;
    display: flex; flex-direction: column; gap: 6px;
    padding: 16px;
    border-radius: 18px;
    background: var(--white-color);
    border: 1px solid var(--color-border-3);
    border-top: 4px solid var(--accent);
}
.dash-cat-count { font-size: 1.6rem; font-weight: bold; color: var(--accent); line-height: 1.2; }
.dash-cat-title { font-size: .8rem; color: var(--primary-color); }
.dash-cat-bar { height: 6px; border-radius: 6px; background: var(--color-gray-level-100); overflow: hidden; }
.dash-cat-bar span { display: block; height: 100%; border-radius: 6px; background: var(--accent); }

/* کارت آگهی */
.dash-ads { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.ad-tile {
    --tone: #7c5ee0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 34px 14px 0;
    border-radius: 20px;
    background: var(--white-color);
    border: 1px solid var(--color-border-3);
    color: var(--primary-color);
    text-align: center;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.ad-tile.tone-red { --tone: #d2463a; }
.ad-tile.tone-orange { --tone: #e08a00; }
.ad-tile.tone-green { --tone: #1f9d63; }
.ad-tile.tone-blue { --tone: #3f6fd8; }
.ad-tile.tone-gray { --tone: #8a8a8a; }
.ad-tile:hover { color: var(--primary-color); transform: translateY(-4px); box-shadow: 0 14px 30px color-mix(in srgb, var(--tone) 20%, transparent); }
.ad-tile-top { position: absolute; top: 0; right: 0; left: 0; height: 58px; background: linear-gradient(120deg, #3fa92b 0%, #5cc631 50%, #a8e063 100%); }
.ad-tile-badge { position: absolute; top: 10px; left: 10px; right: auto; width: auto; min-width: 0; padding: 2px 10px; font-size: .7rem; z-index: 1; }
.ad-tile-logo {
    position: relative; z-index: 1;
    width: 64px; height: 64px; border-radius: 50%; overflow: hidden; margin-bottom: 6px;
    background: var(--white-color);
    border: 3px solid var(--white-color);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
}
.ad-tile-logo img { width: 100%; height: 100%; object-fit: cover; }
.ad-tile-title { font-size: .92rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-tile-site { font-size: .8rem; color: var(--tone); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-tile-meta { font-size: .72rem; color: var(--color-gray-level-600); }
.ad-tile-footer {
    display: flex; justify-content: space-between; gap: 6px;
    align-self: stretch;
    margin: 12px -14px 0;
    padding: 10px 14px;
    border-top: 1px dashed var(--color-border-3);
    font-size: .75rem;
    font-weight: bold;
}
.ad-tile-footer small { font-weight: normal; color: var(--color-gray-level-600); }

.dash-empty {
    padding: 28px;
    border-radius: 20px;
    text-align: center;
    color: var(--color-gray-level-600);
    background: var(--white-color);
    border: 1px dashed var(--color-border-3);
}

@media (max-width: 1100px) { .dash-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
    .dash-hero { padding: 22px 18px; }
    .dash-hero h1 { font-size: 1.25rem; }
    .dash-kpis, .dash-ads { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .dash-kpi { min-height: 130px; padding: 14px; }
    .dash-kpi-value { font-size: 1.5rem; }
    .dash-kpi-value.money { font-size: 1.05rem; }
    .dash-cats { grid-template-columns: repeat(2, 1fr); }
}

/* فرم‌ها و دکمه‌ها */
.price-preview { margin: 0 0 16px; font-size: 0.87rem; }
.price-preview strong { color: var(--secondary-color); font-size: 1rem; }
.inline-form { display: inline-block; margin: 0; }
.detail-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.detail-actions .button { margin: 0; }
.renew-actions { margin-bottom: 16px; }
.renew-select { margin: 0; min-width: 220px; }
.renew-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.renew-form .floatingInpuBox { margin: 0; min-width: 170px; flex: 1; }
.renew-form .button { margin: 0; }
.review-form .floatingInpuBox { margin-bottom: 12px; }
.add-form-card + .add-form-card { margin-top: 24px; }
.page-description { color: var(--color-gray-level-600); font-size: 0.8rem; margin: 4px 0 0; }
.empty-text { color: var(--color-gray-level-600); font-size: 0.8rem; padding: 16px 0; }
.empty-state { text-align: center; padding: 32px 16px; }

.row-actions { display: inline-flex; gap: 12px; align-items: center; }
.link-button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--color-red);
    cursor: pointer;
    font: inherit;
}
.tag { cursor: pointer; color: inherit; }
.filter-sidebar .footer { margin-top: 16px; }
.floatingInpuBox input[dir="ltr"] { text-align: left; direction: ltr; }
.detail-actions .button,
.renew-actions .button,
.review-form .button,
.add-form-card .button.secondary { border-radius: 50px; white-space: nowrap; }

/* Blazor: کلاس‌های اعتبارسنجی EditForm */
.floatingInpuBox:has(.invalid) { border-color: var(--color-red); }
.floatingInpuBox .invalid { color: var(--color-red); }

/* جستجوی سایت در فرم آگهی */
.site-autocomplete { position: relative; }
.site-suggestions {
    position: absolute;
    top: calc(100% - 12px);
    right: 0;
    left: 0;
    z-index: 30;
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: var(--white-color);
    border: 1px solid var(--color-gray-level-300);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.site-suggestions li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
}
.site-suggestions li.active,
.site-suggestions li:hover { background: var(--bg-light-purple); }
.site-suggestions li .url { color: var(--color-gray-level-600); font-size: 0.75rem; }
.site-suggestions li.empty { color: var(--color-gray-level-600); cursor: default; }

/* لوگوی BestSEO */
.brand-logo-img { display: inline-block; vertical-align: middle; border-radius: 50%; }
.login-logo { display: inline-block; margin-bottom: 12px; }

/* پس‌زمینه شفاف برای بستن سایدبار/منوی کاربر با کلیک بیرون */
.panel-backdrop { position: fixed; inset: 0; z-index: 9; background: transparent; }
/* زیر innerSidebar (z-index: 12) و rightSidebar (400) تا کلیک روی منوها به پس‌زمینه نرسد */
.panel-backdrop.sidebar { z-index: 11; }
#user-dropdown.is-open { top: calc(100% + 6px); right: 0; }
.accordion-item.is-active > .accordion-content { display: block; }

/* فیلدهای گذرواژه: متن و نقطه‌ها سمت راست، دکمه چشم سمت چپ */
.floatingInpuBox.passwordBox input { text-align: right; padding-left: 40px; }
.floatingInpuBox.passwordBox .eye { right: auto; left: 10px; }

/* صفحه ورود فشرده‌تر */
.login-form-box { padding-top: 24px; padding-bottom: 20px; }
.login-form-box .login-logo { margin-bottom: 4px; }
.login-form-box .title { margin-bottom: 16px; }
.login-form-box .floatingInpuBox { margin-bottom: 12px; }
.login-form-box .forget { margin: 4px 0 12px; }
.login-form-box .register { margin-top: 12px; }
.login-form-box .register p { margin-bottom: 0; }

/* نحوه پرداخت و اقساط در فرم آگهی */
.payment-type { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-height: 56px; margin-bottom: 16px; }
.payment-type-label { color: var(--color-gray-level-600); font-size: 0.85rem; }
.payment-type .custom_radio { margin: 0; }
.installment-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.installment-line + .installment-line { margin-top: 4px; }

/* صفحه زمان تمدید: بازه تاریخ */
.renewal-range { align-items: flex-start; }
.renewal-shortcuts { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
.renewal-shortcuts .button { margin: 0; border-radius: 50px; }
.renewal-summary { font-size: 0.87rem; color: var(--color-gray-level-600); margin: 0 0 12px; }
.renewal-summary strong { color: var(--secondary-color); }

/* امور مالی: فیلترها در سربرگ کارت */
.finance-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.finance-filters .search-box { flex: 1 1 240px; }
.finance-filters .floatingInpuBox { margin-bottom: 0; flex: 0 1 180px; }
.finance-action { margin: 0; border-radius: 50px; white-space: nowrap; }

/* کدهای تخفیف */
.discount-code { font-family: Consolas, "Courier New", monospace; letter-spacing: 2px; font-size: 1rem; color: var(--primary-color); }
.new-discount-code { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; padding: 12px; border-radius: 8px; background: var(--bg-light-purple); font-size: 0.85rem; }
.new-discount-code .discount-code { font-size: 1.3rem; }
.new-discount-code .button { margin: 0; border-radius: 50px; }
.row-actions .link-button.purple { color: var(--secondary-color); }

/* پنجره ثبت پرداخت */
.payment-dialog-backdrop { position: fixed; inset: 0; z-index: 500; background: rgba(0, 0, 0, 0.35); }
.payment-dialog { position: fixed; z-index: 501; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 32px)); padding: 20px; margin: 0; }
.payment-dialog-summary { font-size: 0.85rem; color: var(--color-gray-level-600); margin-bottom: 16px; }
.payment-dialog-summary strong { color: var(--secondary-color); font-size: 1rem; }
.payment-methods { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.payment-methods .custom_radio { margin: 0; }
.payment-dialog-actions { gap: 10px; }
.payment-dialog-actions .button { margin: 0; border-radius: 50px; }
.income-by-method { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin: 8px 0 0; font-size: 0.75rem; color: var(--color-gray-level-600); }
.installment-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.installment-line .finance-action { padding: 4px 12px; }
