/* =====================================================================
   Liberty Ultra Dark — standalone theme tokens for the pulse speedtest.

   Palette and typography extracted from the OpenStack Horizon
   "liberty-ultra-dark" theme so the standalone app matches the Horizon
   dashboard. This file DEFINES the design tokens (CSS custom properties)
   and a few net-new components (DC picker, share image); style.css CONSUMES
   the tokens. Loaded before style.css.
   ===================================================================== */

/* Web fonts (graceful system fallback if unavailable / blocked by CSP). */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    /* Layered backgrounds: void -> floating */
    --bg: #0a0e14;            /* body / abyss */
    --bg-section: #0f1419;    /* deep surfaces */
    --bg-card: #151b23;       /* cards, inputs */
    --bg-card-highlight: #1c232d; /* hover / highlighted card */
    --bg-floating: #2d3848;   /* tooltips, popovers */

    /* Text hierarchy */
    --text: #f0f3f6;
    --text-muted: #a8b3c1;
    --text-faint: #6d7a8a;

    /* Electric-cyan accent + states */
    --accent: #00d4ff;
    --accent-dim: #00a8cc;
    --accent-glow: rgba(0, 212, 255, 0.40);
    --accent-mute: rgba(0, 212, 255, 0.15);
    --accent-contrast: #0a0e14; /* dark text on bright accent */

    /* Status colors */
    --green: #00e676;
    --yellow: #ffb300;
    --red: #ff5252;
    --info: #b388ff;

    /* Borders + gauge */
    --border: rgba(255, 255, 255, 0.12);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --gauge-track: #151b23;

    /* Typography */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", "Monaco", "Roboto Mono", monospace;

    /* Effects */
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px var(--accent-glow);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ambient cyan glow behind the page, like the Horizon header gradient. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(0, 212, 255, 0.10) 0%, transparent 60%);
}
.container { position: relative; z-index: 1; }

/* ---------------- Datacenter picker (net-new) ---------------- */
.dc-picker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.dc-picker label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
}

.dc-select {
    appearance: none;
    background-color: var(--bg-card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23a8b3c1' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    min-width: 220px;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.dc-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-mute);
}

.dc-select:disabled {
    color: var(--text-muted);
    cursor: default;
}

.dc-auto {
    background: var(--bg-card-highlight);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
}

.dc-auto:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-mute);
}

.dc-auto:disabled { opacity: 0.6; cursor: default; }

/* ---------------- Shareable result image (net-new) ---------------- */
.summary-value a {
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}
.summary-value a:hover { text-decoration: underline; }

.share-image-wrap {
    margin-top: 0.75rem;
    text-align: center;
}

.share-image {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ---------------- Single-row site header (shared by all pages) ---------------- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    text-align: left;
    margin-bottom: 1.5rem;
}

.site-header .header-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.site-header .brand { margin-bottom: 0; }
.site-header .brand-logo { height: 38px; }
.site-header h1 { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.02em; }
.site-header .subtitle { margin-top: 0.15rem; font-size: 0.8rem; }
.site-header .topnav { margin: 0; }
.site-header .dc-picker { margin-top: 0; }

@media (max-width: 900px) {
    .site-header {
        flex-direction: column;
        text-align: center;
    }
}

/* Top nav between Speed Test and Diagnostics (shared by both pages). */
.topnav {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0 0;
}
.topnav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: all var(--transition);
}
.topnav a:hover { color: var(--text); background: var(--bg-card); }
.topnav a.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-mute);
}
