/* =============================================================================
 * BMI Watchlist — Standalone-Inhalt (bwl-*), Terminal-Stil.
 * Chrome (bpt-*) kommt aus portfolio-terminal.css; Tokens (--bmi-*) aus
 * portfolio-style.css. 2026-06-10 Watchlist-Redesign.
 * ========================================================================== */

.bwl-main { padding: 22px 16px 40px; }
#bmi-watchlist-app, .bwl-gate { max-width: 980px; margin: 0 auto; }

/* Header-Nav (.bwl-nav) lebt in portfolio-terminal.css — wird auch vom
   Portfolio-Chrome genutzt (Cross-Links Terminal/Portfolio/Watchlist). */

/* ------- Hero: Titel + Stat-Chips ------- */
.bwl-hero {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin: 6px 0 18px;
}
.bwl-title-wrap { min-width: 0; }
.bwl-kicker {
    font-family: var(--bmi-font); font-size: 10.5px; font-weight: 800;
    letter-spacing: 2.4px; text-transform: uppercase; color: var(--bmi-gold);
    margin: 0 0 6px;
}
.bwl-title {
    font-family: var(--bmi-font); font-size: 26px; font-weight: 800;
    letter-spacing: -.02em; color: var(--bmi-text); margin: 0; line-height: 1.15;
}
.bwl-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.bwl-chip {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--bmi-font-mono); font-size: 11.5px; font-weight: 600;
    color: var(--bmi-text-muted);
    background: var(--bmi-panel); border: 1px solid var(--bmi-border-hi);
    border-radius: 8px; padding: 7px 12px; white-space: nowrap;
}
.bwl-chip b { color: var(--bmi-text); font-weight: 700; }
.bwl-chip .up { color: var(--bmi-up); }
.bwl-chip .down { color: var(--bmi-down); }

/* ------- Such-/Hinzufügen-Leiste ------- */
.bwl-search-wrap { position: relative; margin: 0 0 18px; }
.bwl-search-box {
    display: flex; align-items: center; gap: 10px;
    background: var(--bmi-panel);
    border: 1px solid var(--bmi-border-hi);
    border-radius: 12px; padding: 0 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.bwl-search-box:focus-within {
    border-color: var(--bmi-gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,.14);
}
.bwl-search-ico { color: var(--bmi-faint); flex: 0 0 auto; display: inline-flex; }
.bwl-search-box input {
    flex: 1; min-width: 0; height: 52px;
    background: transparent; border: none; outline: none;
    color: var(--bmi-text); font-family: var(--bmi-font);
    font-size: 14.5px;
}
.bwl-search-box input::placeholder { color: var(--bmi-faint); }
.bwl-search-hint {
    font-family: var(--bmi-font-mono); font-size: 10px; color: var(--bmi-faint);
    border: 1px solid var(--bmi-border-hi); border-radius: 5px;
    padding: 3px 7px; white-space: nowrap; flex: 0 0 auto;
}
@media (max-width: 600px) { .bwl-search-hint { display: none; } }

/* Dropdown-Ergebnisse */
.bwl-results {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 200;
    background: var(--bmi-panel-hi);
    border: 1px solid var(--bmi-border-hi);
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 22px 50px rgba(0,0,0,.55);
    max-height: 320px; overflow-y: auto;
    display: none;
}
.bwl-results.open { display: block; }
.bwl-result {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,.04);
    transition: background .12s ease;
}
.bwl-result:last-child { border-bottom: none; }
.bwl-result:hover, .bwl-result.active { background: rgba(212,175,55,.09); }
.bwl-result-name {
    font-family: var(--bmi-font); font-size: 13.5px; font-weight: 700;
    color: var(--bmi-text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bwl-result-meta {
    font-family: var(--bmi-font-mono); font-size: 10.5px; color: var(--bmi-faint);
    margin-top: 2px;
}
.bwl-result-add {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--bmi-font); font-size: 11px; font-weight: 800;
    color: var(--bmi-gold); border: 1px solid rgba(212,175,55,.4);
    border-radius: 999px; padding: 5px 12px; white-space: nowrap;
}
.bwl-result:hover .bwl-result-add { background: var(--bmi-gold); color: #0a0e1a; }
.bwl-result-note { padding: 13px 16px; font-family: var(--bmi-font); font-size: 12.5px; color: var(--bmi-faint); }

/* ------- Tabelle ------- */
.bwl-panel {
    background: var(--bmi-panel);
    border: 1px solid var(--bmi-border-hi);
    border-radius: 14px; overflow: hidden;
}
.bwl-table { width: 100%; border-collapse: collapse; }
/* Astra-Basistabellen-Borders (main.min.css lädt auch standalone) neutralisieren */
.bwl-table th, .bwl-table td {
    border-left: none !important; border-right: none !important; border-top: none !important;
    background: transparent;
}
.bwl-table thead th {
    font-family: var(--bmi-font); font-size: 10.5px; font-weight: 800;
    letter-spacing: 1.8px; text-transform: uppercase; color: var(--bmi-gold);
    text-align: left; padding: 13px 18px;
    background: var(--bmi-bg-deep);
    border-bottom: 1px solid var(--bmi-border-hi);
    cursor: pointer; user-select: none; white-space: nowrap;
}
.bwl-table thead th .dir { font-size: 9px; margin-left: 4px; color: var(--bmi-text-muted); }
.bwl-table thead th.num { text-align: right; }
.bwl-table thead th.bwl-th-x { width: 52px; cursor: default; }
.bwl-row { cursor: pointer; transition: background .12s ease; }
.bwl-row:hover { background: rgba(212,175,55,.05); }
.bwl-row td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,.045);
    vertical-align: middle;
}
.bwl-row:last-child td { border-bottom: none; }
.bwl-name {
    font-family: var(--bmi-font); font-size: 14px; font-weight: 700;
    color: var(--bmi-text); line-height: 1.3;
    display: flex; align-items: center; gap: 10px; min-width: 0;
}
.bwl-name .go {
    color: var(--bmi-faint); flex: 0 0 auto; display: inline-flex;
    opacity: 0; transform: translateX(-4px);
    transition: opacity .15s ease, transform .15s ease, color .15s ease;
}
.bwl-row:hover .bwl-name .go { opacity: 1; transform: translateX(0); color: var(--bmi-gold); }
.bwl-price {
    font-family: var(--bmi-font-mono); font-size: 14px; font-weight: 600;
    color: var(--bmi-text); text-align: right; white-space: nowrap;
}
.bwl-chg { text-align: right; white-space: nowrap; }
.bwl-chg-pill {
    display: inline-flex; align-items: center; gap: 5px;
    font-family: var(--bmi-font-mono); font-size: 12.5px; font-weight: 700;
    border-radius: 7px; padding: 5px 10px;
}
.bwl-chg-pill.up   { color: var(--bmi-up);   background: rgba(0,217,126,.10); }
.bwl-chg-pill.down { color: var(--bmi-down); background: rgba(255,59,95,.10); }
.bwl-chg-pill.flat { color: var(--bmi-text-muted); background: rgba(255,255,255,.05); }
.bwl-x { text-align: center; }
.bwl-x button {
    background: none; border: none; color: var(--bmi-faint);
    font-size: 15px; line-height: 1; padding: 7px 9px; border-radius: 7px;
    transition: color .15s ease, background .15s ease;
}
.bwl-x button:hover { color: var(--bmi-down); background: rgba(255,59,95,.12); }

