/**
 * ACCMAA — ثيم المنصة الكامل
 * خلفيات محاسبية · فراغات ممتلئة · تناسق ألوان · وضوح قراءة
 */

:root {
    --accmaa-site-bg: url('../images/visual-library/backgrounds/water-theme-light.svg'), url('../images/visual-library/backgrounds/site-platform-bg.svg');
    --accmaa-text-primary: #152a3d;
    --accmaa-text-secondary: #4a5f73;
    --accmaa-text-on-dark: #f8fafc;
    --accmaa-link: #0A3669;
    --accmaa-link-hover: #0d4a8a;
    --accmaa-panel-bg: rgba(255, 255, 255, 0.94);
    --accmaa-panel-border: rgba(10, 54, 105, 0.1);
    --accmaa-dash-gap: clamp(20px, 3vw, 36px);
    --accmaa-zone-max: 1320px;
}

/* ─── خلفية الموقع بالكامل ─── */
body.premium-ui {
    background-color: var(--accmaa-surface-2, #f4f7fb);
    background-image: var(--accmaa-site-bg), var(--dash-bg-image, none);
    background-size: cover, auto;
    background-position: center top, center;
    background-attachment: scroll, scroll;
    color: var(--accmaa-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body.premium-ui .main-wrap {
    background: transparent;
    min-height: calc(100dvh - var(--topbar-h, 72px));
}

body.premium-ui.member-mode .main-wrap,
body.premium-ui.admin-mode .main-wrap,
body.premium-ui.guest-mode.guest-in-app .main-wrap {
    background: linear-gradient(180deg,
        rgba(244, 247, 251, 0.35) 0%,
        rgba(244, 247, 251, 0.72) 100%);
}

body.premium-ui.guest-mode:not(.guest-in-app) .main-wrap {
    background: var(--accmaa-site-bg) center top / cover no-repeat scroll;
}

/* ─── المحتوى الداخلي — بطاقات واضحة بدون فراغات ─── */
body.premium-ui .main-inner {
    position: relative;
    z-index: 1;
}

body.premium-ui .main-inner:not(.tafqeet-page):not(:has(.dash-landing)) {
    background: var(--accmaa-panel-bg);
    border: 1px solid var(--accmaa-panel-border);
    border-radius: var(--accmaa-radius-lg, 22px);
    box-shadow: var(--accmaa-shadow-md, 0 8px 28px rgba(10, 54, 105, 0.08));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin: 16px;
    padding: clamp(20px, 3vw, 32px) !important;
}

body.premium-ui.guest-mode .main-inner:has(.dash-landing) {
    background: transparent;
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 0 !important;
}

/* ─── عناوين ونصوص — تباين عالٍ ─── */
body.premium-ui .page-title,
body.premium-ui h1,
body.premium-ui h2,
body.premium-ui h3 {
    color: var(--accmaa-text-primary);
    letter-spacing: -0.01em;
}

body.premium-ui .page-desc,
body.premium-ui .page-desc-inline,
body.premium-ui p {
    color: var(--accmaa-text-secondary);
    line-height: 1.75;
}

body.premium-ui a:not(.btn):not([class*="btn"]) {
    color: var(--accmaa-link);
}
body.premium-ui a:not(.btn):hover {
    color: var(--accmaa-link-hover);
}

/* ─── نصوص على خلفيات داكنة — ذهبي واضح ─── */
body.premium-ui .cta-premium,
body.premium-ui .cta-strip,
body.premium-ui .hero-premium-content,
body.premium-ui .command-header,
body.premium-ui .site-footer-global {
    color: #f5e6b8;
}

body.premium-ui .cta-premium h3,
body.premium-ui .cta-strip h3,
body.premium-ui .hero-premium-content h1,
body.premium-ui .hero-premium-content .hero-line-accent {
    color: #D4AF37 !important;
    -webkit-text-fill-color: #D4AF37 !important;
    background: none !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

body.premium-ui .cta-premium p,
body.premium-ui .cta-strip p,
body.premium-ui .hero-premium-sub {
    color: #faf3dc !important;
    -webkit-text-fill-color: #faf3dc !important;
    opacity: 1 !important;
}

body.premium-ui .cta-premium-eyebrow,
body.premium-ui .hero-premium-badge {
    color: #D4AF37 !important;
    -webkit-text-fill-color: #D4AF37 !important;
}

body.premium-ui .hero-premium-content .btn-ghost-premium {
    color: #D4AF37 !important;
    border-color: rgba(212, 175, 55, 0.65) !important;
}

/* ─── لوحات ومحتوى ─── */
body.premium-ui .panel,
body.premium-ui .content-panel,
body.premium-ui .panel-premium,
body.premium-ui .gov-table-wrap {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--accmaa-panel-border);
    border-radius: var(--accmaa-radius-md, 16px);
    box-shadow: var(--accmaa-shadow-sm);
}

body.premium-ui .section-block {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(10, 54, 105, 0.06);
    border-radius: var(--accmaa-radius-lg, 22px);
    backdrop-filter: blur(6px);
}

/* ─── حالات فارغة — موحّدة وجذابة ─── */
.empty-state,
.spotlight-empty:not(.spotlight-empty--themed),
.search-empty,
.notif-empty,
.curriculum-empty,
.content-panel.empty-state {
    text-align: center;
    padding: clamp(32px, 5vw, 56px) clamp(20px, 4vw, 40px);
    color: var(--accmaa-text-secondary);
    line-height: 1.7;
    border-radius: var(--accmaa-radius-md, 16px);
    background: linear-gradient(145deg,
        rgba(255, 255, 255, 0.96) 0%,
        rgba(250, 243, 220, 0.35) 100%);
    border: 1px dashed rgba(212, 175, 55, 0.35);
    margin: 12px 0;
}

.empty-hint {
    color: var(--accmaa-text-secondary);
    font-size: 0.92rem;
    font-weight: 600;
    padding: 16px 12px;
    text-align: center;
    line-height: 1.65;
}

.empty-state::before,
.empty-hint:empty + .empty-state-icon {
    display: none;
}

.empty-state i,
.empty-hint i,
.spotlight-empty i {
    font-size: clamp(2rem, 5vw, 2.75rem) !important;
    color: var(--accmaa-gold, #D4AF37) !important;
    margin-bottom: 14px !important;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.25));
}

.empty-state p,
.empty-hint,
.spotlight-empty p {
    max-width: 420px;
    margin: 0 auto;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accmaa-text-secondary);
}

.spotlight-empty--themed {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    border-radius: var(--accmaa-radius-md, 16px);
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(10, 54, 105, 0.1);
    transition: transform 0.22s, box-shadow 0.22s;
}

.spotlight-empty--themed:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(10, 54, 105, 0.14);
}

