/* =========================================================================
   DailySono — shared user-side theme (brand name lives in application.cfm)
   -------------------------------------------------------------------------
   Ported from the view_postcard.cfm / view_card.cfm viewers so the entire
   user side feels like one product. Updated to a darker "Mureka-like"
   control-room look: deep background, dark glass panels, high-contrast
   text, neon-accent buttons.

   Single versioned site theme (user-theme_v3.css). Loaded via
   request.user_theme_css_filename from dsApplicationRequestConfig.cfm.
   Bump filename to v4 when a cache-busting rollout is needed. Per-page
   layout CSS stays on each template; /control/ dashboard is untouched.
   ========================================================================= */

:root {
    --sm-bg-space-1:   #070b16;
    --sm-bg-space-2:   #171d33;
    --sm-bg-space-3:   #0d1426;
    /* /user/ column width (header + .wrap). Revert: 960px; restore daily-songs .wrap max-width: 1220px if needed. */
    --ds-user-content-max: 1160px;
    --ds-user-content-pad-x: 16px;
    /* Clearance below fixed header (logo + Daily/Sono blurb, or compact user topbar). */
    --ds-user-topbar-pad-top: 92px;
    --ds-home-auth-pad-top: 100px;
    --ds-dash-nav-height-mobile: 64px;
    --sm-brand-pink:   #ef476f;
    --sm-brand-purple: #7b61ff;
    --sm-brand-blue:   #0b5fff;
    --sm-brand-gold:   #f0c975;
    --sm-ink:          #eaf0ff;
    --sm-ink-soft:     #9eaad0;
    --sm-panel-border: rgba(255,255,255,0.08);
    /* Scrollbar / inline-nav hover — shared interactive accent */
    --ds-accent-hover-border: #a14bff;
    --ds-accent-hover-fill: rgba(161, 75, 255, 0.1);
    --ds-accent-hover-glow: 0 0 14px rgba(161, 75, 255, 0.22);
}

/* -------- body: deep space gradient (same recipe as view_postcard) ---- */
html, body {
    min-height: 100vh;
    min-height: 100dvh;
}
html {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(161, 75, 255, 0.9) rgba(0, 0, 0, 0.35);
    scroll-padding-top: var(--ds-home-auth-pad-top);
}
body {
    background: var(--sm-bg-space-1) !important;
    color: #e9efff;
}

/* Fixed site headers — solid bar matching page base (index, user/, s/) */
.home-auth-bar,
.share-auth-bar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 200 !important;
    margin: 0 !important;
    padding: 8px 16px 10px !important;
    background: var(--sm-bg-space-1) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
header.ds-topbar.ds-enduser-topbar.ds-burger-topbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 200 !important;
    margin: 0 !important;
    padding: 12px 0 !important;
    background: var(--sm-bg-space-1) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
header.ds-topbar.ds-enduser-topbar.ds-burger-topbar .ds-topbar-inner {
    max-width: var(--ds-user-content-max);
    margin: 0 auto;
    padding: 0 var(--ds-user-content-pad-x);
    box-sizing: border-box;
}
body:has(> header.ds-topbar.ds-enduser-topbar.ds-burger-topbar) .wrap {
    max-width: var(--ds-user-content-max);
    margin-left: auto;
    margin-right: auto;
    padding-top: var(--ds-user-topbar-pad-top) !important;
}
body:has(> .home-auth-bar) .wrap {
    max-width: var(--ds-user-content-max);
    margin-left: auto;
    margin-right: auto;
    padding-top: var(--ds-home-auth-pad-top) !important;
}
/* Legacy: fixed burger bar still inside .wrap on older templates */
.wrap:has(> header.ds-topbar.ds-enduser-topbar.ds-burger-topbar) {
    padding-top: var(--ds-user-topbar-pad-top) !important;
}
body:has(> .share-auth-bar) .wrap {
    padding-top: var(--ds-home-auth-pad-top) !important;
}

@media (min-width: 992px) {
    :root {
        --ds-user-topbar-pad-top: 76px;
        --ds-home-auth-pad-top: 108px;
    }
}

