/**
 * portal-theme-fluent-2.css
 * Sagsportal — Fluent Design 2 theme (Windows)
 *
 * Load this file when User-Agent indicates Windows.
 * Always load portal-layout.css first, then this file,
 * then portal-custom.css last.
 */

/* ── Shared brand + components ── */
@import '_portal-shared.css';

:root,
[data-theme="fluent-2"] {
    --portal-font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
    --portal-title-size: 20px;
    --portal-title-weight: 500;
    --portal-label-size: 12px;
    --portal-label-weight: 600;
    --portal-label-transform: none;

    /* ── Light mode — Windows 11 Fluent Design 2 ── */
    /* Mica-inspired: warm off-white canvas, white surfaces, dark text */
    --portal-page-bg: #f3f3f3;
    --portal-brand-bg: #0f3460;
    --portal-surface: rgba(255, 255, 255, 0.97);
    --portal-form-card-bg: transparent;
    --portal-form-card-border: transparent;
    --portal-form-card-shadow: none;
    --portal-form-card-radius: 0;
    --portal-form-card-padding: 0;

    /* Fluent orb colours (login brand panel only) */
    --portal-orb-1: #0078d4;
    --portal-orb-2: #50e6ff;

    --portal-accent: var(--portal-color);
    --portal-accent-hover: var(--portal-color-hover);
    --portal-accent-active: var(--portal-color-active);
    --portal-accent-disabled: var(--portal-color-disabled);
    --portal-accent-ring: var(--portal-color-ring);

    /* Cards — white, Fluent 2 shadow4 token (exact values from Fluent UI React v9) */
    --portal-glass-bg: rgba(255, 255, 255, 1.0);
    --portal-glass-border: transparent;
    --portal-glass-shadow: rgba(0, 0, 0, 0.12) 0px 0px 2px 0px, rgba(0, 0, 0, 0.14) 0px 2px 4px 0px;
    --portal-glass-blur: none;

    --portal-modal-bg: rgba(255, 255, 255, 0.96);
    --portal-modal-border: rgba(0, 0, 0, 0.10);

    /* Tiles — same as cards in Fluent 2 light */
    --portal-tile-bg: rgba(255, 255, 255, 1.0);
    --portal-tile-border: transparent;
    --portal-tile-bg-hover: rgba(255, 255, 255, 1.0);

    /* Chips / filter buttons — Fluent 2 "subtle" button style */
    --portal-chip-bg: transparent;
    --portal-chip-border: transparent;
    --portal-chip-color: #424242;
    --portal-chip-bg-hover: rgba(0, 0, 0, 0.05);

    /* Text — dark on light */
    --portal-text-primary: #242424;
    --portal-text-secondary: #616161;
    --portal-text-muted: #9e9e9e;

    /* Topbar — white/near-white with very subtle shadow */
    --portal-topbar-bg: rgba(255, 255, 255, 0.90);
    --portal-topbar-border: rgba(0, 0, 0, 0.08);
    --portal-topbar-blur: blur(20px);

    /* Search */
    --portal-search-bg: rgba(0, 0, 0, 0.04);
    --portal-search-border: rgba(0, 0, 0, 0.10);
    --portal-search-bg-focus: rgba(255, 255, 255, 1.0);
    --portal-search-radius: 4px;

    /* Inputs */
    --portal-input-bg: rgba(255, 255, 255, 0.90);
    --portal-input-border: rgba(0, 0, 0, 0.14);
    --portal-input-border-focus: #0078d4;
    --portal-select-bg: rgba(255, 255, 255, 0.90);
    --portal-select-chevron: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4.5L6 8L10 4.5' stroke='rgba(0,0,0,0.5)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");

    /* Misc */
    --portal-divider: rgba(0, 0, 0, 0.06);
    --portal-badge-bg: var(--portal-color);
    --portal-badge-color: #ffffff;
    --portal-dropdown-bg: rgba(255, 255, 255, 0.92);
    --portal-dropdown-solid-bg: #ffffff;

    /* Radius — Fluent 2 uses tight 4–8px radii */
    --portal-radius-card: 8px;
    --portal-radius-tile: 6px;
    --portal-radius-input: 4px;
    --portal-radius-button: 4px;
    --portal-radius-badge: 4px;
}

