/* ==========================================================================
   Aleppo.Gold — نظام التصميم (كريمي دافئ + ذهبي، هادئ وفاخر)
   كل المتغيرات اللونية معرّفة هنا فقط، وتُستبدل دفعة واحدة داخل body.dark-mode
   ========================================================================== */

:root {
    --wrap-w: min(92vw, 440px);
    font-size: clamp(12px, 3.8vw, 16px);

    --radius: 18px;
    --radius-sm: 12px;
    --gap: clamp(22px, 4vw, 36px);
    --transition: 220ms cubic-bezier(.4, 0, .2, 1);

    --buy-col: 50%;
    --sell-col: 50%;

    /* ألوان — نهاري */
    --bg: #FAF6EC;
    --surface: #FFFFFF;
    --surface-alt: #F3ECDC;
    --text: #2B2520;
    --text-muted: #7A6F60;
    --border: #E8DECC;

    --gold: #C8973F;
    --gold-dark: #8C6B23;
    --gold-soft: #F4E4BC;
    --on-gold: #2B2520;

    --buy: #2F7D4F;
    --sell: #B23B30;

    --shadow: 0 10px 30px rgba(60, 45, 20, .10);
    --shadow-hover: 0 16px 40px rgba(60, 45, 20, .16);
}

/* ألوان — ليلي (نفس المتغيرات، قيم مختلفة فقط) */
body.dark-mode {
    --bg: #0E141C;
    --surface: #19212E;
    --surface-alt: #232E3F;
    --text: #EDF0F4;
    --text-muted: #93A0B2;
    --border: #3A4859;

    --gold: #E6C36A;
    --gold-dark: #B8893B;
    --gold-soft: #2A3547;
    --on-gold: #19212E;

    --buy: #5FBE82;
    --sell: #E08577;

    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --shadow-hover: 0 16px 44px rgba(0, 0, 0, .55);
}

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

/* ===== الخلفية ===== */
body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(30px, 5vw, 55px) 10px;
    min-height: 100vh;
    text-align: center;
    transition: background var(--transition), color var(--transition);
}

/* ===== أزرار الهيدر ===== */
.header {
    width: 100%;
    max-width: var(--wrap-w);
    position: relative;
    height: 44px;
    margin-bottom: 18px;
}

#toggleBtn, #langBtn {
    position: absolute;
    top: 0;
    width: 44px;
    height: 44px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-weight: 700;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

#toggleBtn:hover, #langBtn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

#toggleBtn:active, #langBtn:active { transform: translateY(0); }

#toggleBtn { right: 4px; }
#langBtn { left: 4px; }

html[dir="ltr"] #toggleBtn { left: 4px; right: auto; }
html[dir="ltr"] #langBtn { right: 4px; left: auto; }

/* ===== تبويبات الموبايل ===== */
.mobile-tabs {
    display: none;
    width: var(--wrap-w);
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .mobile-tabs {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
    }
}

.tab-btn {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.tab-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.tab-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--on-gold);
    box-shadow: var(--shadow-hover);
}

/* ===== إخفاء الأقسام على الموبايل ===== */
.section {
    display: block;
    width: 100%;
}

@media (max-width: 768px) {
    .section { display: none; }
    .section.active { display: block; }
}

/* على الكمبيوتر كل الأقسام تظهر فوق بعض — مسافة تفصلها عن النظرة السريعة */
@media (min-width: 769px) {
    .section + .section { margin-top: 40px; }
}

/* ===== عناوين ===== */
h1, h2 {
    font-size: clamp(1.2rem, 4.5vw, 1.65rem);
    margin: 0 0 8px;
    font-weight: 800;
    color: var(--text);
}

.subnote {
    margin: 0 0 12px;
    font-size: clamp(.82rem, 3.5vw, .94rem);
    color: var(--text-muted);
    font-weight: 400;
}

#note {
    color: var(--gold-dark);
    margin: 0 0 var(--gap);
    font-size: clamp(.85rem, 3.6vw, .98rem);
    font-weight: 600;
}

body.dark-mode #note { color: var(--gold); }

/* ===== البطاقات (الجداول) ===== */
.table-wrap {
    width: var(--wrap-w);
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin: 0 auto clamp(14px, 3vw, 24px);
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.table-wrap:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.table-head {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--surface-alt);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}