@media (max-width: 720px) {
    :root {
        --ds-user-topbar-pad-top: 68px;
    }
}

/* Portrait/tablet fallback before JS measures the bar (blurb stacks under logo). */
@media (max-width: 991.98px) {
    html:has(.home-auth-bar-inner--with-blurb) {
        --ds-home-auth-pad-top: 140px;
    }
}

@media (max-width: 991.98px) {
    html:has(.ds-enduser-dash-nav--bottom) {
        scroll-padding-bottom: calc(var(--ds-dash-nav-height-mobile) + 20px + env(safe-area-inset-bottom, 0));
    }
}

/* -------- hero brand heading -----------------------------------
   The existing brand H1 uses a blue-cyan gradient; replace with the same
   warm pink→purple→gold sweep that the postcard flip uses. */
.brand h1 {
    background: none !important;
    color: #f5f8ff !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.38);
}
.brand p { color: #d7def4 !important; }

/* -------- content card panels ---------------------------------------- */
.card {
    background: linear-gradient(180deg, rgba(19, 24, 40, 0.96) 0%, rgba(12, 16, 29, 0.96) 100%) !important;
    border: 1px solid var(--sm-panel-border) !important;
    box-shadow:
        0 22px 60px rgba(0,0,0,0.45),
        0 0 0 1px rgba(255,255,255,0.03) inset !important;
}

/* Library page uses .panel and .song-card containers (defined in inline
   page CSS as white). Force dark-glass overrides here so the central area
   never looks like a white table. */
.panel,
.song-card {
    background: linear-gradient(180deg, rgba(19, 24, 40, 0.96) 0%, rgba(12, 16, 29, 0.96) 100%) !important;
    border: 1px solid rgba(154, 171, 222, 0.2) !important;
    box-shadow:
        0 22px 60px rgba(0,0,0,0.45),
        0 0 0 1px rgba(255,255,255,0.03) inset !important;
}
.song-card h3,
.song-card h4,
.meta,
.song-cover-meta,
.song-cover-meta strong {
    color: #e8eeff !important;
}
.song-cover-thumb {
    background: rgba(11, 16, 30, 0.9) !important;
    border: 1px solid rgba(154, 171, 222, 0.2) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35) !important;
}
.song-video-wrap {
    border: 1px solid rgba(154, 171, 222, 0.2) !important;
}
.player {
    background: linear-gradient(180deg, rgba(16, 21, 38, 0.95) 0%, rgba(10, 14, 28, 0.95) 100%) !important;
    border: 1px solid rgba(154, 171, 222, 0.2) !important;
}
/* Matches view_card / download card primary transport (gold → coral → violet). */
.player .play-btn {
    background: linear-gradient(135deg, #ffd166, #ef476f 55%, #a855f7) !important;
    border: none !important;
    color: #0b0f1a !important;
    box-shadow: 0 8px 20px rgba(239, 71, 111, 0.35) !important;
}
.player .play-btn:hover {
    filter: brightness(1.06) !important;
    box-shadow: 0 10px 24px rgba(239, 71, 111, 0.42) !important;
}
.player .skip-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: none !important;
    color: #e6ecff !important;
}
.player .skip-btn:hover {
    background: rgba(255, 255, 255, 0.16) !important;
}
.player .bar {
    background: rgba(255, 255, 255, 0.15) !important;
}
.player .bar-fill {
    background: #a855f7 !important;
}
.player .bar-thumb {
    background: #fff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}
.player .times {
    color: #d7def4 !important;
}
.btn-fs {
    background: rgba(28, 36, 62, 0.95) !important;
    border: 1px solid rgba(154, 171, 222, 0.3) !important;
    color: #edf2ff !important;
}
.btn-fs:hover {
    background: rgba(40, 49, 79, 0.98) !important;
    color: #fff !important;
}
.lyric-box {
    border: 1px solid rgba(154, 171, 222, 0.22) !important;
    background: rgba(9, 13, 24, 0.95) !important;
}
.lyric-box::-webkit-scrollbar {
    width: 10px;
}
.lyric-box::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
}
.lyric-box::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(180deg, #6076ff 0%, #8a72ff 100%);
    border: 2px solid rgba(9, 13, 24, 0.95);
}
.lyric-box {
    scrollbar-width: thin;
    scrollbar-color: #7e8fff rgba(255,255,255,0.07);
}
.ok {
    /* Match mint success banners (application.cfm request.ds_banner_success_*) — same as genres-eras / login */
    background: #d1fae5 !important;
    border: 1px solid #6ee7b7 !important;
    color: #14532d !important;
}
.err {
    background: rgba(90, 28, 37, 0.35) !important;
    border: 1px solid rgba(255, 133, 152, 0.45) !important;
    color: #ffe5ea !important;
}

