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

body {
    font-family: 'Cairo', sans-serif;
    background-color: #0f172a;
    color: #f8fafc;
}

.glass-card {
    background: rgba(30, 41, 59, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-4px);
    border-color: #10b981;
}

/* قائمة التنقل */
.nav-link {
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #cbd5e1;
    transition: all 0.2s ease;
}
.nav-link:hover { color: #34d399; background: rgba(16, 185, 129, 0.08); }
.nav-link.active { color: #020617; background: #34d399; }

.chip {
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
}
.chip.active { background: #10b981; color: #020617; border-color: #10b981; }

/* ===== المحفظة ===== */
.wallet-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #064e3b 0%, #0f172a 55%, #022c22 100%);
    border: 1px solid rgba(52, 211, 153, 0.35);
    box-shadow: 0 20px 50px -15px rgba(16, 185, 129, 0.35);
}
.wallet-card::before {
    content: "";
    position: absolute;
    top: -70px;
    left: -70px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.25), transparent 70%);
}
.wallet-card::after {
    content: "";
    position: absolute;
    bottom: -90px;
    right: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.12), transparent 70%);
}
.wallet-chip {
    width: 44px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.12);
}
.wallet-balance {
    font-size: 3.5rem;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 1px;
    color: #ecfdf5;
    text-shadow: 0 4px 24px rgba(52, 211, 153, 0.45);
}
@media (min-width: 768px) {
    .wallet-balance { font-size: 4.75rem; }
}
.wallet-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.65);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #fff;
    font-weight: 800;
    font-size: 1.6rem;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}
.wallet-input::placeholder { font-size: 1.1rem; font-weight: 600; color: #64748b; }
.wallet-input:focus { border-color: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15); }
.wallet-input::-webkit-outer-spin-button,
.wallet-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ===== المستشار التفاعلي ===== */
.advisor {
    position: relative;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.advisor-photo-wrap {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto;
    border-radius: 50%;
    border: 3px solid #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
    animation: pulseRing 2.4s infinite;
    transition: transform 0.25s ease;
}

.advisor-sm .advisor-photo-wrap { width: 84px; height: 84px; border-width: 2px; }
.advisor-sm .advisor-fallback { font-size: 36px; }
.advisor-sm .advisor-speech { font-size: 10px; top: -30px; padding: 4px 10px; }
.advisor-sm .react-emoji { font-size: 28px; top: -10px; right: -8px; }

.advisor:hover .advisor-photo-wrap,
.advisor:active .advisor-photo-wrap {
    transform: scale(1.1) rotate(-4deg);
}

.advisor-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
}

.advisor-fallback {
    display: none;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    background: #0f172a;
}

.advisor.wiggle .advisor-photo-wrap { animation: wiggle 0.6s ease; }

@keyframes wiggle {
    0%, 100% { transform: rotate(0) scale(1); }
    20% { transform: rotate(-10deg) scale(1.12); }
    40% { transform: rotate(10deg) scale(1.12); }
    60% { transform: rotate(-6deg) scale(1.08); }
    80% { transform: rotate(6deg) scale(1.08); }
}

