/* ============================================================
   thlelat.css — تحليلاتي / محفوظاتي / الإشعارات
   ============================================================ */

:root {
    --bg-1: #0b0713;
    --bg-2: #150c26;
    --card: rgba(255, 255, 255, 0.045);
    --card-border: rgba(216, 180, 254, 0.18);
    --text: #f3eefc;
    --text-dim: #b9acd1;
    --purple: #a855f7;
    --purple-deep: #7e22ce;
    --purple-soft: #d8b4fe;
    --danger: #fb7185;
    --danger-bg: rgba(251, 113, 133, 0.10);
    --danger-border: rgba(251, 113, 133, 0.35);
    --amber: #fbbf24;
    --amber-bg: rgba(251, 191, 36, 0.09);
    --amber-border: rgba(251, 191, 36, 0.28);
    --radius: 16px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Tajawal', 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(168, 85, 247, 0.18), transparent 60%),
        radial-gradient(700px 400px at 0% 110%, rgba(126, 34, 206, 0.16), transparent 60%),
        linear-gradient(180deg, var(--bg-1), var(--bg-2));
    background-attachment: fixed;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
}

svg {
    display: block;
    flex-shrink: 0;
}

/* ---------- الحاوية والشاشات ---------- */
.thlelat-screen {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(28px + env(safe-area-inset-bottom, 0px));
}

.sub-screen-view {
    display: none;
}

.sub-screen-view.active {
    display: block;
    animation: viewIn 0.28s ease both;
}

@keyframes viewIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- شريط العنوان ---------- */
.view-header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.view-title {
    margin: 0;
    text-align: center;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 800;
    font-size: 1.45rem;
    line-height: 1.3;
    color: var(--text);
}

.header-placeholder {
    width: 44px;
    height: 44px;
}

.btn-nav-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--purple-soft);
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    transition: background 0.2s, transform 0.15s, border-color 0.2s;
}

.btn-nav-icon:hover {
    background: rgba(168, 85, 247, 0.16);
    border-color: rgba(216, 180, 254, 0.4);
}

.btn-nav-icon:active {
    transform: scale(0.92);
}

/* ---------- بطاقة التنبيه ---------- */
.info-alert-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: var(--amber-bg);
    border: 1px solid var(--amber-border);
    border-radius: var(--radius);
}

.alert-icon-wrap {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--amber);
    background: rgba(251, 191, 36, 0.14);
    border-radius: 50%;
    flex-shrink: 0;
}

.alert-text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.7;
    color: #f5e7bf;
}

/* ---------- التبويبات ---------- */
.tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.tab-item {
    flex: 1 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 8px 14px;
    white-space: nowrap;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-dim);
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.tab-item:hover {
    color: var(--text);
    border-color: rgba(216, 180, 254, 0.4);
}

.tab-item.active {
    color: #fff;
    background: linear-gradient(135deg, var(--purple), var(--purple-deep));
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(126, 34, 206, 0.45);
}

.tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---------- الحالة الفارغة ---------- */
.empty-state-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 34px 18px 30px;
    margin-top: 6px;
    background: var(--card);
    border: 1px dashed var(--card-border);
    border-radius: 22px;
}

.empty-icon-glow {
    width: 78px;
    height: 78px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.35), rgba(168, 85, 247, 0.06) 70%);
    box-shadow: 0 0 34px rgba(168, 85, 247, 0.35);
    animation: glow 3.2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 26px rgba(168, 85, 247, 0.30); }
    50%      { box-shadow: 0 0 44px rgba(168, 85, 247, 0.55); }
}

.empty-state-text {
    margin: 0;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
}

.empty-state-desc {
    margin: 0;
    max-width: 30ch;
    font-size: 0.93rem;
    line-height: 1.9;
    color: var(--text-dim);
}

/* ---------- الأزرار ---------- */
.btn-action-purple {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 28px;
    margin-top: 4px;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--purple), var(--purple-deep));
    border: 0;
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(126, 34, 206, 0.5);
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}

.btn-action-purple:hover {
    filter: brightness(1.08);
}

.btn-action-purple:active {
    transform: scale(0.96);
    box-shadow: 0 4px 12px rgba(126, 34, 206, 0.45);
}

.star-spark {
    font-size: 1.05rem;
    line-height: 1;
}

.btn-retry-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    margin: 0 0 16px;
    padding: 10px 18px;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--purple-soft);
    background: transparent;
    border: 1px solid rgba(216, 180, 254, 0.45);
    border-radius: 14px;
    transition: background 0.2s, transform 0.15s;
}