.th {
    padding: .7rem;
    font-size: .95rem;
    text-align: center;
    color: var(--gold-dark);
    font-weight: 800;
}

body.dark-mode .th { color: var(--gold); }

.table {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.cell {
    padding: .7rem;
    font-size: .93rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
    color: var(--text);
    font-weight: 500;
}

.cell:nth-child(2n) {
    border-inline-start: 1px solid var(--border);
}

.price-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    font-variant-numeric: tabular-nums;
}

.value {
    font-weight: 700;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.sym {
    position: absolute;
    right: 8px;
    font-size: .85em;
    color: var(--gold-dark);
    font-weight: 600;
}

body.dark-mode .sym { color: var(--gold); }

/* ===== شارة آخر تحديث ===== */
.last-update {
    width: var(--wrap-w);
    margin: 10px auto 0;
    min-height: 22px;
    display: inline-flex;
    align-items: flex-start;
    justify-content: center;
    gap: 7px;
    font-size: .8rem;
    line-height: 1.5;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 14px;
    text-align: center;
}

@media (max-width: 480px) {
    .last-update {
        font-size: .72rem;
        padding: 8px 12px;
        border-radius: var(--radius-sm);
    }
}

.last-update::before {
    content: '';
    flex: none;
    width: 7px;
    height: 7px;
    margin-top: .5em;
    border-radius: 50%;
    background: var(--buy);
    box-shadow: 0 0 0 0 rgba(47, 125, 79, .5);
    animation: pulseDot 2.2s ease-in-out infinite;
}

body.dark-mode .last-update::before {
    box-shadow: 0 0 0 0 rgba(95, 190, 130, .5);
}

@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(47, 125, 79, .45); }
    70% { box-shadow: 0 0 0 6px rgba(47, 125, 79, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47, 125, 79, 0); }
}

/* ===== العملات ===== */
.table-wrap.currency {
    margin-top: clamp(20px, 4vw, 30px);
}

.table-subtitle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: .82rem;
    color: var(--text-muted);
}

.table-subtitle .sub-th {
    display: grid;
    grid-template-columns: 43% 57%;
    padding: .5rem;
}

.sub-th .buy-lbl, .sub-th .sell-lbl {
    display: block;
    font-weight: 700;
    letter-spacing: .2px;
}

.sub-th .buy-lbl {
    border-inline-end: 1px solid var(--border);
}

html[dir="rtl"] .sub-th .buy-lbl { text-align: right; padding-right: 20px; }
html[dir="rtl"] .sub-th .sell-lbl { text-align: left; padding-left: 35px; }
html[dir="ltr"] .sub-th .buy-lbl { text-align: left; padding-left: 20px; }
html[dir="ltr"] .sub-th .sell-lbl { text-align: right; padding-right: 45px; }

@media (max-width: 480px) {
    .table-subtitle .sub-th { grid-template-columns: 38% 62%; }
    html[dir="ltr"] .table-subtitle .sub-th { grid-template-columns: 40% 60%; }
    html[dir="rtl"] .sub-th .buy-lbl { padding-right: 0; }
    html[dir="ltr"] .sub-th .buy-lbl { padding-left: 0; }
    html[dir="ltr"] .sub-th .sell-lbl { padding-right: 35px; }
}

.price-two {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.price-two .buy, .price-two .sell {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    position: relative;
    width: 48%;
}

.price-two .sell { width: 52%; }

.price-two .buy {
    color: var(--buy);
    border-inline-end: 1px solid var(--border);
    padding-inline-end: 12px;
    justify-content: flex-end;
}

.price-two .sell {
    color: var(--sell);
    padding-inline-start: 12px;
    justify-content: flex-start;
}

.price-two .num { white-space: nowrap; }

.price-two .unit {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.2em;
    text-align: center;
    white-space: nowrap;
    color: var(--text-muted);
}

html[dir="rtl"] .price-two .unit { left: 8px; }
html[dir="ltr"] .price-two .unit { right: 8px; }

html[dir="rtl"] .price-two .buy,
html[dir="rtl"] .price-two .sell { padding-left: calc(2.2em + 14px); }

html[dir="ltr"] .price-two .buy,
html[dir="ltr"] .price-two .sell { padding-right: calc(2.2em + 14px); }

@media (max-width: 480px) {
    .price-two .buy, .price-two .sell { width: 50%; }
}

.currency-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    text-align: right;
    padding-inline: 8px;
}

