/* ===== RESET & VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #000000;
    --secondary-bg: #0a0a0a;
    --card-bg: #111111;
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --accent-gold: #f6d55c;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --success: #48bb78;
    --warning: #ed8936;
    --error: #f56565;
    --border: #333333;
    --shadow: rgba(0, 0, 0, 0.6);
}

/* ===== GLOBAL STYLES ===== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 16px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* ===== HEADER ===== */
.header {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 16px var(--shadow);
    position: relative;
    backdrop-filter: blur(20px);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 12px 12px 0 0;
}

.header h1 {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 4px;
}

.refresh-controls {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-status {
    background: var(--secondary-bg);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    line-height: 1.4;
}

.refresh-status div {
    margin-bottom: 2px;
}

.refresh-status div:last-child {
    margin-bottom: 0;
}

/* ===== BUTTONS ===== */
.btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--text-primary);
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-gold {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-secondary));
    color: var(--primary-bg);
    box-shadow: 0 4px 12px rgba(246, 213, 92, 0.2);
}

.btn-gold:hover {
    box-shadow: 0 8px 25px rgba(246, 213, 92, 0.4);
}

.refresh-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--text-primary);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.refresh-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.refresh-btn:disabled {
    background: #4a5568;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== CARDS & CONTAINERS ===== */
.dashboard-card,
.coins-container,
.hidden-gems-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px var(--shadow);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.favorites-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px var(--shadow);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.ml-status-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 2px 6px var(--shadow);
    backdrop-filter: blur(6px);
    transition: all 0.2s ease;
    margin-bottom: 12px;
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, var(--card-bg), rgba(102, 126, 234, 0.03));
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.ml-status-container h2 {
    font-size: 0.7rem;
    margin: 0 0 4px 0;
    font-weight: 600;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ml-controls {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    justify-content: flex-end;
}

.ml-controls button {
    font-size: 0.6rem;
    padding: 4px 8px;
    line-height: 1.1;
}

.ml-status-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 0.6rem;
    line-height: 1.2;
}