.btn-retry-action:hover {
    background: rgba(168, 85, 247, 0.14);
}

.btn-retry-action:active {
    transform: scale(0.98);
}

/* ---------- بطاقة خطأ الخادم ---------- */
.server-error-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    margin-bottom: 12px;
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius);
}

.error-icon-box {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    background: rgba(251, 113, 133, 0.14);
    border-radius: 50%;
    flex-shrink: 0;
}

.error-msg-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.error-headline {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 800;
    font-size: 0.98rem;
    color: #ffd5db;
}

.error-subtext {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #f3c3ca;
}

/* ---------- شاشات صغيرة جداً ---------- */
@media (max-width: 360px) {
    .thlelat-screen { padding-inline: 12px; }
    .view-title { font-size: 1.25rem; }
    .tab-item { padding: 8px 11px; font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================================
   عنصر مخفي (مثل شارة "حساب المالك" لغير الأدمن)
   ============================================================ */
[hidden] {
    display: none !important;
}

/* ============================================================
   الإشعارات — رسالة واحدة فقط
   ============================================================ */
.notice-only-box {
    padding: 28px 18px;
    text-align: center;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 20px;
}

.notice-only-text {
    margin: 0;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text);
}

/* ============================================================
   حسابي
   ============================================================ */
#viewAccount {
    --gold: #e8c26a;
    --gold-soft: #f6dc9b;
    --gold-line: rgba(232, 194, 106, 0.55);
}

.account-frame {
    position: relative;
    padding: 18px 14px 16px;
    border-radius: 26px;
    background:
        radial-gradient(420px 220px at 90% 0%, rgba(168, 85, 247, 0.16), transparent 70%),
        linear-gradient(165deg, rgba(20, 16, 46, 0.94), rgba(8, 7, 20, 0.97));
    border: 1px solid var(--gold-line);
    box-shadow:
        0 0 0 1px rgba(232, 194, 106, 0.10) inset,
        0 18px 50px rgba(0, 0, 0, 0.55),
        0 0 40px rgba(126, 34, 206, 0.18);
}

.account-frame .corner {
    position: absolute;
    width: 26px;
    height: 26px;
    border: 2px solid var(--gold);
    opacity: 0.9;
    pointer-events: none;
}
.corner.tr { top: 7px;    right: 7px; border-left: 0;  border-bottom: 0; border-top-right-radius: 16px; }
.corner.tl { top: 7px;    left: 7px;  border-right: 0; border-bottom: 0; border-top-left-radius: 16px; }
.corner.br { bottom: 7px; right: 7px; border-left: 0;  border-top: 0;    border-bottom-right-radius: 16px; }
.corner.bl { bottom: 7px; left: 7px;  border-right: 0; border-top: 0;    border-bottom-left-radius: 16px; }

/* الشريط العلوي */
.account-header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: start;
    gap: 8px;
    margin: 4px 6px 16px;
}

.btn-account-back {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--gold-soft);
    background: radial-gradient(circle, rgba(232, 194, 106, 0.14), rgba(0, 0, 0, 0.25));
    border: 1px solid var(--gold-line);
    border-radius: 50%;
    transition: transform 0.15s, box-shadow 0.2s;
}
.btn-account-back:hover { box-shadow: 0 0 14px rgba(232, 194, 106, 0.4); }
.btn-account-back:active { transform: scale(0.92); }

.account-title-wrap {
    text-align: center;
    padding-top: 2px;
}

.account-title {
    margin: 0;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    line-height: 1.3;
    color: var(--gold);
    text-shadow: 0 0 18px rgba(232, 194, 106, 0.35);
}

.account-title-wrap::after {
    content: '✦';
    display: block;
    position: relative;
    margin-top: 2px;
    font-size: 0.7rem;
    line-height: 1;
    color: var(--gold);
    background:
        linear-gradient(90deg, transparent, var(--gold-line) 30%, var(--gold-line) 42%, transparent 42%) left center / 50% 1px no-repeat,
        linear-gradient(270deg, transparent, var(--gold-line) 30%, var(--gold-line) 42%, transparent 42%) right center / 50% 1px no-repeat;
}

/* بطاقة الملف الشخصي */
.profile-card {
    padding: 16px 14px 14px;
    margin-bottom: 14px;
    background: linear-gradient(160deg, rgba(40, 38, 96, 0.45), rgba(10, 9, 26, 0.5));
    border: 1px solid rgba(232, 194, 106, 0.30);
    border-radius: 22px;
}

