/* =============================================================================
   Welcome Overlay Builder — Panel RTL + Arabic + Visual Polish
   =============================================================================
   Goals:
   - Force a bright, airy light background (kills the "black page" effect).
   - Give sections/cards soft shadows + clear separation so the operator can
     tell blocks apart at a glance.
   - Load Cairo for Arabic + keep Latin readable.
   - Flip layout to RTL with sensible control alignments.
   ============================================================================= */

/* Cairo webfont (Google Fonts, SIL Open Font License). */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap');

/* ------------------------------------------------------------------ Font */
:root {
    --font-sans: 'Cairo', 'Inter', ui-sans-serif, system-ui, -apple-system,
                 'Segoe UI', Tahoma, 'Arial', sans-serif;
}

html, body, .fi, .fi-body {
    font-family: var(--font-sans) !important;
}

/* ----------------------------------------------------------- Background */
/* Override Filament's dark color-scheme with a soft, light gradient that
   makes the panel feel modern instead of a flat black sheet. */
html {
    color-scheme: light !important;
    background: #f4f6fb !important;
}

.fi-body,
body.fi-panel-admin,
body[class*="fi-"] {
    background:
        radial-gradient(1200px 600px at 100% -10%, #eef2ff 0%, rgba(238, 242, 255, 0) 60%),
        radial-gradient(900px 500px at -10% 110%, #e0f2fe 0%, rgba(224, 242, 254, 0) 55%),
        #f4f6fb !important;
    min-height: 100vh;
}

/* --------------------------------------------------------------- Cards */
/* Give every section/card a white surface + a soft shadow + rounded corners
   so the operator clearly sees each block. */
.fi-section,
.fi-card,
.fi-main-h > div,
.fi-main > section,
[class*="fi-section"],
[class*="fi-card"] {
    background-color: #ffffff !important;
    border: 1px solid #eef0f5 !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px -8px rgba(30, 41, 59, 0.10),
                0 1px 2px  rgba(30, 41, 59, 0.04) !important;
    margin-bottom: 1rem;
}

/* Section headers — clearer, bolder Arabic labels. */
.fi-section-header,
.fi-section > header,
[class*="fi-section"] > header,
[class*="fi-section"] > div:first-child {
    border-bottom: 1px solid #f1f3f9 !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 0.5rem !important;
}

.fi-section-heading,
.fi-section > header h2,
[class*="fi-section"] h2 {
    font-weight: 700 !important;
    color: #0f172a !important;
    font-size: 1.05rem !important;
}

/* ------------------------------------------------------------- Sidebar */
.fi-sidebar,
[class*="fi-sidebar"] {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%) !important;
    border-inline-end: 1px solid #e9edf5 !important;
    box-shadow: 0 0 30px -10px rgba(30, 41, 59, 0.08) !important;
}

/* Sidebar nav items — clearer hover/active states. */
.fi-sidebar-nav-item,
[class*="fi-sidebar-item"] {
    border-radius: 10px !important;
    margin: 2px 8px !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
}

.fi-sidebar-nav-item:hover,
[class*="fi-sidebar-item"]:hover {
    background-color: #eef2ff !important;
}

/* --------------------------------------------------------------- Tabs */
/* Make the project tabs visually distinct instead of running together. */
.fi-tabs,
[class*="fi-tabs"] {
    background: #ffffff !important;
    border-radius: 12px !important;
    padding: 6px !important;
    border: 1px solid #eef0f5 !important;
    box-shadow: 0 1px 3px rgba(30, 41, 59, 0.05) !important;
    margin-bottom: 1rem;
}

.fi-tab,
[class*="fi-tab "] {
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    transition: all 0.15s ease !important;
}

.fi-tab-active,
[class*="fi-tab-active"],
[class*="fi-tab "][aria-selected="true"] {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.30) !important;
}

/* ------------------------------------------------------------ Buttons */
.fi-btn,
[class*="fi-btn"] {
    border-radius: 10px !important;
    font-weight: 600 !important;
    transition: transform 0.12s ease, box-shadow 0.12s ease !important;
}

.fi-btn-primary,
[class*="fi-btn-primary"],
[class*="fi-btn"][class*="primary"] {
    box-shadow: 0 4px 14px -4px rgba(79, 70, 229, 0.40) !important;
}

/* -------------------------------------------------------------- Inputs */
.fi-input,
.fi-select,
.fi-textarea,
[class*="fi-input"],
[class*="fi-select"],
[class*="fi-textarea"] {
    border-radius: 10px !important;
    border-color: #e2e8f0 !important;
    background-color: #ffffff !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.fi-input:focus,
.fi-select:focus,
.fi-textarea:focus,
[class*="fi-input"]:focus,
[class*="fi-select"]:focus,
[class*="fi-textarea"]:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

/* -------------------------------------------------------------- Tables */
.fi-ta,
[class*="fi-table"] {
    background: #ffffff !important;
    border-radius: 12px !important;
    overflow: hidden;
    border: 1px solid #eef0f5 !important;
}

.fi-ta-th,
.fi-ta-td,
[class*="fi-ta-th"],
[class*="fi-ta-td"] {
    border-color: #f1f3f9 !important;
    padding: 12px 16px !important;
}

.fi-ta-th,
[class*="fi-ta-th"] {
    background-color: #f8fafc !important;
    font-weight: 700 !important;
    color: #334155 !important;
}

/* Hover row highlight for better readability. */
.fi-ta-tr:hover,
[class*="fi-ta-tr"]:hover {
    background-color: #f8fafc !important;
}

/* -------------------------------------------------------------- Badges */
.fi-badge,
[class*="fi-badge"] {
    border-radius: 999px !important;
    font-weight: 600 !important;
    padding: 3px 10px !important;
}

/* ----------------------------------------------------------- Stat cards */
.fi-stats-overview,
[class*="fi-stats"],
[class*="fi-stat"] {
    border-radius: 16px !important;
}

/* ----------------------------------------------------------- RTL layout */
html[lang="ar"], html[lang="ar"] body {
    direction: rtl;
}

/* Sidebar flips to the right in RTL. */
html[lang="ar"] .fi-sidebar,
html[lang="ar"] [class*="fi-sidebar"] {
    inset-inline-start: auto;
    inset-inline-end: 0;
}

/* Text inputs flip naturally; keep numbers / emails LTR. */
html[lang="ar"] .fi-input[type="email"],
html[lang="ar"] .fi-input[type="url"],
html[lang="ar"] .fi-input[type="number"],
html[lang="ar"] [class*="fi-ta-col-numeric"] {
    direction: ltr;
    text-align: right;
}

/* Code blocks (stack traces) MUST stay LTR. */
html[lang="ar"] pre,
html[lang="ar"] code {
    direction: ltr !important;
    text-align: left !important;
}

/* ------------------------------------------------------------ Headings */
h1, h2, h3, h4 {
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em;
}

/* Brand text in the sidebar header. */
.fi-brand,
[class*="fi-brand"] {
    font-weight: 800 !important;
    color: #4f46e5 !important;
}

/* Soften the top bar. */
.fi-topbar,
[class*="fi-topbar"] {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #eef0f5 !important;
}

/* Make form labels + helper text slightly darker for readability. */
.fi-form > label,
.fi-field-label,
[class*="fi-field-label"],
[class*="fi-helper-text"] {
    color: #475569 !important;
    font-weight: 600 !important;
}