/* Dark mode */
[data-dark] {
    --portal-page-bg: #1c1c1c;
    --portal-brand-bg: #1c1c1c;
    --portal-surface: #2c2c2c;

    --portal-text-primary: #ffffff;
    --portal-text-secondary: rgba(255, 255, 255, 0.65);
    --portal-text-muted: rgba(255, 255, 255, 0.38);

    /* Fluent orb colours (dark) */
    --portal-orb-1: #1a3a5c;
    --portal-orb-2: #1a5070;

    --portal-glass-bg: #292929;
    --portal-glass-border: rgba(255, 255, 255, 0.09);
    --portal-glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --portal-glass-blur: blur(24px);

    --portal-modal-bg: rgba(6, 14, 28, 0.92);
    --portal-modal-border: rgba(255, 255, 255, 0.12);

    --portal-tile-bg: #292929;
    --portal-tile-border: rgba(255, 255, 255, 0.09);
    --portal-tile-bg-hover: #333333;

    --portal-chip-bg: rgba(255, 255, 255, 0.08);
    --portal-chip-border: rgba(255, 255, 255, 0.20);
    --portal-chip-color: rgba(255, 255, 255, 0.65);
    --portal-chip-bg-hover: rgba(255, 255, 255, 0.15);

    --portal-topbar-bg: rgba(28, 28, 28, 0.90);
    --portal-topbar-border: rgba(255, 255, 255, 0.08);

    --portal-search-bg: rgba(255, 255, 255, 0.10);
    --portal-search-border: rgba(255, 255, 255, 0.16);
    --portal-search-bg-focus: rgba(255, 255, 255, 0.18);

    --portal-input-bg: rgba(255, 255, 255, 0.08);
    --portal-input-border: rgba(255, 255, 255, 0.18);
    --portal-input-border-focus: #60cdff;
    --portal-select-bg: rgba(255, 255, 255, 0.08);
    --portal-select-chevron: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4.5L6 8L10 4.5' stroke='rgba(255,255,255,0.5)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");

    --portal-divider: rgba(255, 255, 255, 0.08);
    --portal-dropdown-bg: rgba(41, 41, 41, 0.95);
    --portal-dropdown-solid-bg: #323232;

    --portal-accent: var(--portal-color-dark);
    --portal-accent-hover: var(--portal-color-dark-hover);
    --portal-accent-active: var(--portal-color-dark-active);
    --portal-accent-disabled: var(--portal-color-dark-disabled);
    --portal-accent-ring: var(--portal-color-dark-ring);
}

/* Theme-specific component overrides */

/* Fluent 2 light: tiles = shadow4 resting, shadow8 on hover (no transform) */
[data-theme="fluent-2"]:not([data-dark]) .portal-tile {
    box-shadow: rgba(0, 0, 0, 0.12) 0px 0px 2px 0px, rgba(0, 0, 0, 0.14) 0px 2px 4px 0px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

[data-theme="fluent-2"]:not([data-dark]) .portal-tile:hover {
    box-shadow: rgba(0, 0, 0, 0.14) 0px 4px 8px 0px, rgba(0, 0, 0, 0.12) 0px 0px 2px 0px;
    transform: none;
}

/* Fluent 2 dark: solid surface, no glass blur, shadow on hover (no transform) */
[data-dark][data-theme="fluent-2"] .portal-tile {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: rgba(0, 0, 0, 0.40) 0px 0px 2px 0px, rgba(0, 0, 0, 0.32) 0px 2px 4px 0px;
}

[data-dark][data-theme="fluent-2"] .portal-tile:hover {
    box-shadow: rgba(0, 0, 0, 0.40) 0px 4px 8px 0px, rgba(0, 0, 0, 0.32) 0px 0px 2px 0px;
    transform: none;
}

/* Fluent 2 dark: cards also solid, no glass blur */
[data-dark][data-theme="fluent-2"] .portal-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: rgba(0, 0, 0, 0.40) 0px 0px 2px 0px, rgba(0, 0, 0, 0.32) 0px 2px 4px 0px;
}