@keyframes pulseRing {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
    70% { box-shadow: 0 0 0 16px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* فقاعة الكلام */
.advisor-speech {
    position: absolute;
    top: -34px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: #10b981;
    color: #022c22;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 14px;
    z-index: 5;
}

/* الإيموجي اللي بيظهر */
.react-emoji {
    position: absolute;
    top: -6px;
    right: -10px;
    font-size: 40px;
    line-height: 1;
    opacity: 0;
    transform: scale(0) rotate(-30deg);
    pointer-events: none;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    transition: opacity 0.2s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.react-emoji.show {
    opacity: 1;
    transform: scale(1) rotate(0);
}

/* ===== جدول العملات ===== */
#fxBody tr { border-bottom: 1px solid rgba(51, 65, 85, 0.5); transition: background 0.2s; }
#fxBody tr:hover { background: rgba(16, 185, 129, 0.06); }
#fxBody td { padding: 10px 4px; text-align: center; }
#fxBody td:first-child { text-align: right; }

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    animation: livePulse 1.4s infinite;
}
@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.flash-up { animation: flashUp 0.9s ease; }
.flash-down { animation: flashDown 0.9s ease; }
@keyframes flashUp { from { background: rgba(16, 185, 129, 0.35); } to { background: transparent; } }
@keyframes flashDown { from { background: rgba(239, 68, 68, 0.35); } to { background: transparent; } }

/* ===== دايرة الأسهم ===== */
.donut-wrap { position: relative; width: 140px; height: 140px; flex-shrink: 0; }
.donut-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-svg circle { transition: stroke-width 0.25s ease, opacity 0.25s ease; cursor: pointer; }
.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.stock-row { cursor: pointer; padding: 6px 8px; border-radius: 12px; transition: background 0.2s; }
.stock-row:hover, .stock-row.active { background: rgba(255, 255, 255, 0.06); }
.stock-bar { height: 4px; border-radius: 4px; background: rgba(148, 163, 184, 0.2); overflow: hidden; margin-top: 4px; }
.stock-bar > span { display: block; height: 100%; border-radius: 4px; }

/* أنيميشن الصفحات */
.page { animation: fadeIn 0.3s ease-out; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.feat-card {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    padding: 22px;
    min-height: 210px;
    color: #f1f5f9;
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
    box-shadow: 0 12px 30px -12px rgba(2, 6, 23, 0.8);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
    overflow: hidden;
}
.feat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 12%; right: 12%;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, var(--feat-accent, #34d399), transparent);
}
.feat-card:hover {
    transform: translateY(-4px);
    border-color: var(--feat-accent, #34d399);
    box-shadow: 0 18px 40px -14px rgba(16, 185, 129, 0.35);
}
.feat-pink  { --feat-accent: #f472b6; }
.feat-green { --feat-accent: #34d399; }
.feat-lilac { --feat-accent: #a78bfa; }

/* ===== هيرو الصفحة الرئيسية ===== */
.hero { position: relative; overflow: hidden; }
.hero-glow {
    position: absolute;
    top: -140px; left: 50%;
    transform: translateX(-50%);
    width: 640px; height: 420px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(52, 211, 153, 0.18), transparent 65%);
    pointer-events: none;
}

.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 24px; }
@media (max-width: 767px) { .feat-grid { grid-template-columns: 1fr; } }
.feat-title { font-size: 1.5rem; font-weight: 900; line-height: 1.3; padding-left: 62px; }
.feat-emoji { position: absolute; bottom: 14px; left: 18px; font-size: 5rem; line-height: 1; filter: drop-shadow(4px 4px 0 rgba(0,0,0,.18)); transition: transform .25s ease; }
.feat-card:hover .feat-emoji { transform: rotate(-8deg) scale(1.08); }

.feat-plus {
    position: absolute; top: 16px; left: 16px;
    width: 46px; height: 46px; border-radius: 50%;
    background: #10b981; color: #022c22; font-size: 28px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: 0; transition: transform .3s ease;
}
.feat-card.open .feat-plus { transform: rotate(45deg); }
.feat-desc { max-height: 0; opacity: 0; overflow: hidden; font-weight: 600; font-size: .9rem; color: #cbd5e1; margin-top: 0; transition: max-height .35s ease, opacity .3s ease, margin .3s ease; }
.feat-card.open .feat-desc { max-height: 120px; opacity: 1; margin-top: 10px; }

/* مربعات السوشيال */
.social-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    background: rgba(30, 41, 59, .75);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 22px;
    padding: 26px 16px;
    text-align: center;
    transition: transform .2s ease, border-color .2s ease;
    text-decoration: none;
}
.social-card:hover { transform: translateY(-4px); border-color: #34d399; }
.social-card svg { width: 64px; height: 64px; }
.social-name { font-weight: 800; font-size: 1rem; color: #fff; }
.social-link { font-size: .75rem; color: #34d399; direction: ltr; word-break: break-all; }
.social-card:hover .social-link { text-decoration: underline; }
