/* IHSG Stock Scanner Styles */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.tab-btn {
    padding: 10px 24px;
    border: none;
    background: #e8eaf6;
    color: #283593;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 14px;
}

.tab-btn.active {
    background: #283593;
    color: white;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.controls input,
.controls select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.controls input {
    flex: 1;
    min-width: 200px;
}

.vol-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #283593;
    cursor: pointer;
    white-space: nowrap;
    padding: 8px 14px;
    background: #e8eaf6;
    border-radius: 6px;
}

.vol-filter input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #283593;
}

#screeningMethod {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    background: #e8eaf6;
    color: #283593;
    cursor: pointer;
    min-width: 160px;
}

#screeningMethod:hover {
    background: #c5cae9;
}

.signals {
    text-align: center;
    min-width: 100px;
}

.sig {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    margin: 1px;
    border-radius: 3px;
    font-weight: 700;
    white-space: nowrap;
}

.sig-breakout { background: #ff6f00; color: #fff; }
.sig-gap_up { background: #0066cc; color: #fff; }
.sig-gap_down { background: #cc3300; color: #fff; }
.sig-bullish_reversal { background: #1b5e20; color: #fff; }
.sig-bearish_reversal { background: #b71c1c; color: #fff; }
.sig-cons_up { background: #2e7d32; color: #fff; }
.sig-cons_down { background: #c62828; color: #fff; }
.sig-vol_spike { background: #6a1b9a; color: #fff; }
.sig-range_expand { background: #e65100; color: #fff; }
.sig-hammer { background: #00796b; color: #fff; }
.sig-bull_engulf { background: #33691e; color: #fff; }
.sig-bear_engulf { background: #880e4f; color: #fff; }

#countDisplay {
    color: #666;
    font-size: 14px;
    margin-left: auto;
}

.table-wrapper {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    background: #283593;
    color: white;
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    position: relative;
}

th:hover {
    background: #1a237e;
}

th::after {
    content: ' \2195';
    opacity: 0.5;
    font-size: 10px;
}

th.asc::after {
    content: ' \2191';
    opacity: 1;
}

th.desc::after {
    content: ' \2193';
    opacity: 1;
}

td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

tbody tr:hover {
    background: #f8f9ff;
}

.symbol {
    font-weight: 600;
    color: #1a237e;
}

.name {
    color: #555;
}

.sector {
    color: #666;
    font-size: 12px;
}

.prev, .open, .current {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.change, .change_pct, .gap_pct, .vol_spike, .volume_value {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.status {
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

tr.up .change,
tr.up .change_pct,
tr.up .gap_pct,
tr.up .status {
    color: #2e7d32;
}

tr.down .change,
tr.down .change_pct,
tr.down .gap_pct,
tr.down .status {
    color: #c62828;
}

.portfolio-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.summary-box {
    background: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    min-width: 150px;
}

.summary-box .label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.summary-box .value {
    font-size: 18px;
    font-weight: 700;
    color: #283593;
    font-family: 'Courier New', monospace;
}

#portfolioTable {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

#portfolioTable th {
    background: #283593;
    color: white;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 13px;
    text-align: right;
}

#portfolioTable th:first-child {
    text-align: left;
}

#portfolioTable td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    text-align: right;
    font-family: 'Courier New', monospace;
}

#portfolioTable td:first-child {
    text-align: left;
    font-weight: 600;
}

#portfolioTable .pnl {
    font-weight: 700;
}

tr.tp .pnl {
    color: #2e7d32;
}

tr.sl .pnl {
    color: #c62828;
}

tr.hold .pnl {
    color: #f9a825;
}

#portfolioTable .status {
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

@media (max-width: 900px) {
    .container {
        padding: 10px;
    }
    
    th, td {
        padding: 8px;
        font-size: 12px;
    }
    
    .name {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .portfolio-summary {
        flex-wrap: wrap;
    }
}
