@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;900&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0b0d10;
    --surface: #14171c;
    --surface-2: #1b1f26;
    --border: #262b33;
    --text: #eef1f5;
    --text-dim: #9aa3af;
    --primary: #22c55e;
    --primary-dark: #16a34a;
    --gold: #f5b301;
    --danger: #ef4444;
    --radius: 14px;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: 76px; /* جا برای نوار پایین */
}
body.no-bottom-nav { padding-bottom: 0; }

.container { max-width: 720px; margin: 0 auto; padding: 18px; }

/* ---------- نوار بالا ---------- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    flex-wrap: wrap;
    gap: 10px;
}
.navbar .logo { display:flex; align-items:center; gap:8px; font-weight: 900; font-size: 18px; color: var(--text); text-decoration:none; }
.navbar .logo .mark { width:30px; height:30px; border-radius:9px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); display:flex; align-items:center; justify-content:center; font-size:15px; color:#08120c; font-weight:900; }
.navbar .credit-badge { background: rgba(34,197,94,0.12); color: var(--primary); padding: 7px 14px; border-radius: 20px; font-size: 13px; font-weight:700; border: 1px solid rgba(34,197,94,0.3); text-decoration:none; }
.navbar a { color:#fff; }

/* ---------- نوار پایین (موبایل اپ) ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
}
.bottom-nav a {
    flex:1;
    display:flex; flex-direction:column; align-items:center; gap:3px;
    text-decoration:none;
    color: var(--text-dim);
    font-size: 11px;
    padding: 6px 0;
    border-radius: 10px;
}
.bottom-nav a .bn-icon { font-size: 20px; }
.bottom-nav a.active { color: var(--primary); }

/* ---------- کارت‌ها ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 16px;
}
.card-featured {
    background: linear-gradient(135deg, rgba(245,179,1,0.14), rgba(245,179,1,0.03));
    border-color: rgba(245,179,1,0.35);
}

/* ---------- گرید ابزارها ---------- */
.section-title { font-size: 15px; font-weight:700; margin-bottom: 12px; color: var(--text-dim); }
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}
.tool-card {
    display: block;
    text-align: center;
    padding: 18px 8px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    text-decoration: none;
    color: #fff;
    transition: all 0.2s ease;
}
.tool-card:active, .tool-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.tool-card .icon { font-size: 26px; display: block; margin-bottom: 8px; }
.tool-card .cost { display:block; font-size:11px; color: var(--text-dim); margin-top:4px; }

/* ---------- دکمه‌ها ---------- */
.btn {
    display: inline-block;
    background: var(--primary);
    color: #06170d;
    border: none;
    padding: 14px 22px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align:center;
    transition: opacity 0.2s;
}
.btn:active, .btn:hover { opacity: 0.85; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-gold { background: var(--gold); color: #201400; }
.btn-sm { padding: 9px 14px; font-size: 13px; }
.btn-danger { background: var(--danger); color:#fff; }
.btn-green { background: var(--primary); color:#06170d; }
.btn-block { width: 100%; }

/* ---------- فرم‌ها ---------- */
input, textarea, select {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    margin-bottom: 14px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); }
label { display:block; margin-bottom: 6px; font-size: 13px; color: var(--text-dim); }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.35); color:#fecaca; }
.alert-success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.35); color:#bbf7d0; }

.output-box {
    white-space: pre-wrap;
    line-height: 2;
    background: var(--surface-2);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 14.5px;
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; text-align: right; border-bottom: 1px solid var(--border); font-size: 13.5px; }
th { color: var(--text-dim); font-weight:600; }

/* ---------- صفحه خوش‌آمدگویی ---------- */
.splash-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 24px;
    text-align: center;
}
.splash-logo {
    width: 92px; height: 92px;
    border-radius: 26px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items:center; justify-content:center;
    font-size: 40px; font-weight: 900; color: #06170d;
    margin-bottom: 22px;
    box-shadow: 0 10px 40px rgba(34,197,94,0.25);
}
.splash-title { font-size: 26px; font-weight: 900; margin-bottom: 8px; }
.splash-tagline { color: var(--text-dim); font-size: 14.5px; margin-bottom: 34px; max-width: 320px; }
.splash-actions { width: 100%; max-width: 320px; display:flex; flex-direction:column; gap: 12px; }
.splash-footer { position: absolute; bottom: 24px; font-size: 12px; color: var(--text-dim); }
.splash-footer b { color: var(--text); }

.tabs { display:flex; gap:8px; margin-bottom:20px; flex-wrap:wrap; }
.tabs a { padding:10px 18px; border-radius:10px; background:var(--surface-2); text-decoration:none; color:#fff; font-size:14px; border:1px solid var(--border); }
.tabs a.active { background: var(--primary); color:#06170d; border-color:transparent; }

.badge { display:inline-block; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:700; }
.badge-on { background: rgba(34,197,94,0.15); color: var(--primary); }
.badge-off { background: rgba(239,68,68,0.15); color: #f87171; }