.sub,
label,
.field-help {
    color: #d8dff6 !important;
}
.field-help { opacity: 0.86; }

/* Form section wrappers that were still bright in index.cfm */
.cover-options,
.video-field,
.postcard-photo-slot {
    background: linear-gradient(180deg, rgba(16, 21, 38, 0.95) 0%, rgba(10, 14, 28, 0.95) 100%) !important;
    border: 1px solid rgba(154, 171, 222, 0.22) !important;
}
.postcard-photo-label {
    color: #e3e9ff !important;
}
.cover-options .field-help,
.video-field .field-help,
.postcard-photo-slot .field-help {
    color: #c8d2f3 !important;
}

/* -------- top bar pills: glassmorphic on space background ------------- */
.btn-topbar,
.btn-logout,
a.btn-topbar,
a.btn-logout,
a.ds-logout {
    background: linear-gradient(180deg, rgba(28, 36, 60, 0.95) 0%, rgba(20, 26, 45, 0.95) 100%) !important;
    border: 1px solid rgba(154, 171, 222, 0.28) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.32);
    color: #edf2ff !important;
}
a.btn-topbar:hover,
a.btn-logout:hover,
.btn-topbar:hover,
.btn-logout:hover,
a.ds-logout:hover {
    background: linear-gradient(180deg, rgba(41, 51, 82, 0.98) 0%, rgba(28, 36, 62, 0.98) 100%) !important;
    border-color: rgba(187, 201, 242, 0.48) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(0,0,0,0.4) !important;
}
a.btn-topbar:focus-visible,
a.btn-logout:focus-visible,
a.ds-logout:focus-visible {
    background: linear-gradient(180deg, rgba(41, 51, 82, 0.98) 0%, rgba(28, 36, 62, 0.98) 100%) !important;
    border-color: rgba(187, 201, 242, 0.48) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(0,0,0,0.4) !important;
    outline: none;
}
.btn-topbar.btn-topbar-badge {
    background: linear-gradient(135deg, var(--sm-brand-blue) 0%, var(--sm-brand-purple) 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
}
.topbar-songs-left {
    background: linear-gradient(180deg, rgba(28, 36, 60, 0.95) 0%, rgba(20, 26, 45, 0.95) 100%) !important;
    border: 1px solid rgba(154, 171, 222, 0.28) !important;
    color: #edf2ff !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.32);
}
.btn-delete {
    background: rgba(61, 17, 24, 0.72) !important;
    border-color: rgba(255, 118, 138, 0.6) !important;
    color: #ffc3cd !important;
}
.btn-delete:hover {
    background: linear-gradient(135deg, rgba(228, 74, 97, 0.95) 0%, rgba(188, 41, 66, 0.95) 100%) !important;
    color: #fff !important;
    border-color: #ff7f95 !important;
    box-shadow: 0 10px 22px rgba(180, 34, 68, 0.45) !important;
    transform: translateY(-1px) scale(1.02);
}
.btn-delete:focus-visible {
    outline: 2px solid #ff94a7 !important;
    outline-offset: 2px;
}

/* -------- primary submit button: pink→purple gradient ----------------
   Mirrors the Flip-to-Back button on the postcard and the Open Card
   button on the flip card. We keep the .btn width/layout rules from the
   per-page stylesheet and only restyle the look. */
.btn {
    background: linear-gradient(135deg, #4f66ff 0%, #7b61ff 100%) !important;
    color: #fff !important;
    border: 0 !important;
    box-shadow:
        0 10px 24px rgba(123, 97, 255, 0.35),
        0 2px 6px rgba(0, 0, 0, 0.18) !important;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease !important;
}
.btn:hover {
    background: linear-gradient(135deg, #6076ff 0%, #8a72ff 100%) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow:
        0 14px 32px rgba(123, 97, 255, 0.42),
        0 4px 10px rgba(0, 0, 0, 0.22) !important;
}
.btn:disabled,
.btn[disabled] {
    filter: grayscale(0.4) opacity(0.6) !important;
    transform: none !important;
}

/* -------- secondary buttons ------------------------------------------ */
.btn-secondary {
    background: rgba(27, 35, 60, 0.95) !important;
    color: #edf2ff !important;
    border: 1px solid rgba(154, 171, 222, 0.28) !important;
}
.btn-secondary:hover {
    background: rgba(38, 47, 79, 0.98) !important;
    color: #fff !important;
    border-color: rgba(173, 189, 235, 0.42) !important;
}

/* -------- dark form controls ----------------------------------------- */
select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="url"],
input[type="file"],
textarea {
    background: rgba(9, 13, 24, 0.94) !important;
    border: 1px solid rgba(154, 171, 222, 0.24) !important;
    color: #edf2ff !important;
}
/* Style the native "Choose file" button to avoid bright default chrome.
   Modern: ::file-selector-button. Safari / iOS 12: ::-webkit-file-upload-button. */
input[type="file"] {
    min-height: 44px;
    padding: 6px 8px !important;
    line-height: 1.3;
}
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
    -webkit-appearance: none;
    appearance: none;
    margin-right: 10px;
    padding: 9px 14px;
    min-height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(154, 171, 222, 0.32);
    background: linear-gradient(180deg, rgba(33, 41, 70, 0.95) 0%, rgba(24, 30, 54, 0.95) 100%);
    color: #eef3ff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}
input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
    background: linear-gradient(180deg, rgba(49, 59, 94, 0.98) 0%, rgba(34, 42, 70, 0.98) 100%);
}
select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="file"]:focus,
textarea:focus {
    outline: none;
    border-color: rgba(123, 97, 255, 0.85) !important;
    box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.22);
}
::placeholder {
    color: #8f9ac3 !important;
    opacity: 1;
}

