html, body {
    font-family: 'Cairo', 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
}

/* This MudBlazor build ships flex/spacing utilities (d-flex, justify-center, mx-auto, pa-*) but no
   text-align helper, so the `text-center` wrappers used for section headings were silently
   left-aligned. Define it here so those headings actually centre. */
.text-center { text-align: center; }

/* Brand wordmark */
.daleel-wordmark {
    font-weight: 700;
    letter-spacing: .2px;
}

/* Ask hero — Google-style search focus */
.daleel-hero {
    text-align: center;
    padding: clamp(1.5rem, 6vh, 5rem) 0 1.5rem;
}

.daleel-hero .daleel-logo,
.daleel-landing-logo {
    font-size: clamp(2.6rem, 7vw, 4rem);
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(90deg, var(--mud-palette-primary), var(--mud-palette-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Streaming progress log */
.daleel-log {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: .8rem;
    max-height: 220px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.daleel-log .log-line {
    opacity: 0;
    animation: log-in .25s ease forwards;
}

@keyframes log-in {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Single animated status line — replaces the CLI-style scrolling log on the search page.
   The status text is re-keyed on every update, so this animation replays as a smooth
   cross-fade/slide as the pipeline moves stage to stage. */
.daleel-status-line {
    display: inline-block;
    animation: status-flip .32s cubic-bezier(.22, .61, .36, 1) both;
    will-change: opacity, transform;
}

@keyframes status-flip {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* The little pulsing dot that sits before the status text. */
.daleel-status-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mud-palette-primary, #5b4ee5);
    animation: status-pulse 1.1s ease-in-out infinite;
    flex: 0 0 auto;
}

@keyframes status-pulse {
    0%, 100% { opacity: .35; transform: scale(.8); }
    50%      { opacity: 1;   transform: scale(1.25); }
}

/* Markdown-ish report body */
.daleel-report {
    line-height: 1.7;
    font-size: 1.02rem;
}

.daleel-report p { margin: 0 0 .9rem; }

/* Cards lift on hover for a polished feel */
.daleel-card {
    transition: transform .15s ease, box-shadow .15s ease;
}
.daleel-card:hover {
    transform: translateY(-2px);
}

/* ───────────────────────────── Landing page ───────────────────────────── */

/* Hero: a soft radial wash of the brand hues behind centred content. */
.daleel-landing-hero {
    text-align: center;
    padding: clamp(2rem, 8vh, 6rem) 1rem clamp(1.5rem, 4vh, 3rem);
    border-radius: 24px;
    background:
        radial-gradient(60% 70% at 50% 0%, rgba(var(--mud-palette-primary-rgb), .14), transparent 70%),
        radial-gradient(50% 60% at 85% 30%, rgba(var(--mud-palette-secondary-rgb), .12), transparent 70%);
}

.daleel-landing-logo {
    font-size: clamp(3rem, 9vw, 5rem);
}

.daleel-landing-title {
    font-weight: 700;
    max-width: 18ch;
    margin-inline: auto;
    line-height: 1.15;
}

/* Constrain prose to a comfortable measure on wide screens. */
.daleel-landing-lede {
    max-width: 60ch;
}

.daleel-landing-section {
    margin-top: clamp(3rem, 9vh, 6rem);
}

/* Feature cards: equal-height, lift handled by the shared .daleel-card rule. */
.daleel-feature-card {
    height: 100%;
    border-radius: 18px;
}

.daleel-feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pricing cards */
.daleel-price-card {
    height: 100%;
    border-radius: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* The list grows so every card's CTA sits flush at the bottom regardless of feature count. */
.daleel-price-card .mud-list {
    flex-grow: 1;
}

/* The monthly search allowance — the one thing that differs between tiers, so it's highlighted. */
.daleel-price-searches {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(var(--mud-palette-primary-rgb), .08);
}

.daleel-price-popular {
    border: 2px solid var(--mud-palette-primary);
}

/* Centred ribbon stays correct in both LTR and RTL. */
.daleel-price-ribbon {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .3px;
    padding: 4px 14px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(var(--mud-palette-primary-rgb), .4);
}

/* Closing call-to-action band */
.daleel-cta-band {
    border-radius: 24px;
    background: linear-gradient(120deg,
        rgba(var(--mud-palette-primary-rgb), .16),
        rgba(var(--mud-palette-secondary-rgb), .16));
    border: 1px solid rgba(var(--mud-palette-primary-rgb), .25);
}

.daleel-cta-title {
    font-weight: 700;
}

.daleel-cta-sub {
    max-width: 48ch;
}

/* Sticky footer: make the layout a full-height flex column so the footer is
   pushed to the bottom of the viewport even when the page content is short.
   The footer lives inside .mud-main-content (see MainLayout.razor), so that
   element — not .mud-layout — must be the flex column, and the content
   container (.daleel-content) grows to fill the leftover space. */
.mud-layout {
    min-height: 100vh;
}

.mud-main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.daleel-content {
    flex: 1 0 auto;
}

/* App footer */
.daleel-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--mud-palette-divider, rgba(0, 0, 0, 0.12));
    margin-top: 24px;
}

.daleel-footer a {
    text-decoration: none;
}

/* Small green dot next to the Status link in the footer. */
.daleel-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mud-palette-success, #2e7d32);
    margin-inline-end: 6px;
    vertical-align: middle;
}

/* Custom reconnection card (see boot.js). Hidden until every silent retry has failed; then .daleel-
   reconnect-show is added and this overlay appears. The default Blazor reconnect modal is suppressed
   because boot.js supplies a custom reconnectionHandler. */
#daleel-reconnect {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    background: rgba(11, 15, 25, 0.55);
    backdrop-filter: blur(2px);
}

#daleel-reconnect.daleel-reconnect-show {
    display: flex;
}

.daleel-reconnect-card {
    background: var(--mud-palette-surface, #fff);
    color: var(--mud-palette-text-primary, #1a1a1a);
    border-radius: 16px;
    padding: 24px 28px;
    max-width: 420px;
    width: calc(100% - 32px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.daleel-reconnect-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.daleel-reconnect-text {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-bottom: 18px;
}

.daleel-reconnect-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
}

.daleel-reconnect-btn {
    background: var(--mud-palette-primary, #594ae2);
    color: var(--mud-palette-primary-text, #fff);
    border: none;
    border-radius: 999px;
    padding: 8px 22px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.daleel-reconnect-link {
    color: var(--mud-palette-primary, #594ae2);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Blazor framework error toast */
#blazor-error-ui {
    color-scheme: light dark;
    background: #b32121;
    color: #fff;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1100;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}
.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* SafeImage — external images are blurred until the user reveals them (HaramBlur-style). */
.safe-image-wrap {
    position: relative;
    display: inline-block;
    overflow: hidden;
    border-radius: 8px;
    min-height: 120px;
    min-width: 120px;
}
.safe-image-blur {
    filter: blur(20px);
    transform: scale(1.1); /* hide the soft blurred edges */
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.safe-image-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: rgba(0, 0, 0, 0.45);
    text-align: center;
    padding: 8px;
}

/* ── Auth forms (static-SSR login / register) ────────────────────────────────
   The login/register pages render statically, so they use framework <InputText>
   instead of MudBlazor fields. These rules give those inputs a look consistent
   with the MudBlazor dark theme via the same --mud-palette-* variables. */
.daleel-field-label {
    display: block;
    font-size: 0.85rem;
    color: var(--mud-palette-text-secondary, rgba(255, 255, 255, 0.7));
    margin-top: 14px;
    margin-bottom: 4px;
}
.daleel-field {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--mud-palette-lines-inputs, rgba(255, 255, 255, 0.3));
    background: var(--mud-palette-background-gray, rgba(255, 255, 255, 0.05));
    color: var(--mud-palette-text-primary, #e8eaf0);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.daleel-field::placeholder {
    color: var(--mud-palette-text-disabled, rgba(255, 255, 255, 0.4));
}
.daleel-field:focus {
    outline: none;
    border-color: var(--mud-palette-primary, #594ae2);
    box-shadow: 0 0 0 2px rgba(var(--mud-palette-primary-rgb, 89, 74, 226), 0.25);
}
/* Blazor's <ValidationMessage> renders .validation-message; tint it as an error. */
.validation-message {
    display: block;
    color: var(--mud-palette-error, #f44336);
    font-size: 0.8rem;
    margin-top: 4px;
}