.profile-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-ring {
    position: relative;
    flex-shrink: 0;
    padding: 5px;
    border-radius: 50%;
    border: 1px solid rgba(232, 194, 106, 0.35);
    box-shadow: 0 0 22px rgba(232, 194, 106, 0.18);
}

.avatar {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    border: 2.5px solid var(--gold);
    background: radial-gradient(circle at 35% 30%, #1c1838, #07060f 75%);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.5) inset;
}

.avatar span {
    font-family: Georgia, 'Cairo', serif;
    font-weight: 700;
    font-size: 2.3rem;
    line-height: 1;
    color: var(--gold);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sparkle {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    line-height: 1;
    color: var(--gold);
    text-shadow: 0 0 8px rgba(232, 194, 106, 0.8);
}
.avatar-sparkle.s1 { top: -9px; }
.avatar-sparkle.s2 { bottom: -9px; }

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    margin: 0 0 4px;
    font-family: Georgia, 'Cairo', serif;
    font-weight: 700;
    font-size: 1.55rem;
    line-height: 1.3;
    color: #f4efe3;
    overflow-wrap: anywhere;
}

.profile-email {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #a8b1d6;
}

.profile-email svg {
    color: #8e9ac4;
}

.profile-email svg {
    width: 18px;
    height: 18px;
}

.profile-email span {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.profile-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
}

.badge-google,
.badge-owner {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-width: 100%;
    padding: 7px 14px;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.4;
    border-radius: 999px;
}

.badge-google {
    color: #d7fff6;
    background: rgba(45, 212, 191, 0.08);
    border: 1px solid rgba(45, 212, 191, 0.65);
    box-shadow: 0 0 14px rgba(45, 212, 191, 0.18);
}

.badge-check {
    color: #2dd4bf;
}

.badge-owner {
    color: var(--gold-soft);
    background: rgba(232, 194, 106, 0.08);
    border: 1px solid var(--gold-line);
    box-shadow: 0 0 14px rgba(232, 194, 106, 0.15);
}

/* لوحة الرصيد */
.balance-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    margin-bottom: 14px;
    background: linear-gradient(160deg, rgba(46, 40, 120, 0.35), rgba(10, 9, 28, 0.55));
    border: 1px solid rgba(139, 120, 255, 0.45);
    border-radius: 20px;
    box-shadow: 0 0 24px rgba(99, 70, 255, 0.15) inset;
}

.balance-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
}

.balance-label {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--gold-soft);
}

.balance-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 6px;
    border-top: 1px solid rgba(232, 194, 106, 0.18);
}

.coin-icon {
    filter: drop-shadow(0 0 8px rgba(242, 193, 78, 0.55));
}

.balance-amount {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 900;
    font-size: 2.1rem;
    line-height: 1.2;
    letter-spacing: 0.5px;
    color: #f8d775;
    text-shadow: 0 0 16px rgba(242, 193, 78, 0.35);
}

.btn-charge {
    flex: 1 1 150px;
    max-width: 240px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 54px;
    padding: 8px 10px 8px 14px;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #5b21b6);
    border: 1px solid rgba(196, 168, 255, 0.7);
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(109, 40, 217, 0.5), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
    transition: transform 0.15s, filter 0.2s;
}
.btn-charge:hover { filter: brightness(1.1); }
.btn-charge:active { transform: scale(0.96); }

.charge-arrow {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #c4b5fd;
    background: rgba(20, 10, 60, 0.55);
    border: 1px solid rgba(196, 168, 255, 0.35);
    border-radius: 50%;
}

/* تسجيل الخروج */
.btn-logout {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 10px 18px;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--gold-soft);
    background: rgba(232, 194, 106, 0.04);
    border: 1px solid var(--gold-line);
    border-radius: 999px;
    transition: background 0.2s, transform 0.15s;
}
.btn-logout::before,
.btn-logout::after {
    content: '✦';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: var(--gold);
    opacity: 0.8;
}
.btn-logout::before { right: 16px; }
.btn-logout::after  { left: 16px; }
.btn-logout:hover { background: rgba(232, 194, 106, 0.10); }
.btn-logout:active { transform: scale(0.98); }

@media (max-width: 360px) {
    .profile-name { font-size: 1.35rem; }
    .avatar { width: 64px; height: 64px; }
    .balance-amount { font-size: 1.8rem; }
}