/* Chrome / Edge / Safari: autofill uses its own background (bright yellow/white).
   Box-shadow inset paint keeps the dark “filled” look; long transition avoids
   Chrome flashing the default autofill color. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
select:-webkit-autofill,
select:-webkit-autofill:hover {
    -webkit-text-fill-color: #edf2ff !important;
    caret-color: #edf2ff;
    -webkit-box-shadow: 0 0 0 1000px rgba(9, 13, 24, 0.97) inset !important;
    box-shadow: 0 0 0 1000px rgba(9, 13, 24, 0.97) inset !important;
    border: 1px solid rgba(154, 171, 222, 0.28) !important;
    transition: background-color 5000s ease-in-out 0s;
}
input:-webkit-autofill:focus,
textarea:-webkit-autofill:focus,
select:-webkit-autofill:focus {
    -webkit-text-fill-color: #edf2ff !important;
    caret-color: #edf2ff;
    -webkit-box-shadow: 0 0 0 1000px rgba(9, 13, 24, 0.97) inset, 0 0 0 3px rgba(123, 97, 255, 0.22) !important;
    box-shadow: 0 0 0 1000px rgba(9, 13, 24, 0.97) inset, 0 0 0 3px rgba(123, 97, 255, 0.22) !important;
    border-color: rgba(123, 97, 255, 0.85) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* -------- small polish: top bar container spacing on dark bg ---------- */
.wrap { position: relative; z-index: 1; }

