/* ===== Reset & Elastic Scroll Fix ===== */

* {
    box-sizing: border-box;
}

html {
    /* تنظیم رنگ ثابت برای کل فضای زیرین مرورگر */
    background-color: #eef2f9;
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Vazirmatn", sans-serif;
    color: #2b2b2b;
    min-height: 100vh;

    /* گرادینت رو اینجا می‌ذاریم */
    background: #eef2f9;
    background-attachment: fixed;

    /* جلوگیری از اسکرول افقی احتمالی */
    overflow-x: hidden;

    /* برای نرم‌تر شدن اسکرول در موبایل */
    -webkit-overflow-scrolling: touch;
}

/* ===== 2. Layout ===== */
.container {
    max-width: 1100px;
    margin: auto;
    /* فاصله ۱۰۰ پیکسلی پایین برای نچسبیدن به لبه مرورگر */
    padding: 20px 20px 100px;
}

/* ===== 3. Header (وسط‌چین شده مطابق عکس) ===== */
.main-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
    text-align: center;
}

.logo {
    width: 240px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
    margin-bottom: 5px;
}

.logo:hover {
    transform: scale(1.03);
}

.main-header h1 {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.brand-name {
    font-family: "Inter", sans-serif;
    font-size: 14px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ===== 4. Card Styling ===== */
.card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
}

/* ===== 5. Gold Price Section ===== */
.gold-live-price {
    font-size: 25px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-value {
    font-weight: 800;
    color: #b48900;
}

/* ===== 6. Settings Grid ===== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 13.5px;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.input-group input {
    border: 1px solid #d9dfe9;
    border-radius: 10px;
    padding: 11px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* ===== 7. Notice Box (توضیحات محاسبات) ===== */
.notice-box {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    text-align: right;
}

.notice-box h3 {
    margin: 0 0 12px;
    font-size: 19px;
    color: #8a6a00;
    font-weight: 700;
}

.notice-box ul {
    list-style: none; /* حذف دایره پیش‌فرض لیست برای تراز بهتر */
    padding: 0;
    margin: 0;
}

.notice-box li {
    display: flex;
    align-items: center;
    justify-content: space-between; /* متن راست، سوییچ چپ */
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.notice-box li:last-child {
    border-bottom: none;
}

/* ===== 8. Table Styling ===== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 16px;
    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    text-align: right;
    padding: 18px 12px;
    background: #f1f4f8; /* هدر طوسی یکپارچه */
    color: #444;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
}

tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid #edf1f6;
    vertical-align: middle;
}

tbody tr:hover {
    background: rgba(212, 175, 55, 0.03);
}

/* آخرین ردیف برای زیبایی حاشیه ندارد */
tbody tr:last-child td {
    border-bottom: none;
}

.highlight {
    font-weight: 700;
    color: #b48900;
}

.carat-badge {
    font-size: 11.5px;
    background: rgba(212, 175, 55, 0.15);
    color: #8a6a00;
    padding: 3px 8px;
    border-radius: 8px;
    margin-right: 6px;
    font-weight: 600;
}

/* ===== 10. toggle bottuns ===== */
.tax-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e5eaf2;
    border-radius: 12px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    /* دایره در حالت خاموش سمت راست قرار بگیرد چون RTL هستیم */
    right: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2ecc71;
}

/* اصلاح جهت حرکت: در حالت روشن، دایره به سمت چپ حرکت کند */
input:checked + .slider:before {
    transform: translateX(-20px);
}

/* ===== 9. Responsive ===== */
@media (max-width: 768px) {
    .notice-box li {
        font-size: 13px;
    }

    .main-header {
        flex-direction: column; /* مرکز ماندن در موبایل */
    }

    .logo {
        width: 180px;
    }

    .main-header h1 {
        font-size: 19px;
    }

    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .container {
        padding-bottom: 80px;
    }
}