[data-theme="fluent-2"]:not([data-dark]) .portal-filter-chip.active,
[data-theme="fluent-2"]:not([data-dark]) .portal-page-btn.active {
    background: #ebf3fc;
    border-color: transparent;
    color: #0078d4;
    font-weight: 600;
}

/* Fluent 2 light: filter bar sits on canvas — transparent, no card */
[data-theme="fluent-2"]:not([data-dark]) .portal-filter-bar {
    background: transparent;
    padding: 0;
    margin-bottom: 8px;
}

[data-theme="fluent-2"]:not([data-dark]) .portal-button-ghost {
    border-color: rgba(0, 0, 0, 0.14);
    color: #424242;
}

[data-theme="fluent-2"]:not([data-dark]) .portal-button-ghost:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #242424;
    border-color: rgba(0, 0, 0, 0.22);
}

[data-theme="fluent-2"]:not([data-dark]) .portal-topbar-button {
    color: #424242;
}

[data-theme="fluent-2"]:not([data-dark]) .portal-topbar-button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #242424;
}

[data-theme="fluent-2"]:not([data-dark]) .portal-message-item:hover,
[data-theme="fluent-2"]:not([data-dark]) .portal-activity-item:hover,
[data-theme="fluent-2"]:not([data-dark]) .portal-status-row:hover,
[data-theme="fluent-2"]:not([data-dark]) .portal-files-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.03);
}

/* Fluent: login form has no card — max-width slightly wider, light page bg */
[data-theme="fluent-2"] .portal-form-inner {
    max-width: 400px;
}

[data-theme="fluent-2"] .portal-login-page {
    background: #f0f2f5;
}

[data-dark][data-theme="fluent-2"] .portal-login-page {
    background: #202020;
}

.portal-button {
    box-shadow: 0 1px 3px rgba(0, 120, 212, 0.35), 0 2px 8px rgba(0, 120, 212, 0.20);
}

.portal-button-ghost {
    font-weight: 500;
}

/* Form panel (login/maintenance) sits on a light surface — override to dark text */
.portal-form-panel {
    --portal-text-primary: #1a1a2e;
    --portal-text-secondary: rgba(0, 0, 0, 0.55);
    --portal-text-muted: rgba(0, 0, 0, 0.35);
    --portal-input-bg: rgba(255, 255, 255, 0.80);
    --portal-input-border: rgba(0, 0, 0, 0.14);
    --portal-input-border-focus: #0078d4;
    --portal-select-bg: rgba(255, 255, 255, 0.80);
    color: #1a1a2e;
}

[data-dark] .portal-form-panel {
    --portal-text-primary: rgba(255, 255, 255, 0.92);
    --portal-text-secondary: rgba(255, 255, 255, 0.55);
    --portal-text-muted: rgba(255, 255, 255, 0.30);
    --portal-input-bg: rgba(255, 255, 255, 0.08);
    --portal-input-border: rgba(255, 255, 255, 0.16);
    --portal-input-border-focus: #60cdff;
    --portal-select-bg: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
}

/* Mobile: strip card styling, show mobile brand header.
   Exception: liquid-glass keeps its glass card on mobile — it's central to the design. */
@media (max-width: 1023px) {
    [data-theme="fluent-2"] .portal-form-inner {
        background: none;
        border: none;
        box-shadow: none;
        padding: 0;
    }
}
