/* ═══════════════════════════════════════════════════════════════════
 * Quick Wins CSS
 * - F1: Setups badge (pulse) + Quick Preview dropdown
 * - F2: Mini Watchlist
 * - F4: Performance Dashboard
 * ═══════════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════════════
 * F1: Setups Notification Badge
 * ═══════════════════════════════════════════════════════════════════ */

#tb-setups-count.has-active {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
    font-weight: 800;
    padding: 1px 7px !important;
    border-radius: 10px !important;
    margin-right: 4px !important;
    animation: setupsBadgePulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
}

@keyframes setupsBadgePulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
        transform: scale(1.05);
    }
}


/* Quick Preview Dropdown */
.setups-quick-preview {
    position: fixed;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 12px;
    padding: 8px;
    z-index: 10001;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    max-height: 70vh;
    overflow-y: auto;
}

.setups-quick-preview.show {
    display: block;
    animation: sqpFadeIn 0.2s ease;
}

@keyframes sqpFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.sqp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    margin-bottom: 6px;
    color: #c4b5fd;
    font-weight: 700;
    font-size: 0.9rem;
}

.sqp-close {
    background: transparent;
    border: none;
    color: rgba(203, 213, 225, 0.7);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}

.sqp-close:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #c4b5fd;
}

.sqp-loading,
.sqp-empty {
    padding: 16px;
    text-align: center;
    color: rgba(203, 213, 225, 0.6);
    font-size: 0.85rem;
}

.sqp-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.sqp-item {
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sqp-item:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.4);
}

.sqp-row1 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.sqp-symbol {
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
}

.sqp-direction {
    font-size: 0.78rem;
    font-weight: 700;
}

.sqp-tier {
    margin-right: auto;
    font-size: 0.7rem;
    padding: 1px 8px;
    border-radius: 8px;
    font-weight: 700;
}

.tier-great { background: #10b981; color: white; }
.tier-good { background: #3b82f6; color: white; }
.tier-caution { background: #fbbf24; color: black; }
.tier-avoid { background: #ef4444; color: white; }
.tier-unknown { background: rgba(148, 163, 184, 0.3); color: #cbd5e1; }

.sqp-row2 {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    color: rgba(203, 213, 225, 0.7);
}

.sqp-status {
    font-weight: 600;
}

.sqp-entry {
    font-family: 'JetBrains Mono', monospace;
    color: #fbbf24;
}

.sqp-more {
    text-align: center;
    color: rgba(203, 213, 225, 0.6);
    font-size: 0.75rem;
    padding: 6px;
}

.sqp-open-btn {
    width: 100%;
    padding: 9px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82rem;
    margin-top: 4px;
}

.sqp-open-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}


/* Setup Toast (fallback) */
@keyframes setupToastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes setupToastOut {
    to { opacity: 0; transform: translateX(20px); }
}

.setup-toast-success {
    border-color: #10b981 !important;
    color: #10b981 !important;
}

.setup-toast-error {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}


/* ═══════════════════════════════════════════════════════════════════
 * F2: Mini Watchlist
 * ═══════════════════════════════════════════════════════════════════ */

.mini-watchlist {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.04));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.mini-watchlist::-webkit-scrollbar {
    height: 4px;
}

.mw-label {
    flex-shrink: 0;
    font-weight: 700;
    color: #fbbf24;
    font-size: 0.82rem;
    white-space: nowrap;
}

.mw-pills {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.mw-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
}

.mw-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.mw-pill-buy {
    border-color: rgba(16, 185, 129, 0.4);
}

.mw-pill-buy:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.7);
}

.mw-pill-sell {
    border-color: rgba(239, 68, 68, 0.4);
}

.mw-pill-sell:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.7);
}

.mw-pill-neutral {
    border-color: rgba(148, 163, 184, 0.3);
}

.mw-arrow {
    font-size: 0.95rem;
    line-height: 1;
}

.mw-symbol {
    font-weight: 700;
    color: #fff;
}

.mw-conf {
    font-weight: 700;
    color: #fbbf24;
    font-size: 0.75rem;
}

.mw-breakout {
    position: absolute;
    top: -6px;
    right: -4px;
    font-size: 0.85rem;
    animation: mwBreakoutPulse 1.5s ease-in-out infinite;
}

@keyframes mwBreakoutPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}


/* ═══════════════════════════════════════════════════════════════════
 * F4: Performance Dashboard
 * ═══════════════════════════════════════════════════════════════════ */

.performance-dashboard {
    margin: 16px 0;
    padding: 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.04));
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 12px;
}

.pd-header {
    font-weight: 700;
    color: #c4b5fd;
    font-size: 0.95rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.pd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.pd-card {
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    text-align: center;
    transition: all 0.2s ease;
}

.pd-card:hover {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.pd-card-icon {
    font-size: 1.3rem;
    line-height: 1;
    margin-bottom: 4px;
}

.pd-card-label {
    font-size: 0.72rem;
    color: rgba(203, 213, 225, 0.6);
    margin-bottom: 4px;
    font-weight: 600;
}

.pd-card-value {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 2px;
    font-family: 'JetBrains Mono', monospace;
}

.pd-card-sub {
    font-size: 0.7rem;
    color: rgba(203, 213, 225, 0.55);
}


/* Direction comparison */
.pd-direction {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.pd-dir-card {
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid;
}

.pd-buy {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
}

.pd-sell {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
}

.pd-dir-label {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.pd-buy .pd-dir-label { color: #10b981; }
.pd-sell .pd-dir-label { color: #ef4444; }

.pd-dir-rate {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.pd-buy .pd-dir-rate { color: #10b981; }
.pd-sell .pd-dir-rate { color: #ef4444; }

.pd-dir-sub {
    font-size: 0.72rem;
    color: rgba(203, 213, 225, 0.6);
}


/* Recent trend */
.pd-trend {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
}

.pd-trend-label {
    font-size: 0.78rem;
    color: rgba(203, 213, 225, 0.7);
    font-weight: 600;
    flex-shrink: 0;
}

.pd-trend-vis {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.trend-w,
.trend-l {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 800;
}

.trend-w {
    background: #10b981;
    color: white;
}

.trend-l {
    background: #ef4444;
    color: white;
}


/* ═══════════════════════════════════════════════════════════════════
 * Mobile responsive
 * ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .mini-watchlist {
        padding: 8px;
        gap: 8px;
    }
    
    .mw-label {
        font-size: 0.75rem;
    }
    
    .mw-pill {
        padding: 6px 10px;
        font-size: 0.78rem;
    }
    
    .pd-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .pd-card {
        padding: 8px;
    }
    
    .pd-card-value {
        font-size: 0.95rem;
    }
    
    .pd-card-icon {
        font-size: 1.1rem;
    }
    
    .pd-direction {
        gap: 8px;
    }
    
    .pd-dir-rate {
        font-size: 1.3rem;
    }
    
    .setups-quick-preview {
        max-width: calc(100vw - 16px);
    }
}
