/* EBS — Earnings Beat Screener Styles */
#ebs-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #30363d;
}

/* ── TABS ── */
.ebs-tabs {
    display: flex;
    background: #161b22;
    border-bottom: 1px solid #30363d;
}
.ebs-tab {
    padding: 12px 22px;
    background: transparent;
    border: none;
    color: #8b949e;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.ebs-tab:hover { color: #c9d1d9; }
.ebs-tab.active { color: #58a6ff; border-bottom-color: #58a6ff; }

.ebs-tab-content { display: none; padding: 20px; }
.ebs-tab-content.active { display: block; }

/* ── CONTROLS ── */
.ebs-controls {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    background: #161b22;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #21262d;
}
.ebs-controls label { color: #8b949e; font-size: 13px; }
.ebs-controls input[type="number"] {
    background: #0d1117;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
    margin-left: 6px;
}
.ebs-btn {
    background: #238636;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}
.ebs-btn:hover { background: #2ea043; }
.ebs-hint { color: #8b949e; font-style: italic; }

/* ── SCREENER TABLE ── */
.ebs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}
.ebs-table th {
    background: #161b22;
    color: #58a6ff;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #30363d;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.ebs-table th:hover { color: #79c0ff; }
.ebs-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #21262d;
    vertical-align: middle;
}
.ebs-table tr:hover { background: #161b22; }

/* Score badge */
.ebs-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 15px;
}
.score-high   { background: #1a4731; color: #3fb950; border: 2px solid #3fb950; }
.score-medium { background: #3d2f00; color: #d29922; border: 2px solid #d29922; }
.score-low    { background: #3d0c0c; color: #f85149; border: 2px solid #f85149; }

/* Mini progress bars */
.ebs-score-bar-wrap { display: flex; gap: 6px; align-items: center; }
.ebs-bar-outer {
    flex: 1;
    background: #21262d;
    border-radius: 3px;
    height: 6px;
    min-width: 60px;
}
.ebs-bar-inner {
    height: 6px;
    border-radius: 3px;
    background: #58a6ff;
    transition: width 0.4s ease;
}

/* Tags */
.ebs-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 3px;
}
.tag-bull { background: #1a4731; color: #3fb950; }
.tag-bear { background: #3d0c0c; color: #f85149; }
.tag-neu  { background: #21262d; color: #8b949e; }
.tag-warn { background: #3d2f00; color: #d29922; }

/* ── DETAIL BUTTON ── */
.ebs-detail-btn {
    background: #1f6feb;
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.ebs-detail-btn:hover { background: #388bfd; }

/* ── BREAKDOWN TOOLTIP ── */
.ebs-breakdown {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.ebs-mod-pill {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    white-space: nowrap;
}

/* ── STATS TABLE ── */
.ebs-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ebs-stats-table th {
    background: #161b22;
    color: #58a6ff;
    padding: 10px 12px;
    border-bottom: 2px solid #30363d;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}
.ebs-stats-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #21262d;
}
.ebs-stats-table tr:hover { background: #161b22; }
.delta-pos  { color: #3fb950; font-weight: 700; }
.delta-neg  { color: #f85149; font-weight: 700; }
.delta-zero { color: #8b949e; }
.badge-low-n {
    display: inline-block;
    background: #3d2f00;
    color: #d29922;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    margin-left: 4px;
}
.ebs-chart-title { color: #c9d1d9; margin-bottom: 12px; }

/* ── MODAL ── */
#ebs-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ebs-modal-box {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 24px;
    max-width: 680px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}
.ebs-modal-close {
    position: absolute;
    top: 12px; right: 14px;
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 18px;
    cursor: pointer;
}
.ebs-modal-close:hover { color: #fff; }
.ebs-modal-box h3 { color: #58a6ff; margin-top: 0; }
.ebs-modal-box h4 { color: #f0883e; margin-bottom: 6px; }

/* Surprise indicator */
.sur-pos { color: #3fb950; }
.sur-neg { color: #f85149; }

@media (max-width: 700px) {
    .ebs-controls { flex-direction: column; align-items: flex-start; }
    .ebs-table { font-size: 11px; }
    .ebs-table td, .ebs-table th { padding: 6px 7px; }
    .ebs-modal-box { padding: 14px; }
}
