/* ============================================================================
 * Studio OS — MudBlazor 8.5 Override
 * Linear issue: TECH-5495 (F9.1)
 *
 * Bu dosya MudBlazor varsayilan paletini ve bilesen siniflarini Studio OS
 * tokenlarina baglar. console-tokens.css'ten SONRA, MudBlazor.min.css'ten
 * SONRA, scoped CSS'ten SONRA yuklenir (cascade order onemli).
 *
 * Kurallar:
 *   - PaletteLight (AdminTheme.cs) hex sabitleriyle eslesir; iki taraf da
 *     ayni Studio OS hex'lerini referans alir.
 *   - Dark mode admin icin KAPALI (issue spec'i).
 *   - Material Icon korunur; Lucide migration ayri issue.
 * ========================================================================== */

/* ---------------------------------------------------------------------------
 * 1) MudBlazor CSS palette degiskenleri → Studio OS
 * --------------------------------------------------------------------------- */
:root {
    /* Core palette */
    --mud-palette-primary: #0B0B0F;                          /* ink */
    --mud-palette-primary-text: #FAF8F2;                     /* cream-soft on ink */
    --mud-palette-primary-darken: rgba(11, 11, 15, 0.92);
    --mud-palette-primary-lighten: rgba(11, 11, 15, 0.78);
    --mud-palette-primary-hover: rgba(11, 11, 15, 0.06);

    --mud-palette-secondary: #2E5BFF;                        /* p-muh */
    --mud-palette-secondary-text: #FFFFFF;
    --mud-palette-secondary-darken: rgba(46, 91, 255, 0.92);
    --mud-palette-secondary-lighten: rgba(46, 91, 255, 0.85);
    --mud-palette-secondary-hover: rgba(46, 91, 255, 0.08);

    --mud-palette-tertiary: #FF3D8B;                         /* p-rate */
    --mud-palette-tertiary-text: #FFFFFF;
    --mud-palette-tertiary-darken: rgba(255, 61, 139, 0.92);
    --mud-palette-tertiary-lighten: rgba(255, 61, 139, 0.85);
    --mud-palette-tertiary-hover: rgba(255, 61, 139, 0.08);

    /* Surface / background */
    --mud-palette-background: #FAF8F2;                       /* cream-soft */
    --mud-palette-background-gray: #F4F1EA;                  /* cream */
    --mud-palette-surface: #FFFFFF;
    --mud-palette-drawer-background: #FFFFFF;
    --mud-palette-drawer-text: #0B0B0F;
    --mud-palette-drawer-icon: #0B0B0F;
    --mud-palette-appbar-background: #FFFFFF;
    --mud-palette-appbar-text: #0B0B0F;

    /* Text */
    --mud-palette-text-primary: #0B0B0F;
    --mud-palette-text-secondary: rgba(11, 11, 15, 0.65);
    --mud-palette-text-disabled: rgba(11, 11, 15, 0.38);

    /* Action / interactive */
    --mud-palette-action-default: #0B0B0F;
    --mud-palette-action-default-hover: rgba(11, 11, 15, 0.06);
    --mud-palette-action-disabled: rgba(11, 11, 15, 0.26);
    --mud-palette-action-disabled-background: rgba(11, 11, 15, 0.12);

    /* Status */
    --mud-palette-success: #00C28E;                          /* ai-green */
    --mud-palette-success-text: #FFFFFF;
    --mud-palette-success-darken: rgba(0, 194, 142, 0.92);
    --mud-palette-success-lighten: rgba(0, 194, 142, 0.85);
    --mud-palette-success-hover: rgba(0, 194, 142, 0.08);

    --mud-palette-warning: #FF7A1A;                          /* p-san */
    --mud-palette-warning-text: #FFFFFF;
    --mud-palette-warning-darken: rgba(255, 122, 26, 0.92);
    --mud-palette-warning-lighten: rgba(255, 122, 26, 0.85);
    --mud-palette-warning-hover: rgba(255, 122, 26, 0.08);

    --mud-palette-error: #FF3D8B;                            /* p-rate */
    --mud-palette-error-text: #FFFFFF;
    --mud-palette-error-darken: rgba(255, 61, 139, 0.92);
    --mud-palette-error-lighten: rgba(255, 61, 139, 0.85);
    --mud-palette-error-hover: rgba(255, 61, 139, 0.08);

    --mud-palette-info: #2E5BFF;                             /* p-muh */
    --mud-palette-info-text: #FFFFFF;
    --mud-palette-info-darken: rgba(46, 91, 255, 0.92);
    --mud-palette-info-lighten: rgba(46, 91, 255, 0.85);
    --mud-palette-info-hover: rgba(46, 91, 255, 0.08);

    /* Lines / dividers */
    --mud-palette-lines-default: rgba(11, 11, 15, 0.08);
    --mud-palette-lines-inputs: rgba(11, 11, 15, 0.14);
    --mud-palette-divider: rgba(11, 11, 15, 0.08);
    --mud-palette-divider-light: rgba(11, 11, 15, 0.04);

    /* Table */
    --mud-palette-table-lines: rgba(11, 11, 15, 0.08);
    --mud-palette-table-striped: rgba(11, 11, 15, 0.02);
    --mud-palette-table-hover: rgba(11, 11, 15, 0.04);

    /* Overlays */
    --mud-palette-overlay-light: rgba(255, 255, 255, 0.5);
    --mud-palette-overlay-dark: rgba(11, 11, 15, 0.5);
}

