/* EMD — minimal overrides (MudBlazor handles most styling) */

html, body {
    font-family: 'Inter', 'Helvetica', 'Arial', sans-serif;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
}

/* ── Splash screen (shown while WASM downloads) ────────────────────── */
.splash {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #6B4226 0%, #D4A853 100%);
}

.splash-content {
    text-align: center;
    color: white;
    padding: 2rem;
}

.splash-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.9;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.1); opacity: 1; }
}

.splash-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.splash-subtitle {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.8;
    margin-bottom: 2rem;
}

.splash-progress-track {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    margin: 0 auto 1rem;
    overflow: hidden;
}

.splash-progress-bar {
    height: 100%;
    background: white;
    border-radius: 2px;
    width: var(--blazor-load-percentage, 0%);
    transition: width 0.15s ease-out;
}

.splash-status {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Blazor error UI */
#blazor-error-ui {
    background: firebrick;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    color: white;
    text-decoration: none;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Safe area insets for notched devices */
.mud-main-content {
    padding-top: env(safe-area-inset-top);
}

/* Cursor pointer for clickable cards */
.cursor-pointer {
    cursor: pointer;
}

/* ── Page transition animation ─────────────────────────────────────── */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-transition {
    animation: pageEnter 0.25s ease-out;
}

/* ── Required field asterisk (red) ─────────────────────────────────── */
.required-indicator {
    color: #d32f2f;
    margin-left: 2px;
}

/* ── Focus-visible styles for keyboard/screen reader accessibility ── */
*:focus-visible {
    outline: 2px solid var(--mud-palette-primary, #1976d2);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remove focus outline for mouse/touch (keeps it for keyboard nav) */
*:focus:not(:focus-visible) {
    outline: none;
}

/* ── Status chip dark mode contrast fix ────────────────────────────── */
.mud-theme-dark .mud-chip-filled.mud-chip-color-warning,
.mud-theme-dark .mud-chip-filled.mud-chip-color-error,
.mud-theme-dark .mud-chip-filled.mud-chip-color-success,
.mud-theme-dark .mud-chip-filled.mud-chip-color-info {
    color: #fff;
    font-weight: 600;
}

/* Connectivity banner — sticks below app bar */
.connectivity-banner {
    position: sticky;
    top: 48px;
    z-index: 900;
}

/* ── Message bubble backgrounds ───────────────────────────────────── */
.msg-bubble-sent {
    background: rgba(139, 94, 60, 0.12);
    border-radius: 12px 12px 0 12px;
}

.msg-bubble-received {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px 12px 12px 0;
}

.mud-theme-dark .msg-bubble-sent {
    background: rgba(196, 154, 108, 0.18);
}

/* ── Dark mode overrides for gradient screens ────────────────────── */
.mud-theme-dark .login-bg,
.mud-theme-dark .splash {
    background: linear-gradient(135deg, #2A1F14 0%, #6B4226 100%);
}

/* Login page gradient background */
.login-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, #6B4226 0%, #D4A853 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