/* Mobile: Preis+Change stapeln, Padding kompakt */
@media (max-width: 640px) {
    .bwl-main { padding: 16px 10px 32px; }
    .bwl-title { font-size: 21px; }
    .bwl-table thead th, .bwl-row td { padding: 12px 12px; }
    .bwl-name { font-size: 13px; }
    .bwl-price { font-size: 13px; }
    .bwl-chg-pill { font-size: 11.5px; padding: 4px 8px; }
}

/* ------- Empty State ------- */
.bwl-empty {
    text-align: center; padding: 56px 20px;
    background: var(--bmi-panel); border: 1px dashed var(--bmi-border-hi);
    border-radius: 14px; color: var(--bmi-text-muted);
    font-family: var(--bmi-font);
}
.bwl-empty-icon {
    width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(212,175,55,.10); color: var(--bmi-gold);
    border: 1px solid rgba(212,175,55,.25);
}
.bwl-empty p { margin: 0 0 6px; font-size: 14px; }
.bwl-empty small { font-size: 12px; color: var(--bmi-faint); }

/* ------- Login-Gate ------- */
.bwl-gate {
    text-align: center; padding: 64px 24px;
    background: var(--bmi-panel); border: 1px solid var(--bmi-border-hi);
    border-radius: 16px; margin-top: 8vh;
    font-family: var(--bmi-font);
}
.bwl-gate-icon {
    width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(212,175,55,.10); color: var(--bmi-gold);
    border: 1px solid rgba(212,175,55,.3);
}
.bwl-gate-title { font-size: 24px; font-weight: 800; color: var(--bmi-text); margin: 0 0 8px; }
.bwl-gate-desc { font-size: 14px; color: var(--bmi-text-muted); max-width: 420px; margin: 0 auto 22px; line-height: 1.55; }
.bwl-gate-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.bwl-btn {
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--bmi-font); font-size: 13.5px; font-weight: 800;
    padding: 12px 24px; border-radius: 10px; white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.bwl-btn--gold {
    background: linear-gradient(135deg, #D4AF37, #E6C654);
    color: #0a0e1a !important;
    box-shadow: 0 2px 12px rgba(212,175,55,.4);
}
.bwl-btn--gold:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(212,175,55,.5); }
.bwl-btn--ghost {
    border: 1px solid var(--bmi-border-hi); color: var(--bmi-text-muted) !important;
}
.bwl-btn--ghost:hover { border-color: rgba(212,175,55,.45); color: var(--bmi-gold) !important; }

/* ------- Toast ------- */
.bwl-toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 99999;
    font-family: var(--bmi-font); font-size: 13.5px; font-weight: 700;
    color: #fff; padding: 12px 20px; border-radius: 10px;
    box-shadow: 0 8px 26px rgba(0,0,0,.45);
    opacity: 0; transition: opacity .25s ease, transform .25s ease;
    transform: translateY(8px); pointer-events: none;
}
.bwl-toast.show { opacity: 1; transform: translateY(0); }

/* Zeilen-Einblendung */
@keyframes bwl-rowin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.bwl-row { animation: bwl-rowin .25s ease both; }
