/**
 * STP Custom Scans - Frontend Styles
 */

.stp-scans-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Header */
.stp-scans-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.stp-scans-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

.stp-scans-header .scan-date {
    font-size: 14px;
    color: #666;
}

/* No Results */
.stp-no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

/* Tabs */
.stp-scans-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.stp-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid #e0e0e0;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
}

.stp-tab:hover {
    border-color: #999;
}

.stp-tab.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1e40af;
}

.stp-tab[data-tab="bearish"].active {
    border-color: #dc2626;
    background: #fef2f2;
    color: #991b1b;
}

.tab-icon {
    font-size: 16px;
}

.tab-count {
    background: #e5e7eb;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.stp-tab.active .tab-count {
    background: #2563eb;
    color: #fff;
}

.stp-tab[data-tab="bearish"].active .tab-count {
    background: #dc2626;
}

/* Tab Panels */
.stp-tab-panel {
    display: none;
}

.stp-tab-panel.active {
    display: block;
}

/* Charts Grid */
.stp-charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Chart Card */
.stp-chart-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s ease;
}

@media screen and (max-width: 1200px) {
    .stp-charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stp-chart-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Card Header */
.stp-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.stp-stock-info {
    flex: 1;
    min-width: 0;
}

.stp-ticker {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.stp-company {
    font-size: 12px;
    color: #666;
    margin: 2px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stp-grade-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.stp-grade-badge.bullish {
    background: #d1fae5;
    color: #065f46;
}

.stp-grade-badge.bearish {
    background: #fee2e2;
    color: #991b1b;
}

/* Chart Container */
.stp-chart-container {
    height: 220px;
    padding: 10px;
}

/* Card Footer */
.stp-chart-footer {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    font-size: 12px;
    color: #666;
}

.stp-chart-footer .sector {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stp-chart-footer .price {
    font-weight: 600;
    color: #1a1a1a;
}

/* Inside Day Info */
.stp-inside-day-info {
    display: flex;
    gap: 15px;
    padding: 8px 15px;
    background: #fefce8;
    border-top: 1px solid #fef08a;
    font-size: 11px;
    color: #854d0e;
}

.stp-inside-day-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stp-inside-day-info .label {
    font-weight: 500;
}

/* Loading State */
.stp-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Empty State */
.stp-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

/* Chart Error State */
.stp-chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 13px;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .stp-scans-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .stp-scans-tabs {
        width: 100%;
    }
    
    .stp-tab {
        flex: 1;
        justify-content: center;
    }
    
    .stp-charts-grid {
        grid-template-columns: 1fr;
    }
}
