/* ===== BTC DASHBOARD - PROFESSIONAL UX ===== */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a1f35;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: rgba(139, 92, 246, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.btc-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* ===== HEADER ===== */
.btc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--bg-card);
}

.btc-title {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btc-last-updated {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===== SECTIONS ===== */
.btc-section {
    margin-bottom: 32px;
}

.btc-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== SIGNAL CARD (Purple) ===== */
.btc-signal-card-clean {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.4);
    position: relative;
}

.btc-signal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.btc-signal-badge {
    font-size: 36px;
    font-weight: 900;
    padding: 16px 48px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.btc-signal-badge.BUY {
    color: var(--success);
}

.btc-signal-badge.SELL {
    color: var(--danger);
}

.btc-signal-badge.HOLD {
    color: var(--warning);
}

.btc-signal-confidence {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: white;
    margin-bottom: 12px;
}

.btc-signal-brief {
    text-align: center;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* ===== GRID LAYOUTS ===== */
.btc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.btc-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

/* ===== CLEAN DATA CARDS ===== */
.btc-card-clean {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.btc-card-clean:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.btc-card-header-clean {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.btc-card-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.btc-card-value-large {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.btc-card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.btc-card-source {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.btc-source-link {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btc-source-link:hover {
    text-decoration: underline;
}

/* ===== FULL WIDTH CARDS ===== */
.btc-card-full {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

/* ===== INFO ICON (Small, Clean) ===== */
.btc-info-icon-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btc-info-icon-small:hover {
    transform: scale(1.15);
    background: var(--accent-hover);
}

/* ===== STABLE MODAL SYSTEM ===== */
/* This creates a completely isolated layer above EVERYTHING */
.btc-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999999 !important;
    isolation: isolate;
}

.btc-modal-overlay.active {
    display: block;
}

.btc-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.btc-modal-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 90%;
    max-width: 600px;
    height: 100vh;
    background: var(--bg-secondary);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.btc-modal-header {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.btc-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.btc-modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btc-modal-close:hover {
    background: var(--danger);
    transform: rotate(90deg);
}

.btc-modal-body {
    padding: 24px;
}

.btc-modal-section {
    margin-bottom: 32px;
}

.btc-modal-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
}

.btc-modal-section p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.btc-modal-section ul {
    list-style: none;
    padding: 0;
}

.btc-modal-section li {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.btc-modal-section li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* ===== CONFIDENCE BAR ===== */
.btc-confidence-bar-container {
    margin: 20px 0;
}

.btc-confidence-bar {
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, var(--danger) 0%, var(--warning) 50%, var(--success) 100%);
    border-radius: 4px;
    position: relative;
    margin-bottom: 8px;
}

.btc-confidence-fill {
    position: absolute;
    top: -4px;
    height: 16px;
    width: 16px;
    background: white;
    border: 3px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
}

.btc-confidence-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.btc-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
}

.btc-badge.high {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.btc-badge.medium {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.btc-badge.low {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* ===== STATS DISPLAY ===== */
.btc-stats-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.btc-stat {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.btc-stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.btc-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== TAGS ===== */
.btc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.btc-tag {
    padding: 6px 12px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--accent);
    border-radius: 20px;
    font-size: 12px;
    color: var(--accent);
}

/* ===== KEY LEVELS ===== */
.btc-levels-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 32px;
    align-items: center;
}

.btc-levels-column h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.btc-level-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btc-level-item.resistance {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--danger);
}

.btc-level-item.support {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--success);
}

.btc-level-price {
    font-weight: 700;
    color: var(--text-primary);
}

.btc-level-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.btc-levels-current {
    text-align: center;
}

.btc-current-price {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
}

.btc-current-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* ===== EVENTS ===== */
.btc-events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btc-event-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
}

.btc-event-item.high {
    border-left: 4px solid var(--danger);
}

.btc-event-item.medium {
    border-left: 4px solid var(--warning);
}

.btc-event-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.btc-event-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.btc-event-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.btc-event-impact {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ===== NARRATIVE / ANALYSIS ===== */
.btc-narrative {
    font-size: 16px;
    line-height: 1;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.btc-narrative h1,
.btc-narrative h2,
.btc-narrative h3,
.btc-narrative h4 {
    color: var(--accent);
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 700;
}

.btc-narrative h1 { font-size: 24px; }
.btc-narrative h2 { font-size: 20px; }
.btc-narrative h3 { font-size: 18px; }
.btc-narrative h4 { font-size: 16px; }

.btc-narrative p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.btc-narrative strong {
    color: var(--text-primary);
    font-weight: 600;
}

.btc-narrative em {
    color: var(--accent);
    font-style: normal;
}

.btc-narrative ul,
.btc-narrative ol {
    margin: 16px 0;
    padding-left: 24px;
    color: var(--text-secondary);
}

.btc-narrative li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.btc-narrative code {
    background: rgba(139, 92, 246, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    color: var(--accent);
}

.btc-narrative blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 16px;
    margin: 20px 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* Analysis highlights */
.btc-analysis-highlight {
    background: rgba(139, 92, 246, 0.1);
    border-left: 4px solid var(--accent);
    padding: 16px;
    margin: 16px 0;
    border-radius: 8px;
}

.btc-analysis-highlight strong {
    color: var(--accent);
}

/* ===== WATCH LIST ===== */
.btc-watch-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btc-watch-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.btc-watch-bullet {
    color: var(--accent);
    font-weight: 700;
}

.btc-watch-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== TRADING PLAN ===== */
.btc-trading-plan {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.btc-plan-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.btc-plan-row:last-child {
    border-bottom: none;
}

.btc-plan-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.btc-plan-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.btc-plan-list {
    list-style: none;
    padding: 0;
    margin-top: 8px;
}

.btc-plan-list li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
}

/* ===== DISCLAIMER ===== */
.btc-disclaimer {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    padding: 32px;
    margin-top: 40px;
}

.btc-disclaimer-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 20px;
    text-align: center;
}

.btc-disclaimer-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.btc-disclaimer-content p {
    margin-bottom: 16px;
}

.btc-disclaimer-warning {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger);
    padding: 16px;
    border-radius: 8px;
    color: var(--text-primary);
    margin: 16px 0;
}

.btc-disclaimer-warning strong {
    color: var(--danger);
}

.btc-disclaimer-contact {
    background: rgba(139, 92, 246, 0.08);
    border-left: 4px solid var(--accent);
    padding: 16px;
    border-radius: 8px;
    color: var(--text-primary);
}

.btc-disclaimer-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.btc-disclaimer-link:hover {
    border-bottom-color: var(--accent);
}

/* ===== LOADING ===== */
.btc-loading {
    text-align: center;
    padding: 60px 20px;
}

.btc-loading-spinner {
    display: inline-block;
    width: 60px;
    height: 60px;
    border: 4px solid rgba(139, 92, 246, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btc-loading-text {
    margin-top: 20px;
    font-size: 16px;
    color: var(--text-secondary);
}

/* ===== CHART PLACEHOLDER ===== */
.btc-chart-placeholder {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 60px 24px;
    text-align: center;
}

.btc-chart-placeholder p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* TradingView Chart Container */
.btc-chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    overflow: hidden;
}

.tradingview-widget-container {
    border-radius: 8px;
    overflow: hidden;
}

.tradingview-widget-container__widget {
    height: 100% !important;
}

.btc-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.btc-link:hover {
    text-decoration: underline;
}

/* ===== NOTE TEXT ===== */
.btc-note {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .btc-dashboard {
        padding: 16px;
    }
    
    .btc-grid,
    .btc-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .btc-signal-badge {
        font-size: 24px;
        padding: 12px 32px;
    }
    
    .btc-modal-panel {
        width: 100%;
        max-width: 100%;
    }
    
    .btc-levels-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .btc-event-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}