.spotlight-themed-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(16px, 4vw, 28px);
    min-height: 180px;
    padding: 28px 20px;
    background:
        linear-gradient(135deg, rgba(6, 31, 61, 0.94) 0%, rgba(10, 54, 105, 0.88) 55%, rgba(13, 74, 138, 0.82) 100%),
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.18), transparent 55%),
        radial-gradient(circle at 80% 70%, rgba(212, 175, 55, 0.12), transparent 50%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}

.spotlight-themed-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(52px, 12vw, 72px);
    height: clamp(52px, 12vw, 72px);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(212, 175, 55, 0.45);
    color: #D4AF37;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.spotlight-themed-cta,
.spotlight-empty--themed span.spotlight-themed-cta {
    display: block;
    padding: 14px 16px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0A3669 !important;
    background: rgba(255, 255, 255, 0.96);
}

.content-panel.empty-state {
    padding: clamp(36px, 6vw, 64px) 24px;
}

/* ─── الداشبورد — مناطق منظمة ─── */
.dash-landing {
    gap: var(--accmaa-dash-gap);
}

.dash-zone {
    max-width: var(--accmaa-zone-max);
    margin-inline: auto;
}

.dash-zone + .dash-zone {
    margin-top: var(--accmaa-dash-gap);
}

body.premium-ui .kpi-card,
body.premium-ui .member-stat-premium,
body.premium-ui .stat-box {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(10, 54, 105, 0.08);
    box-shadow: 0 6px 20px rgba(10, 54, 105, 0.06);
}