/* Processing popup (index.cfm) */
.thinking-popup {
    background: rgba(4, 8, 18, 0.72) !important;
}
.thinking-card {
    background: linear-gradient(180deg, rgba(19, 24, 40, 0.98) 0%, rgba(12, 16, 29, 0.98) 100%) !important;
    border: 1px solid rgba(154, 171, 222, 0.24) !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5) !important;
}
.thinking-card p,
.thinking-card .thinking-note {
    color: #d8dff6 !important;
}
.thinking-card .thinking-timer {
    color: #a9b8ff !important;
}
.thinking-spinner {
    border-color: rgba(154, 171, 222, 0.25) !important;
    border-top-color: #7b61ff !important;
}

/* DailySono — end-user top bar */
.ds-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: nowrap;
    margin-bottom: 40px;
    min-height: 40px;
    width: 100%;
    box-sizing: border-box;
}
header.ds-topbar.ds-burger-topbar,
.ds-topbar.ds-burger-topbar {
    margin-bottom: 0 !important;
}
.ds-topbar-start {
    display: flex;
    align-items: center;
    min-width: 0;
    flex-shrink: 0;
}
/* Top-right account cluster (Dashboard/Home + Profile + Log out) */
.ds-topbar-end {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
}
.ds-topbar-end a.btn.cta-btn.ds-dashboard-btn {
    flex-shrink: 0;
    transform: none !important;
    translate: none !important;
    box-sizing: border-box !important;
    border: 1px solid rgba(154, 171, 222, 0.38) !important;
    line-height: 1.15 !important;
    padding: 0 16px !important;
    min-height: 40px !important;
    min-width: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
    color: #e8ecff !important;
    background: rgba(25, 31, 54, 0.92) !important;
    box-shadow: none !important;
    transition-property: background-color, box-shadow, filter, border-color, color !important;
    transition-duration: 0.18s !important;
    transition-timing-function: ease !important;
}
.ds-topbar-end a.btn.cta-btn.ds-dashboard-btn.ds-dashboard-btn--icon {
    padding: 0 !important;
    min-width: 40px !important;
    width: 40px !important;
}
.ds-topbar-end a.btn.cta-btn.ds-dashboard-btn.ds-dashboard-btn--icon svg {
    display: block;
    width: 20px;
    height: 20px;
}
.ds-topbar-end a.btn.cta-btn.ds-dashboard-btn:hover,
.ds-topbar-end a.btn.cta-btn.ds-dashboard-btn:focus-visible,
.ds-topbar-end a.btn.cta-btn.ds-dashboard-btn:active {
    background: linear-gradient(90deg, #5b4dff 0%, #7d5bff 38%, #a14bff 70%, #c454ff 100%) !important;
    border: 1px solid rgba(172, 141, 255, 0.95) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 26px rgba(161, 75, 255, 0.38), 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    transform: none !important;
    translate: none !important;
    filter: none !important;
    outline: none;
}
/* Log out / Profile: rounded rect; glass fill from the top bar pills block. */
a.ds-logout {
    appearance: none !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 9px 16px !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

/* Site logo (dslogo.webp) — auth, user topbar, share listen */
.ds-site-logo {
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin: 0;
}
.ds-site-logo img {
    display: block;
    height: clamp(28px, 4.2vw, 34px);
    width: auto;
    max-width: min(212px, 58vw);
    object-fit: contain;
    object-position: center top;
}
a.ds-site-logo:hover img {
    opacity: 0.92;
}
.ds-topbar .ds-site-logo,
.ds-topbar a.ds-site-logo {
    position: static !important;
    left: auto !important;
    transform: none !important;
    text-align: left;
    justify-content: flex-start;
    width: auto !important;
}
@media (max-width: 640px) {
    .ds-topbar {
        align-items: center;
        flex-wrap: nowrap;
    }
    .ds-topbar-start {
        flex: 0 1 auto;
        justify-content: flex-start;
    }
    .ds-topbar-end {
        flex: 0 0 auto;
        justify-content: flex-end;
    }
}
.ds-auth-top__brand .ds-site-logo {
    max-width: min(212px, 70vw);
}
.topbar .brand.ds-site-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 120px);
    pointer-events: auto;
}