.ml-chip {
    background: rgba(102,126,234,0.12);
    border: 1px solid rgba(102,126,234,0.3);
    color: #667eea;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ml-chip.bad { background: rgba(229,62,62,0.12); border-color: rgba(229,62,62,0.4); color: #e53e3e; }
.ml-chip.warn { background: rgba(214,158,46,0.15); border-color: rgba(214,158,46,0.4); color: #d69e2e; }
.ml-chip.good { background: rgba(72,187,120,0.15); border-color: rgba(72,187,120,0.4); color: #48bb78; }

.ml-expand-toggle {
    cursor: pointer;
    background: none;
    border: none;
    color: #667eea;
    font-size: 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
}

.ml-status-details { margin-top: 6px; display: none; }
.ml-status-details.open { display: block; }

.ml-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 4px;
    margin: 4px 0;
}

.ml-status-item {
    background: rgba(45,55,72,0.4);
    border-radius: 4px;
    padding: 4px 6px;
    text-align: left;
    font-size: 0.6rem;
    line-height: 1.15;
}

.ml-status-item strong {
    color: #667eea;
    font-size: 0.55rem;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
    letter-spacing: .4px;
}

.ml-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin: 8px 0;
}

.ml-status-item {
    background: rgba(45, 55, 72, 0.5);
    border-radius: 6px;
    padding: 8px 10px;
    text-align: center;
    font-size: 0.75rem;
}

.ml-status-item strong {
    color: #667eea;
    font-size: 0.7rem;
    display: block;
    margin-bottom: 2px;
}

.hidden-gems-container {
    border-color: var(--accent-gold);
    background: linear-gradient(135deg, var(--card-bg), rgba(246, 213, 92, 0.05));
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.favorites-content {
    display: none;
}

.favorites-content.has-favorites {
    display: block;
}

.coins-header {
    margin-bottom: 12px;
}

.coins-header h2 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.coins-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* ===== TABLES ===== */
.coins-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 16px;
    background: var(--secondary-bg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.coins-table th,
.coins-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
}

.coins-table th {
    background: var(--card-bg);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.coins-table tbody tr {
    transition: all 0.2s ease;
    cursor: pointer;
}

.coins-table tbody tr:hover {
    background: var(--card-bg);
    transform: translateX(4px);
    box-shadow: 4px 0 0 var(--accent-primary);
}

/* ===== COIN STYLES ===== */
.coin-symbol {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 1rem;
}

.coin-name {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.price {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.price-change {
    font-weight: 500;
    font-size: 0.875rem;
    padding: 4px 8px;
    border-radius: 8px;
}

.positive {
    color: #68d391;
    background-color: rgba(104, 211, 145, 0.1);
    border: 1px solid rgba(104, 211, 145, 0.2);
}

.negative {
    color: #fc8181;
    background-color: rgba(252, 129, 129, 0.1);
    border: 1px solid rgba(252, 129, 129, 0.2);
}

/* ===== SCORE BADGES ===== */
.score {
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 10px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.score-high {
    background: linear-gradient(135deg, #38a169 0%, #48bb78 100%);
    box-shadow: 0 2px 8px rgba(56, 161, 105, 0.3);
}

.score-medium {
    background: linear-gradient(135deg, #d69e2e 0%, #ecc94b 100%);
    box-shadow: 0 2px 8px rgba(214, 158, 46, 0.3);
}

.score-low {
    background: linear-gradient(135deg, #e53e3e 0%, #fc8181 100%);
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
}

/* ===== COIN CARDS GRID ===== */
.coins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.coin-card {
    background: linear-gradient(170deg, #151520 0%, #0d0d14 100%);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.coin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 1;
}

.coin-card::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.08) 0%, transparent 100%);
    pointer-events: none;
}

.coin-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.15), 0 2px 8px rgba(0,0,0,0.3);
    border-color: var(--accent-primary);
}

.coin-card:hover::before {
    opacity: 1;
}

.coin-card.score-high {
    border-left: 3px solid #48bb78;
}
.coin-card.score-high::before {
    background: linear-gradient(90deg, #38a169, #48bb78);
}

.coin-card.score-medium {
    border-left: 3px solid #ecc94b;
}
.coin-card.score-medium::before {
    background: linear-gradient(90deg, #d69e2e, #ecc94b);
}

.coin-card.score-low {
    border-left: 3px solid #fc8181;
}
.coin-card.score-low::before {
    background: linear-gradient(90deg, #e53e3e, #fc8181);
}

.coin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px 8px;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.coin-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.favorite-btn-card {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-btn-card:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: gold;
    transform: scale(1.1);
}

.favorite-btn-card.active {
    background: rgba(255, 215, 0, 0.2);
    border-color: gold;
    color: gold;
}

.coin-identity {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.coin-symbol-large {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.coin-name-small {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 1px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.badge {
    font-size: 8px;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.badge-new {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.badge-ai {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.coin-card-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 12px 10px;
}

.price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin-bottom: 6px;
}

.price-large {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.price-change {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 5px;
}

.score-section {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.score-header {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.score-label {
    display: none;
}

.score-value {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 30px;
}

.score-bar {
    height: 4px;
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.score-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
    position: relative;
}

.score-fill.score-high {
    background: linear-gradient(90deg, #38a169, #48bb78);
    box-shadow: 0 0 10px rgba(56, 161, 105, 0.5);
}

.score-fill.score-medium {
    background: linear-gradient(90deg, #d69e2e, #ecc94b);
    box-shadow: 0 0 10px rgba(214, 158, 46, 0.5);
}

.score-fill.score-low {
    background: linear-gradient(90deg, #e53e3e, #fc8181);
    box-shadow: 0 0 10px rgba(229, 62, 62, 0.5);
}

/* ===== ML REASONING SECTION ===== */
.ml-reasoning-section {
    margin-top: 6px;
    border-top: 1px solid rgba(102, 126, 234, 0.15);
    padding-top: 6px;
}

.ml-reasoning-toggle {
    width: 100%;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.ml-reasoning-toggle:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
}

.ml-reasoning-toggle .arrow {
    font-size: 9px;
    transition: transform 0.2s ease;
}

.ml-reasoning-content {
    margin-top: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ml-prediction-detail {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prediction-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.prediction-row .label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 10px;
}

.prediction-row .value {
    font-weight: 700;
    font-size: 11px;
}

.prediction-row .value.positive {
    color: #68d391;
}

.prediction-row .value.negative {
    color: #fc8181;
}

.prediction-row .value.neutral {
    color: #a0aec0;
}

/* ===== INVESTMENT HIGHLIGHTS ===== */
.investment-highlights {
    margin-top: 12px;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-left: 3px solid var(--accent-primary);
    border-radius: 6px;
    font-size: 11px;
}

.highlights-label {
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.highlights-text {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 11px;
}

/* ===== NEW INLINE ML/AI ANALYSIS STYLES ===== */
/* Legacy CSS removed - now using unified-ai-analysis */

/* ML Insights Inline */
.ml-insights-inline {
    margin-top: 12px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(246, 213, 92, 0.08) 0%, rgba(246, 213, 92, 0.04) 100%);
    border-left: 3px solid var(--accent-gold);
    border-radius: 6px;
}

.insights-label {
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insights-text {
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* ===== PHASE 4: UNIFIED AI ANALYSIS STYLES ===== */
.unified-ai-analysis {
    margin-top: 6px;
    padding: 8px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.10) 0%, rgba(118, 75, 162, 0.06) 100%);
    border-radius: 6px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    animation: fadeIn 0.3s ease;
}

.unified-ai-analysis.loading-analysis {
    background: linear-gradient(135deg, rgba(160, 174, 192, 0.06) 0%, rgba(160, 174, 192, 0.03) 100%);
    border-color: rgba(160, 174, 192, 0.15);
}

.ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 10px;
    padding: 4px;
}

.loading-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.15);
}

.ai-title {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 10px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-icon {
    font-size: 12px;
}

.ai-gem-score {
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
}

.ai-gem-score.score-high {
    background: rgba(72, 187, 120, 0.2);
    color: var(--success);
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.ai-gem-score.score-medium {
    background: rgba(237, 137, 54, 0.2);
    color: var(--warning);
    border: 1px solid rgba(237, 137, 54, 0.3);
}

.ai-gem-score.score-low {
    background: rgba(245, 101, 101, 0.2);
    color: var(--error);
    border: 1px solid rgba(245, 101, 101, 0.3);
}

.ai-sentiment {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
}

.ai-sentiment.positive {
    background: rgba(72, 187, 120, 0.2);
    color: var(--success);
}

.ai-sentiment.negative {
    background: rgba(245, 101, 101, 0.2);
    color: var(--error);
}

.ai-sentiment.neutral {
    background: rgba(237, 137, 54, 0.2);
    color: var(--warning);
}

.ai-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.ai-metric {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.metric-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.metric-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-value.score-high {
    color: var(--success);
}

.metric-value.score-medium {
    color: var(--warning);
}

.metric-value.score-low {
    color: var(--error);
}

.metric-value.positive {
    color: var(--success);
}

.metric-value.negative {
    color: var(--error);
}

.metric-value.neutral {
    color: var(--warning);
}

.ai-insights {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.insight-group {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    padding: 8px;
}

.insight-group.positive {
    border-left: 3px solid var(--success);
}

.insight-group.negative {
    border-left: 3px solid var(--error);
}

.insight-title {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.insight-group.positive .insight-title {
    color: var(--success);
}

.insight-group.negative .insight-title {
    color: var(--error);
}

.insight-item {
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.insight-item:last-child {
    margin-bottom: 0;
}

.ai-summary {
    font-size: 10px;
    line-height: 1.4;
    color: var(--text-secondary);
    padding: 4px 0;
}

.ai-details-btn {
    width: 100%;
    padding: 7px;
    margin-top: 6px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ai-details-btn:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 126, 234, 0.3);
}

.ai-details-btn .arrow {
    font-size: 9px;
}

.agent-details {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agent-detail-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 6px;
    padding: 10px;
}

.agent-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.agent-detail-name {
    font-weight: 700;
    font-size: 11px;
    color: var(--accent-primary);
}

.agent-detail-confidence {
    font-size: 10px;
    color: var(--text-secondary);
}

.agent-detail-findings {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.agent-detail-findings div {
    font-size: 10px;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* ===== END UNIFIED AI ANALYSIS ===== */

/* ===== COMPACT AI ANALYSIS (FAVORITES) ===== */
.unified-ai-analysis.compact {
    padding: 7px;
    margin-top: 6px;
}

.ai-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.ai-score-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 8px;
    border-radius: 6px;
    min-width: 56px;
}

.ai-score-badge.score-high {
    background: rgba(72, 187, 120, 0.25);
    border: 1.5px solid var(--success);
}

.ai-score-badge.score-medium {
    background: rgba(237, 137, 54, 0.25);
    border: 1.5px solid var(--warning);
}

.ai-score-badge.score-low {
    background: rgba(245, 101, 101, 0.25);
    border: 1.5px solid var(--error);
}

.score-number {
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 2px;
}

.score-action {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    opacity: 0.9;
}

.ai-confidence-risk {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.confidence-indicator,
.opportunity-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
}

.opportunity-badge.positive {
    color: var(--success);
}

.opportunity-badge.negative {
    color: var(--error);
}

.opportunity-badge.neutral {
    color: var(--text-secondary);
}

.ai-summary-text {
    font-size: 9px;
    line-height: 1.4;
    color: var(--text-secondary);
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    margin-bottom: 5px;
    border-left: 2px solid var(--accent);
}

.ai-summary-compact {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 5px;
}

.summary-item {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    font-size: 9px;
    line-height: 1.3;
    padding: 3px 4px;
    border-radius: 4px;
}

.summary-item.positive {
    background: rgba(72, 187, 120, 0.1);
}

.summary-item.negative {
    background: rgba(245, 101, 101, 0.1);
}

.summary-icon {
    flex-shrink: 0;
    font-weight: 700;
    margin-top: 1px;
}

.summary-item.positive .summary-icon {
    color: var(--success);
}

.summary-item.negative .summary-icon {
    color: var(--error);
}

.summary-text {
    color: var(--text-secondary);
}

.ai-expand-btn {
    width: 100%;
    padding: 4px;
    margin-top: 3px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.12);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.ai-expand-btn:hover {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(102, 126, 234, 0.25);
}

.ai-expand-btn .arrow {
    font-size: 7px;
}

.agent-details-compact {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    padding: 8px;
}

.detail-header {
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-header.positive {
    color: var(--success);
}

.detail-header.negative {
    color: var(--error);
}

.detail-item {
    font-size: 10px;
    line-height: 1.4;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.detail-item:last-child {
    margin-bottom: 0;
}
/* ===== END COMPACT AI ANALYSIS ===== */

/* ===== PHASE 4: MULTI-AGENT ANALYSIS STYLES ===== */
.multi-agent-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.multi-agent-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
}

.multi-agent-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.multi-agent-btn.analyzed {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.15) 0%, rgba(72, 187, 120, 0.1) 100%);
    border-color: rgba(72, 187, 120, 0.3);
}

.multi-agent-container {
    margin-top: 12px;
}

.multi-agent-analysis {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    padding: 16px;
    animation: fadeIn 0.3s ease;
}

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

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.agent-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

.agent-icon {
    font-size: 18px;
}

.agent-score {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
}

.agent-score.score-high {
    background: rgba(72, 187, 120, 0.2);
    color: var(--success);
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.agent-score.score-medium {
    background: rgba(237, 137, 54, 0.2);
    color: var(--warning);
    border: 1px solid rgba(237, 137, 54, 0.3);
}

.agent-score.score-low {
    background: rgba(245, 101, 101, 0.2);
    color: var(--error);
    border: 1px solid rgba(245, 101, 101, 0.3);
}

.agent-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.agent-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.agent-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.agent-value {
    font-weight: 600;
    color: var(--text-primary);
}

.agent-value.positive {
    color: var(--success);
}

.agent-value.negative {
    color: var(--error);
}

.agent-value.neutral {
    color: var(--warning);
}

.agent-section {
    margin-bottom: 12px;
}

.agent-section-title {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.agent-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.agent-list li {
    font-size: 12px;
    line-height: 1.5;
    padding-left: 8px;
    border-left: 2px solid;
}

.agent-list.positive li {
    border-color: var(--success);
    color: var(--text-secondary);
}

.agent-list.negative li {
    border-color: var(--error);
    color: var(--text-secondary);
}

.agent-toggle-btn {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.agent-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.agent-toggle-btn .arrow {
    font-size: 10px;
}

.agent-breakdown {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agent-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
}

.agent-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.agent-name {
    font-weight: 700;
    font-size: 12px;
    color: var(--accent-primary);
}

.agent-confidence {
    font-size: 11px;
    color: var(--text-secondary);
}

.agent-findings {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.agent-finding {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.agent-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(102, 126, 234, 0.15);
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
}

.loading-spinner {
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== END MULTI-AGENT STYLES ===== */

.insights-text {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 11px;
}

/* ===== END NEW INLINE STYLES ===== */

.confidence-bar {
    flex: 1;
    max-width: 120px;
    height: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.6s ease;
}

.confidence-fill.high {
    background: linear-gradient(90deg, #38a169, #48bb78);
}

.confidence-fill.medium {
    background: linear-gradient(90deg, #d69e2e, #ecc94b);
}

.confidence-fill.low {
    background: linear-gradient(90deg, #e53e3e, #fc8181);
}

.confidence-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 9px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.direction-indicator {
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
}

.direction-indicator.positive {
    background: rgba(104, 211, 145, 0.2);
    color: #68d391;
    border: 1px solid rgba(104, 211, 145, 0.3);
}

.direction-indicator.negative {
    background: rgba(252, 129, 129, 0.2);
    color: #fc8181;
    border: 1px solid rgba(252, 129, 129, 0.3);
}

.direction-indicator.neutral {
    background: rgba(160, 174, 192, 0.2);
    color: #a0aec0;
    border: 1px solid rgba(160, 174, 192, 0.3);
}

.ml-unavailable {
    text-align: center;
    padding: 8px;
    color: var(--text-secondary);
    font-size: 10px;
}

.ml-unavailable span {
    display: block;
    margin-bottom: 2px;
}

.ml-unavailable small {
    font-size: 9px;
    color: rgba(160, 174, 192, 0.7);
}

/* AI Sentiment specific styles */
.ai-sentiment-section {
    margin-top: 6px;
    border-top: 1px solid rgba(102, 126, 234, 0.15);
    padding-top: 6px;
}

.sentiment-points {
    margin-top: 10px;
    padding: 8px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 4px;
    border-left: 3px solid rgba(102, 126, 234, 0.3);
}

.sentiment-points strong {
    display: block;
    margin-bottom: 6px;
    font-size: 10px;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sentiment-points ul {
    margin: 0;
    padding-left: 18px;
}

.sentiment-points li {
    font-size: 10px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.sentiment-reasoning {
    margin-top: 10px;
    padding: 8px;
    background: rgba(118, 75, 162, 0.05);
    border-radius: 4px;
    border-left: 3px solid rgba(118, 75, 162, 0.3);
}

.sentiment-reasoning strong {
    display: block;
    margin-bottom: 6px;
    font-size: 10px;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sentiment-reasoning p {
    font-size: 10px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .coins-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .coin-card-header {
        flex-direction: column;
        gap: 6px;
    }
    
    .badges {
        align-self: flex-start;
    }
}

/* ===== ANIMATIONS & LOADING ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    gap: 12px;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.fade-in { animation: fadeIn 0.6s ease forwards; }
.slide-in { animation: slideInLeft 0.4s ease forwards; }

/* ===== STATUS NOTIFICATIONS ===== */
.status-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: none;
}

.status-toast {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 300px;
    box-shadow: 0 8px 32px var(--shadow);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-toast.show { transform: translateX(0); }
.status-toast.success { border-left: 4px solid var(--success); }
.status-toast.error { border-left: 4px solid var(--error); }
.status-toast.info { border-left: 4px solid var(--accent-primary); }
.status-toast.warning { border-left: 4px solid var(--warning); }

/* ===== GEM DETECTION ===== */
.gem-card {
    border: 2px solid var(--accent-gold);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    background: var(--card-bg);
    box-shadow: 0 4px 15px rgba(246, 213, 92, 0.2);
    transition: all 0.3s ease;
}

.gem-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(246, 213, 92, 0.3);
}

.gem-title {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--accent-gold);
}

.gem-score {
    background: linear-gradient(135deg, var(--accent-gold), #FFD700, var(--accent-secondary));
    color: var(--primary-bg);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 800;
    font-size: 1.2em;
    box-shadow: 0 4px 15px rgba(246, 213, 92, 0.4);
    border: 2px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.gem-score:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(246, 213, 92, 0.6);
}

/* ===== UTILITIES ===== */
.favorite-btn {
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.favorite-btn:hover {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.05);
    border-color: var(--accent-primary);
}

.favorite-btn.favorited {
    background: var(--accent-gold);
    color: #1a1a1a;
    border-color: var(--accent-gold);
}

.error {
    text-align: center;
    padding: 50px;
    color: #fc8181;
    font-size: 1.2em;
}

/* ===== SYMBOL SEARCH ===== */
.symbol-search-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px var(--shadow);
}

.symbol-search-form {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.symbol-search-input {
    flex: 1;
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.symbol-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.symbol-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.symbol-search-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--text-primary);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    white-space: nowrap;
}

.symbol-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.symbol-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.search-result-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.search-result-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.search-result-info {
    flex: 1;
}

.search-result-symbol {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.search-result-name {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.btn-small {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--text-primary);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ===== PHASE 5: PORTFOLIO ANALYSIS STYLES ===== */
.portfolio-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 16px var(--shadow);
}

.portfolio-container .coins-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    background: rgba(245, 101, 101, 0.2);
    border: 1px solid rgba(245, 101, 101, 0.3);
    color: var(--error);
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(245, 101, 101, 0.3);
}

.portfolio-analysis {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.summary-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.summary-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-value.positive {
    color: var(--success);
}

.summary-value.negative {
    color: var(--error);
}

.summary-value.neutral {
    color: var(--warning);
}

.portfolio-section {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 10px;
    padding: 16px;
}

.portfolio-section h3 {
    font-size: 16px;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.opportunities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.opportunity-card {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    padding: 12px;
}

.opp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.opp-symbol {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-primary);
}

.opp-score {
    font-size: 14px;
    font-weight: 700;
    color: var(--success);
}

.opp-name {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.opp-reason {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.opp-confidence {
    font-size: 10px;
    color: var(--text-secondary);
}

.allocation-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.allocation-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.allocation-bar-container {
    width: 100%;
    height: 24px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.allocation-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.5s ease;
}

.allocation-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.allocation-symbol {
    font-weight: 700;
    color: var(--text-primary);
}

.allocation-pct {
    color: var(--text-secondary);
}

.market-notes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.market-note {
    background: rgba(99, 179, 237, 0.1);
    border-left: 3px solid var(--accent-primary);
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-primary);
}

.recs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rec-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    border-left: 3px solid;
}

.rec-item.buy {
    border-left-color: var(--success);
}

.rec-item.hold {
    border-left-color: var(--warning);
}

.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.rec-symbol {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.rec-score {
    font-size: 13px;
    font-weight: 700;
    color: var(--success);
}

.rec-details {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 11px;
}

.rec-confidence {
    color: var(--text-secondary);
}

.rec-opportunity {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.rec-opportunity.low {
    background: rgba(160, 174, 192, 0.2);
    color: var(--text-secondary);
}

.rec-opportunity.medium {
    background: rgba(99, 179, 237, 0.2);
    color: var(--accent-primary);
}

.rec-opportunity.high {
    background: rgba(72, 187, 120, 0.2);
    color: var(--success);
}

.rec-strengths {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

/* ===== END PORTFOLIO ANALYSIS ===== */

/* ===== HEALTH (shared styles used by health.html) ===== */

/* Status dot */
.health-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    background: var(--border);
}
.health-dot--ok {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}
.health-dot--err {
    background: var(--error);
    box-shadow: 0 0 6px var(--error);
    animation: health-pulse 1.5s infinite;
}
@keyframes health-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.health-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.health-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    white-space: nowrap;
}
.health-chip--ok {
    color: var(--success);
    border-color: rgba(72, 187, 120, 0.3);
    background: rgba(72, 187, 120, 0.08);
}
.health-chip--err {
    color: var(--error);
    border-color: rgba(245, 101, 101, 0.3);
    background: rgba(245, 101, 101, 0.08);
}
.health-chip--warn {
    color: var(--warning);
    border-color: rgba(237, 137, 54, 0.3);
    background: rgba(237, 137, 54, 0.08);
}
.health-chip--info {
    color: var(--accent-primary);
    border-color: rgba(102, 126, 234, 0.25);
    background: rgba(102, 126, 234, 0.06);
}

/* ===== END HEALTH ===== */

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--primary-bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .container { padding: 12px; }
    .header { padding: 14px 16px; }
    .header h1 { font-size: 1.5rem; }
    
    .coins-table { font-size: 0.875rem; }
    .coins-table th, .coins-table td { padding: 10px 6px; }
    
    .btn { padding: 7px 12px; font-size: 0.75rem; }
    
    .dashboard-card,
    .coins-container,
    .favorites-container,
    .ml-status-container,
    .hidden-gems-container { padding: 14px; }
    
    .status-container { right: 12px; left: 12px; }
    .status-toast { min-width: auto; width: 100%; }
    
    .refresh-controls {
        position: static;
        justify-content: center;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 { font-size: 1.3rem; }
    .coins-table th, .coins-table td { padding: 8px 4px; font-size: 0.75rem; }
    .btn { padding: 6px 10px; font-size: 0.7rem; }
    
    .dashboard-card,
    .coins-container,
    .favorites-container,
    .ml-status-container,
    .hidden-gems-container { padding: 12px; }
}