/* ---------------------------------------------------------------------------
 * 2) Global body / scrollbar
 * --------------------------------------------------------------------------- */
body {
    background-color: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    font-family: 'Jost', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Defansif: MudBlazor dark-theme injected element'leri admin icin gizli.
   NOT: `[data-theme="dark"]` selector'i KALDIRILDI -- foundation (TECH-5607)
   <html data-theme="dark"> set ediyor; o selector tum sayfayi gizliyordu. */
.mud-theme-dark {
    display: none !important;
}

/* ---------------------------------------------------------------------------
 * 3) Typography — Bricolage Grotesque (headings) + Geist (body/UI)
 * --------------------------------------------------------------------------- */
.mud-typography-h1,
.mud-typography-h2,
.mud-typography-h3,
.mud-typography-h4 {
    font-family: 'Russo One', 'Jost', system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.mud-typography-h5,
.mud-typography-h6 {
    font-family: 'Russo One', 'Jost', system-ui, sans-serif;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.mud-typography-body1,
.mud-typography-body2,
.mud-typography-subtitle1,
.mud-typography-subtitle2 {
    font-family: 'Jost', system-ui, sans-serif;
}

.mud-typography-caption,
.mud-typography-overline,
.mud-input-helper-text,
.mud-chip-label {
    font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
    font-feature-settings: 'tnum' 1;
    letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------------------
 * 4) MudButton — pill shape, no uppercase, Studio OS shape
 * --------------------------------------------------------------------------- */
.mud-button-root {
    border-radius: var(--studio-radius-pill, 100px);
    text-transform: none;
    font-family: 'Jost', system-ui, sans-serif;
    font-weight: 500;
    letter-spacing: 0;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

/* b-prim mapping — Variant="Filled" Color="Primary" → solid ink */
.mud-button-filled.mud-button-filled-primary {
    background-color: #0B0B0F;
    color: #FAF8F2;
}
.mud-button-filled.mud-button-filled-primary:hover {
    background-color: #1A1A1F;
}

/* b-ghost mapping — Variant="Outlined" Color="Primary" → ink border */
.mud-button-outlined.mud-button-outlined-primary {
    border-color: rgba(11, 11, 15, 0.18);
    color: #0B0B0F;
    background-color: transparent;
}
.mud-button-outlined.mud-button-outlined-primary:hover {
    background-color: rgba(11, 11, 15, 0.04);
    border-color: rgba(11, 11, 15, 0.32);
}

/* IconButton — share same family, no pill (round) */
.mud-icon-button {
    font-family: 'Jost', system-ui, sans-serif;
}

/* ---------------------------------------------------------------------------
 * 5) MudCard / MudPaper — line border + 14px radius + soft shadow
 * --------------------------------------------------------------------------- */
.mud-paper:not(.mud-appbar):not(.mud-drawer):not(.mud-dialog-container .mud-paper) {
    border-radius: var(--studio-radius-md, 14px);
}

.mud-card {
    border: 1px solid rgba(11, 11, 15, 0.08);
    border-radius: var(--studio-radius-md, 14px);
    box-shadow: 0 1px 3px rgba(11, 11, 15, 0.04);
}

/* Outlined paper — Studio OS line treatment */
.mud-paper-outlined {
    border: 1px solid rgba(11, 11, 15, 0.08);
}

/* Dialog should still feel premium — slightly larger radius */
.mud-dialog .mud-paper {
    border-radius: var(--studio-radius-lg, 20px);
}

/* ---------------------------------------------------------------------------
 * 6) MudAppBar / MudDrawer — light surface, ink text
 * --------------------------------------------------------------------------- */
.mud-appbar {
    background-color: #FFFFFF;
    color: #0B0B0F;
    border-bottom: 1px solid rgba(11, 11, 15, 0.08);
    box-shadow: none;
}

.mud-drawer {
    background-color: #FFFFFF;
    color: #0B0B0F;
    border-right: 1px solid rgba(11, 11, 15, 0.08);
}

/* TECH-5496: NavMenu now uses plain <NavLink> + scoped CSS
   (.console-sidebar-link) instead of MudNavMenu/MudNavLink, so the
   previous .mud-drawer .mud-nav-link rules were dead and have been
   removed. The MudDrawer wrapper itself stays for breakpoint and
   backdrop behaviour. */

/* ---------------------------------------------------------------------------
 * 7) MudTextField / MudSelect — outlined feel, Studio OS lines
 * --------------------------------------------------------------------------- */
.mud-input-outlined .mud-input-outlined-border {
    border-radius: var(--studio-radius-sm, 8px);
    border-color: rgba(11, 11, 15, 0.14);
}

.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: rgba(11, 11, 15, 0.32);
}

.mud-input-outlined.mud-focused .mud-input-outlined-border {
    border-color: #0B0B0F;
    border-width: 1.5px;
}

.mud-input-label {
    font-family: 'Jost', system-ui, sans-serif;
}

/* ---------------------------------------------------------------------------
 * 8) MudTable / MudDataGrid — line treatment + zebra
 * --------------------------------------------------------------------------- */
.mud-table-root,
.mud-data-grid {
    font-family: 'Jost', system-ui, sans-serif;
}

.mud-table-cell,
.mud-table-head .mud-table-cell {
    border-bottom-color: rgba(11, 11, 15, 0.08);
}

.mud-table-head .mud-table-cell {
    font-weight: 600;
    color: rgba(11, 11, 15, 0.78);
    background-color: #FAF8F2;
}

.mud-table-row:hover {
    background-color: rgba(11, 11, 15, 0.02);
}

/* ---------------------------------------------------------------------------
 * 9) MudChip — pill is already default; align color
 * --------------------------------------------------------------------------- */
.mud-chip {
    font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
    font-feature-settings: 'tnum' 1;
    border-radius: var(--studio-radius-pill, 100px);
}

/* ---------------------------------------------------------------------------
 * 10) MudSnackbar — softer card treatment
 * --------------------------------------------------------------------------- */
.mud-snackbar {
    border-radius: var(--studio-radius-md, 14px);
    box-shadow: 0 24px 60px -28px rgba(11, 11, 15, 0.18);
}

/* ---------------------------------------------------------------------------
 * 11) MudAlert — Studio OS lines
 * --------------------------------------------------------------------------- */
.mud-alert {
    border-radius: var(--studio-radius-sm, 8px);
}

/* ---------------------------------------------------------------------------
 * 12) MudLink — ink default, p-muh on hover
 * --------------------------------------------------------------------------- */
a.mud-link,
.mud-link {
    color: #0B0B0F;
    text-underline-offset: 2px;
}

a.mud-link:hover,
.mud-link:hover {
    color: #2E5BFF;
}

/* ---------------------------------------------------------------------------
 * 13) Selection highlight
 * --------------------------------------------------------------------------- */
::selection {
    background: #0B0B0F;
    color: #FAF8F2;
}