.currency-cell .flag { font-size: 1.2rem; }
.currency-cell .code { font-size: .85rem; color: var(--text-muted); }

/* ===== أزرار الحاسبات (CTA) ===== */
.calc-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--on-gold);
    font-weight: 900;
    font-size: 0.92rem;
    background: var(--gold);
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    box-shadow: var(--shadow);
    margin: 10px 0 20px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.calc-cta {
    width: var(--wrap-w);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px auto var(--gap);
    text-align: center;
}

.calc-cta-text {
    font-size: .9rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.45;
}

.cta-pointer {
    font-size: 1.5rem;
    line-height: 1;
    display: inline-block;
    animation: ctaBounce 1.3s ease-in-out infinite;
    opacity: .9;
}

@keyframes ctaBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ===== روابط الفوتر ===== */
.footer-text {
    margin-top: var(--gap);
    font-size: .75rem;
    font-weight: 300;
}

.footer-text a {
    position: relative;
    display: inline-block;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-decoration: none;
    background: linear-gradient(90deg, #B8893B, #F4D88A, #E8C26B, #FCEFC4, #E8C26B, #B8893B);
    background-size: 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldShine 10s linear infinite;
}

@keyframes goldShine {
    0% { background-position: 200% center; }
    50% { background-position: 100% center; }
    100% { background-position: -200% center; }
}

.signature {
    display: inline-block;
    margin-top: 4px;
    font-size: .82rem;
    font-weight: 500;
    background: linear-gradient(90deg, #B8893B, #F4D88A, #E8C26B, #FCEFC4, #E8C26B, #B8893B);
    background-size: 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldShine 10s linear infinite;
    letter-spacing: 2px;
}

.links-row {
    width: var(--wrap-w);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: clamp(16px, 3vw, 22px);
    margin-bottom: 6px;
}

.text-link {
    font-size: .80rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    transition: color var(--transition);
}

.text-link:hover {
    text-decoration: underline;
    color: var(--text);
}

.sep { font-size: .9em; opacity: .5; }

/* ===== الإعلان ===== */
.ad-wrap {
    width: 100%;
    margin: 14px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ad-label {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.ad-badge {
    background: var(--surface-alt);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 999px;
    line-height: 1;
    border: 1px solid var(--border);
}

.ad-strip {
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface-alt);
    box-shadow: var(--shadow);
    display: block;
}

.ad-strip a {
    display: block;
    text-decoration: none;
    width: 100%;
    height: 100%;
}

.ad-strip img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ===== مؤثر انفجار المال ===== */
.money {
    position: fixed;
    font-size: 1.6rem;
    pointer-events: none;
    animation: flyMoney 1s ease-out forwards;
    z-index: 9999;
}

@keyframes flyMoney {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) rotate(720deg) scale(0.6); opacity: 0; }
}

/* ==========================================================================
   حاسبة الليرة السورية القديمة/الجديدة (مدموجة من syp-calculator.css)
   ========================================================================== */

.table-wrap.sypcalc {
    margin-bottom: clamp(36px, 6vw, 54px);
    --syp-label-col: 42%;
    --syp-value-col: 58%;
}

.table-wrap.sypcalc .cell.ctrl-cell { padding: 0; }

.table-wrap.sypcalc .table-head,
.table-wrap.sypcalc .table {
    grid-template-columns: var(--syp-label-col) var(--syp-value-col);
}

@media (max-width: 480px) {
    .table-wrap.sypcalc {
        --syp-label-col: 30%;
        --syp-value-col: 70%;
    }

    html[dir="rtl"] .table-wrap.sypcalc select.ctrl {
        padding-right: calc(.55rem + 28px);
        padding-left: calc(.45rem + 16px);
        font-size: .88rem;
    }

    html[dir="ltr"] .table-wrap.sypcalc select.ctrl {
        padding-left: calc(.55rem + 28px);
        padding-right: calc(.45rem + 16px);
        font-size: .88rem;
    }
}

.table-wrap.sypcalc .ctrl {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    padding: .6rem;
    font-family: 'Cairo', sans-serif;
    font-size: .93rem;
    font-weight: 700;
    color: inherit;
    text-align: inherit;
    outline: none;
    margin: 0;
    border-radius: 0;
    line-height: 1.2;
}

.table-wrap.sypcalc .syp-selectwrap {
    position: relative;
    width: 100%;
    height: 100%;
}

.table-wrap.sypcalc .syp-inline-flag {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 16px;
    object-fit: cover;
    pointer-events: none;
}

.table-wrap.sypcalc .syp-inline-flag.flag-old { background: #fff; }

html[dir="rtl"] .table-wrap.sypcalc .syp-inline-flag { right: 10px; }
html[dir="ltr"] .table-wrap.sypcalc .syp-inline-flag { left: 10px; }

.table-wrap.sypcalc select.ctrl {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    background-repeat: no-repeat;
    background-size: 14px 14px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><path fill='%23666' d='M5.7 7.7a1 1 0 0 1 1.4 0L10 10.6l2.9-2.9a1 1 0 1 1 1.4 1.4l-3.6 3.6a1 1 0 0 1-1.4 0L5.7 9.1a1 1 0 0 1 0-1.4z'/></svg>");
}

body.dark-mode .table-wrap.sypcalc select.ctrl {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><path fill='%23ddd' d='M5.7 7.7a1 1 0 0 1 1.4 0L10 10.6l2.9-2.9a1 1 0 1 1 1.4 1.4l-3.6 3.6a1 1 0 0 1-1.4 0L5.7 9.1a1 1 0 0 1 0-1.4z'/></svg>");
}

html[dir="rtl"] .table-wrap.sypcalc select.ctrl {
    background-position: left 10px center;
    padding-right: calc(.6rem + 30px);
    padding-left: calc(.6rem + 22px);
    text-align: right;
}

html[dir="ltr"] .table-wrap.sypcalc select.ctrl {
    background-position: right 10px center;
    padding-left: calc(.6rem + 30px);
    padding-right: calc(.6rem + 22px);
    text-align: left;
}

.table-wrap.sypcalc input.ctrl::placeholder {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-muted);
    font-style: italic;
    opacity: 1;
}

.table-wrap.sypcalc .btn-gold {
    background: linear-gradient(145deg, var(--gold-dark), var(--gold));
    color: var(--on-gold);
    font-weight: 800;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.table-wrap.sypcalc .btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.table-wrap.sypcalc .btn-ghost {
    background: var(--surface-alt);
    color: inherit;
    font-weight: 900;
    cursor: pointer;
    transition: background var(--transition);
}

.table-wrap.sypcalc .btn-ghost:hover { background: var(--gold-soft); }

.table-wrap.sypcalc .price-cell {
    justify-content: center;
    gap: .5rem;
}

.table-wrap.sypcalc .sym {
    position: static;
    right: auto;
}

.table-wrap.sypcalc .cell.full {
    grid-column: 1 / -1;
    border-inline-start: none !important;
    text-align: center;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.6;
}

.syp-only-sale { display: none; }
#sypCalcSection.syp-mode-sale .syp-only-sale { display: block; }
#sypCalcSection.syp-mode-sale .syp-only-convert { display: none; }

/* ===== الأسئلة الشائعة (FAQ) ===== */
.faq {
    width: var(--wrap-w);
    margin: clamp(24px, 5vw, 40px) auto 0;
}
.faq-title {
    text-align: center;
    margin: 0 0 14px;
}
.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color var(--transition);
}
.faq-item[open] { border-color: var(--gold); }
.faq-item summary {
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 700;
    font-size: clamp(.9rem, 3.6vw, 1rem);
    color: var(--text);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    color: var(--gold);
    font-weight: 800;
    font-size: 1.3rem;
    flex: 0 0 auto;
}
.faq-item[open] summary::after { content: '\2212'; }
.faq-a {
    padding: 0 16px 14px;
    color: var(--text-muted);
    font-size: clamp(.85rem, 3.4vw, .95rem);
    line-height: 1.9;
}