body.premium-ui .kpi-card strong,
body.premium-ui .member-stat-premium strong,
body.premium-ui .stat-box strong {
    color: var(--accmaa-navy-mid, #0A3669);
}

body.premium-ui .kpi-card .label,
body.premium-ui .member-stat-premium span,
body.premium-ui .stat-box span {
    color: var(--accmaa-text-secondary);
}

/* ─── بطاقات المحاور والاختيارات ─── */
body.premium-ui .pillar-card,
body.premium-ui .power-card,
body.premium-ui .choice-visual-tile,
body.premium-ui .portal-action-card,
body.premium-ui .gift-card,
body.premium-ui .doctor-card,
body.premium-ui .path-card,
body.premium-ui .course-card {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(10, 54, 105, 0.1);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

body.premium-ui .pillar-card:hover,
body.premium-ui .power-card:hover,
body.premium-ui .choice-visual-tile:hover,
body.premium-ui .doctor-card:hover {
    border-color: rgba(212, 175, 55, 0.45);
    box-shadow: 0 14px 40px rgba(10, 54, 105, 0.1);
    transform: translateY(-3px);
}

/* ─── الشريط الجانبي — خلفية محاسبية ─── */
body.premium-ui .sidebar .sections-panel.has-card-bg::after {
    background: linear-gradient(180deg,
        rgba(6, 31, 61, 0.72) 0%,
        rgba(10, 54, 105, 0.85) 100%);
}

body.premium-ui .sidebar .section-item,
body.premium-ui .sidebar .sections-zone-head {
    color: var(--accmaa-text-on-dark);
}

/* ─── أيقونات — وضوح بدون تبكسل ─── */
body.premium-ui .has-icon-bg,
body.premium-ui .accmaa-icon-shell {
    background: linear-gradient(145deg, #061f3d 0%, #0A3669 48%, #0a2f5c 100%);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow:
        0 4px 16px rgba(6, 31, 61, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

body.premium-ui .has-icon-bg > i {
    color: #e8c547 !important;
    font-weight: 900;
}

body.premium-ui .sidebar .icon-btn.has-icon-bg {
    border-radius: 10px;
}

/* ─── أزرار — وضوح ومساحة لمس ─── */
body.premium-ui .btn {
    font-weight: 700;
    letter-spacing: 0.01em;
    min-height: 42px;
}

body.premium-ui .btn-gold {
    background: linear-gradient(135deg, #c9a227 0%, #D4AF37 50%, #e8c547 100%);
    color: #061f3d;
    border: 1px solid rgba(255, 255, 255, 0.25);
    text-shadow: none;
}

body.premium-ui .btn-outline {
    border-color: rgba(10, 54, 105, 0.2);
    color: var(--accmaa-navy-mid);
}

body.premium-ui .btn-outline:hover {
    background: var(--accmaa-gold-light);
    border-color: var(--accmaa-gold);
}

/* ─── جداول ─── */
body.premium-ui .gov-table th {
    background: linear-gradient(180deg, #0A3669, #0d4a8a);
    color: #fff;
    font-weight: 700;
}

body.premium-ui .gov-table td {
    color: var(--accmaa-text-primary);
    border-color: rgba(10, 54, 105, 0.08);
}

body.premium-ui .gov-table tr:nth-child(even) td {
    background: rgba(244, 247, 251, 0.6);
}

/* ─── Hero & stats ─── */
body.premium-ui .hero-stats,
body.premium-ui .hero-stats-premium,
body.premium-ui .landing-stats-bar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* ─── تحسين perf-lite ─── */
body.perf-lite.premium-ui .main-wrap {
    background-attachment: scroll;
}

body.perf-lite .hero-orbit-wrap::before,
body.perf-lite .hero-glowPulse {
    animation: none !important;
}

/* ─── موبايل ─── */
@media (max-width: 900px) {
    body.premium-ui .main-inner:not(.tafqeet-page):not(:has(.dash-landing)) {
        margin: 10px;
        padding: 18px !important;
        border-radius: 16px;
    }

    .empty-state,
    .empty-hint,
    .spotlight-empty:not(.spotlight-empty--themed) {
        padding: 28px 16px;
    }
}

/* ─── خلفية مائية متحركة ─── */
body.premium-ui::before {
    content: '';
    position: fixed;
    inset: -10% -5%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 55% 45% at 15% 20%, rgba(13, 74, 138, 0.09) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 85% 75%, rgba(212, 175, 55, 0.11) 0%, transparent 50%),
        radial-gradient(ellipse 40% 35% at 50% 50%, rgba(10, 54, 105, 0.04) 0%, transparent 60%);
    animation: accmaaWaterDrift 22s ease-in-out infinite alternate;
}

@keyframes accmaaWaterDrift {
    0% { transform: translate(0, 0) scale(1); opacity: 0.75; }
    50% { transform: translate(-1.5%, 1%) scale(1.02); opacity: 0.95; }
    100% { transform: translate(1%, -0.5%) scale(1.04); opacity: 0.85; }
}

body.perf-lite.premium-ui::before {
    animation: none;
    opacity: 0.65;
}

body.premium-ui .topbar-premium,
body.premium-ui .main-wrap,
body.premium-ui .accmaa-social-bar {
    position: relative;
    z-index: 1;
}

/* ─── نصوص قائمة الهيدر — وضوح على الديسكتوب ─── */
body.guest-mode .mega-flat-link--clean,
body.guest-mode .mega-flat-link--clean span,
body.marketing-header .mega-flat-link--clean,
body.marketing-header .mega-flat-link--clean span,
body.premium-ui .mega-trigger .mega-trigger-label,
body.premium-ui .mega-flat-link > span {
    color: var(--primary, #0A3669) !important;
    -webkit-text-fill-color: currentColor !important;
    opacity: 1 !important;
    visibility: visible !important;
}
