@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
    color: #ffffff;
    min-height: 100vh;
    font-weight: 400;
    letter-spacing: -0.01em;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 32px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.tab-container {
    display: flex;
    align-items: center;
    gap: 24px;
}

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

.tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    letter-spacing: -0.01em;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #00d4aa 0%, #00b896 100%);
    color: white;
    border-color: #00d4aa;
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

h1 {
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    margin: 0;
}

.refresh-btn {
    background: linear-gradient(135deg, #00d4aa 0%, #00b896 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    letter-spacing: -0.01em;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.refresh-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.4);
}

.refresh-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.live-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    letter-spacing: -0.01em;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.live-toggle-btn.active {
    background: rgba(239, 83, 80, 0.15);
    border-color: #ef5350;
    color: #ffffff;
}

.live-toggle-btn.active .live-status {
    color: #00d4aa;
}

.live-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.live-toggle-btn.active .live-indicator {
    background: #ef5350;
    box-shadow: 0 0 8px #ef5350;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.main-content {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.side-panel {
    min-width: 320px;
    max-width: 320px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.side-panel h3 {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.insight-section {
    margin-bottom: 24px;
}

.insight-section h4 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.stock-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stock-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.stock-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stock-card.bullish {
    border-left: 3px solid #00d4aa;
}

.stock-card.bearish {
    border-left: 3px solid #ef5350;
}

.stock-card.performer {
    border-left: 3px solid #3498db;
}

.stock-card.breakout {
    border-left: 3px solid #9c27b0;
}

.stock-ticker {
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.stock-signal {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 4px 0;
}

.stock-performance {
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.dashboard {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

th, td {
    padding: 12px 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.01);
}

/* FIXED: Sticky columns for ticker and name */
table th:nth-child(1), 
table th:nth-child(2),
table td:nth-child(1), 
table td:nth-child(2) {
    position: sticky !important;
    background: #2d2d2d !important;
    border-right: 3px solid rgba(0, 212, 170, 0.5) !important;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.5) !important;
}

/* Ticker column (first) */
table th:nth-child(1), 
table td:nth-child(1) {
    left: 0px !important;
    z-index: 20 !important;
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    text-align: left !important;
    padding: 12px 8px 12px 16px !important;
}

/* Name column (second) */
table th:nth-child(2), 
table td:nth-child(2) {
    left: 80px !important;
    z-index: 19 !important;
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
    text-align: left !important;
    padding: 12px 8px 12px 16px !important;
}

th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 10;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced sticky header styling for ticker and name columns */
table th:nth-child(1), 
table th:nth-child(2) {
    background: #1e1e1e !important; /* Darker solid background for headers */
    z-index: 25 !important; /* Higher than data cells */
    border-bottom: 2px solid rgba(0, 212, 170, 0.4) !important;
}

th:hover {
    background: rgba(255, 255, 255, 0.08);
}

th.sortable {
    position: relative;
    padding-right: 25px;
}

th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    font-size: 14px;
    transition: all 0.2s ease;
    opacity: 0.6;
}

th.sortable:hover::after {
    color: #3498db;
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
}

th.sortable.sort-asc::after {
    content: '▲';
    color: #27ae60;
    opacity: 1;
    animation: pulse 0.3s ease;
}

th.sortable.sort-desc::after {
    content: '▼';
    color: #e74c3c;
    opacity: 1;
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.3); }
    100% { transform: translateY(-50%) scale(1); }
}

/* Add a subtle glow effect on hover */
th.sortable:hover {
    background-color: #e3f2fd;
    box-shadow: inset 0 0 5px rgba(52, 152, 219, 0.3);
}

/* Tooltip for sorting instructions */
th.sortable {
    position: relative;
}

th.sortable:hover::before {
    content: 'Click to sort';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: normal;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0.9;
}

.subheader th {
    background-color: #e9ecef;
    font-size: 10px;
    padding: 4px 6px;
}

tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.002);
    transition: all 0.2s ease;
}

/* Ensure sticky columns maintain their background on row hover */
table tbody tr:hover td:nth-child(1),
table tbody tr:hover td:nth-child(2) {
    background: #2d2d2d !important;
}

/* Color coding for trends */
.bullish {
    background: rgba(0, 212, 170, 0.15) !important;
    color: #00d4aa;
}

.bearish {
    background: rgba(239, 83, 80, 0.15) !important;
    color: #ef5350;
}

.st-bullish {
    background: rgba(0, 212, 170, 0.1) !important;
    color: #00d4aa;
}

.st-bearish {
    background: rgba(239, 83, 80, 0.1) !important;
    color: #ef5350;
}

.healthy {
    background: rgba(255, 193, 7, 0.15) !important;
    color: #ffc107;
}

/* Positive/Negative percentage colors */
.positive {
    color: #00d4aa;
    font-weight: 500;
}

.negative {
    color: #ef5350;
    font-weight: 500;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
}

.ticker-cell {
    font-weight: 600 !important;
    text-align: left !important;
    color: #ffffff !important;
    letter-spacing: 0.02em !important;
    background: #2d2d2d !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.name-cell {
    text-align: left !important;
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 400 !important;
    background: #2d2d2d !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.price-cell {
    font-weight: 600;
    color: #ffffff;
}

.error {
    background: rgba(239, 83, 80, 0.15);
    color: #ef5350;
    padding: 16px;
    border-radius: 12px;
    margin: 16px 0;
    text-align: center;
    border: 1px solid rgba(239, 83, 80, 0.3);
}

/* Earnings date styling */
.urgent-earnings {
    background: rgba(255, 87, 34, 0.15) !important;
    color: #ff5722;
    font-weight: 600;
}

.upcoming-earnings {
    background: rgba(255, 193, 7, 0.15) !important;
    color: #ffc107;
    font-weight: 500;
}

.future-earnings {
    color: rgba(255, 255, 255, 0.7);
}

/* Consecutive up days styling */
.no-up-days {
    background: rgba(239, 83, 80, 0.15) !important;
    color: #ef5350;
    font-weight: 500;
}

.few-up-days {
    color: rgba(255, 255, 255, 0.8);
}

.some-up-days {
    background: rgba(255, 193, 7, 0.15) !important;
    color: #ffc107;
    font-weight: 500;
}

.many-up-days {
    background: rgba(0, 212, 170, 0.15) !important;
    color: #00d4aa;
    font-weight: 600;
}

/* Column drag and drop styling */
th.draggable {
    cursor: move;
    user-select: none;
    position: relative;
}

th.draggable:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

th.dragging {
    opacity: 0.5;
    background: rgba(0, 212, 170, 0.2) !important;
    transform: rotate(2deg);
}

th.drag-over {
    border-left: 3px solid #00d4aa !important;
    background: rgba(0, 212, 170, 0.1) !important;
}

.drag-indicator {
    position: absolute;
    top: 0;
    left: -2px;
    width: 4px;
    height: 100%;
    background: #00d4aa;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

th.drag-over .drag-indicator {
    opacity: 1;
}

/* Live price update animation */
.price-updated {
    animation: priceFlash 1s ease;
}

@keyframes priceFlash {
    0% { 
        background: rgba(0, 212, 170, 0.3) !important;
        transform: scale(1);
    }
    50% { 
        background: rgba(0, 212, 170, 0.5) !important;
        transform: scale(1.05);
    }
    100% { 
        background: transparent;
        transform: scale(1);
    }
}

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

/* Market Summary Styles */
.summary-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-section:last-child {
    border-bottom: none;
}

.summary-section h4 {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-section h5 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.summary-stats {
    padding: 24px;
}

.summary-stats h3 {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 300;
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: -0.02em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.stat-card h4 {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.2;
}

.stat-value div {
    margin-bottom: 2px;
}

/* Highlights Section */
.highlights-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.highlights-section h3 {
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 300;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: -0.02em;
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.highlight-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.highlight-card:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-1px);
}

.highlight-card h4 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 12px;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Cross-Tab Section */
.cross-tab-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cross-tab-section h3 {
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 300;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: -0.02em;
}

.notable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.notable-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.notable-card:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-1px);
}

.notable-card h4 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 12px;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hot Streaks and Lists */
.hot-streaks-list,
.momentum-list,
.breakout-list,
.champions-list,
.leaders-list,
.trends-list {
    font-size: 0.85rem;
    line-height: 1.5;
}

.hot-streak-item,
.momentum-item,
.trend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hot-streak-item:last-child,
.momentum-item:last-child,
.trend-item:last-child {
    border-bottom: none;
}

.stock-ticker-highlight {
    font-weight: 600;
    color: #ffffff;
}

.streak-days {
    color: #00d4aa;
    font-weight: 500;
}

.trend-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

/* Market Intelligence Styles */
.intelligence-content {
    padding: 24px;
}

.intelligence-content h3 {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 300;
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: -0.02em;
}

.intelligence-subtitle {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-bottom: 32px;
    font-style: italic;
}

.intelligence-section {
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 24px;
}

.intelligence-header {
    margin-bottom: 20px;
}

.intelligence-header h4 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.intelligence-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin: 0;
    font-style: italic;
}

.intelligence-grid {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
}

.grid-header {
    display: grid;
    grid-template-columns: 80px 1fr 1fr 1fr;
    gap: 16px;
    background: rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.intelligence-row {
    display: grid;
    grid-template-columns: 80px 1fr 1fr 1fr;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.intelligence-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.intelligence-row:last-child {
    border-bottom: none;
}

.intelligence-ticker {
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.intelligence-metric {
    color: rgba(255, 255, 255, 0.8);
}

.intelligence-metric.positive {
    color: #00d4aa;
    font-weight: 500;
}

.intelligence-metric.negative {
    color: #ef5350;
    font-weight: 500;
}

.intelligence-metric.neutral {
    color: #ffc107;
    font-weight: 500;
}

/* Side Panel Intelligence Styles */
.intelligence-stat {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.intelligence-pick {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    border-left: 3px solid #00d4aa;
}

.intelligence-pick .pick-ticker {
    font-weight: 600;
    color: #ffffff;
    display: block;
    margin-bottom: 4px;
}

.intelligence-pick .pick-reason {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

/* Breakout Hunter Styles */
.breakout-hunter-grid {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
}

.breakout-grid-header {
    display: grid;
    grid-template-columns: 70px 160px 60px 50px 40px 40px 40px 40px 40px 40px 50px;
    gap: 6px;
    background: rgba(255, 193, 7, 0.15);
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 193, 7, 0.3);
}

.breakout-hunter-row {
    display: grid;
    grid-template-columns: 70px 160px 60px 50px 40px 40px 40px 40px 40px 40px 50px;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    transition: background 0.2s ease;
    align-items: center;
}

.breakout-hunter-row:hover {
    background: rgba(255, 193, 7, 0.08);
}

.breakout-hunter-row:last-child {
    border-bottom: none;
}

.breakout-score {
    font-weight: 700;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.breakout-score.high {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
}

.breakout-score.medium {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.breakout-score.low {
    background: rgba(239, 83, 80, 0.15);
    color: #ef5350;
}

.breakout-criteria {
    text-align: center;
    font-weight: 500;
    padding: 2px 4px;
    border-radius: 3px;
}

.breakout-criteria.strong {
    background: rgba(0, 212, 170, 0.15);
    color: #00d4aa;
}

.breakout-criteria.medium {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.breakout-criteria.weak {
    background: rgba(239, 83, 80, 0.1);
    color: #ef5350;
}

.breakout-ticker {
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.breakout-name {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sector Analysis Styles */
.sector-analysis {
    background: rgba(40, 40, 40, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sector-analysis h3 {
    color: #00d4aa;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.sector-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.sector-returns h4,
.sector-ma-stats h4 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.returns-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.return-item {
    background: rgba(20, 20, 20, 0.6);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.return-label {
    display: block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
    font-weight: 500;
}

.return-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.return-value.positive {
    color: #00d4aa;
}

.return-value.negative {
    color: #ef5350;
}

.ma-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ma-stat {
    background: rgba(20, 20, 20, 0.6);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ma-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.ma-value {
    font-size: 1rem;
    font-weight: 600;
    color: #00d4aa;
}

@media (max-width: 1200px) {
    .sector-metrics {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .returns-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Gainers/Losers Tab Styles */
.gainers-losers-container {
    padding: 30px;
    max-width: 1800px;
    margin: 0 auto;
}

.gl-section {
    margin-bottom: 60px;
    background: rgba(40, 40, 40, 0.4);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: visible;
}

.gl-section.overall-section {
    background: rgba(40, 40, 40, 0.6);
    border: 2px solid rgba(0, 212, 170, 0.3);
    margin-bottom: 50px;
}

.gl-section h2 {
    color: #00d4aa;
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
}

.gl-section h3 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.gl-section h4 {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.gl-timeframes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 500px));
    gap: 40px;
    margin-top: 20px;
    justify-content: center;
}

/* 4-column compact layout for fitting all timeframes in one row */
.gl-timeframes.four-column {
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 1400px;
    margin: 15px auto;
}

/* Champions timeframe styling - fits in grid but with special border */
.gl-timeframe.champions {
    /* Ensure the border encompasses the entire champions timeframe */
    position: relative;
    border: 2px solid rgba(255, 215, 0, 0.6);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    padding: 25px;
    margin: 15px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    min-width: 600px;
    max-width: 800px;
}

/* Make Champions columns wider */
.gl-timeframe.champions .gl-column {
    min-width: 280px;
}

/* Increase name width for Champions section */
.gl-timeframe.champions .gl-name {
    max-width: 180px;
    font-size: 0.9rem;
}

.gl-timeframe.champions::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 16px;
    pointer-events: none;
    z-index: -1;
}

.gl-timeframes.compact {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.gl-timeframe {
    background: rgba(30, 30, 30, 0.5);
    border-radius: 8px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
    max-width: 500px;
    overflow: hidden;
}

/* Compact styling for 4-column layout */
.gl-timeframes.four-column .gl-timeframe {
    max-width: none;
    padding: 12px;
    margin-bottom: 0;
    background: rgba(25, 25, 25, 0.4);
}

.gl-timeframes.four-column .gl-timeframe h3 {
    font-size: 0.85rem;
    margin-bottom: 6px;
    font-weight: 500;
}

/* Compact columns for 4-column layout */
.gl-timeframes.four-column .gl-columns {
    gap: 10px;
    margin-top: 8px;
}

.gl-timeframes.four-column .gl-column {
    padding: 10px;
    background: rgba(15, 15, 15, 0.5);
}

.gl-timeframes.four-column .gl-column h4 {
    font-size: 0.75rem;
    margin-bottom: 4px;
    font-weight: 500;
}

/* Compact list and items for 4-column layout */
.gl-timeframes.four-column .gl-list {
    gap: 4px;
}

.gl-timeframes.four-column .gl-item {
    padding: 6px 8px;
    background: rgba(20, 20, 20, 0.3);
    border-radius: 4px;
}

/* Much smaller, cleaner text in 4-column layout */
.gl-timeframes.four-column .gl-ticker {
    font-size: 0.75rem;
    font-weight: 600;
}

.gl-timeframes.four-column .gl-name {
    font-size: 0.65rem;
    max-width: 100px;
    opacity: 0.8;
}

.gl-timeframes.four-column .gl-change {
    font-size: 0.75rem;
    font-weight: 600;
}

/* More compact stock info layout */
.gl-timeframes.four-column .gl-stock-info {
    margin-right: 6px;
}

.gl-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 15px;
}

.gl-column {
    background: rgba(20, 20, 20, 0.6);
    border-radius: 6px;
    padding: 20px;
    min-width: 0;
    overflow: hidden;
}

.gl-column.gainers {
    border: 1px solid rgba(0, 212, 170, 0.2);
}

.gl-column.losers {
    border: 1px solid rgba(239, 83, 80, 0.2);
}

.gl-column h4 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-align: center;
}

.gl-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gl-list.compact {
    gap: 8px;
}

.gl-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-bottom: 3px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.gl-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(3px);
}

.gl-item.gainer {
    border-left: 3px solid #00d4aa;
}

.gl-item.loser {
    border-left: 3px solid #ef5350;
}

.gl-ticker {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
}

.gl-name {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

.gl-stock-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    margin-right: 10px;
}

.gl-change {
    font-weight: 600;
    font-size: 1.05rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.gl-change.positive {
    color: #00d4aa;
}

.gl-change.negative {
    color: #ef5350;
}

.gl-sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

/* Compact styles for section-specific lists */
.gl-timeframes.compact .gl-timeframe {
    padding: 10px;
}

.gl-timeframes.compact h4 {
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.gl-timeframes.compact .gl-columns {
    gap: 10px;
}

.gl-timeframes.compact .gl-column {
    padding: 8px;
}

.gl-timeframes.compact .gl-item {
    padding: 5px 8px;
    font-size: 0.85rem;
}

.gl-timeframes.compact .gl-ticker {
    font-size: 0.85rem;
}

.gl-timeframes.compact .gl-change {
    font-size: 0.85rem;
}

/* Empty state */
.gl-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    padding: 20px;
    font-style: italic;
}


/* Market Status Indicator */
.market-status-indicator {
    text-align: center;
    margin-bottom: 20px;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.market-status-indicator .status-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.market-status-indicator.open {
    background: rgba(0, 212, 170, 0.15);
    border-color: rgba(0, 212, 170, 0.3);
}

.market-status-indicator.open .status-text {
    color: #00d4aa;
}

.market-status-indicator.closed {
    background: rgba(239, 83, 80, 0.15);
    border-color: rgba(239, 83, 80, 0.3);
}

.market-status-indicator.closed .status-text {
    color: #ef5350;
}


/* Multi-Timeframe Champions styling */

.gl-timeframe.champions::before {
    content: '👑';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 1.5rem;
    background: rgba(255, 215, 0, 0.9);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffd700;
}

.gl-timeframe.champions h3 {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.champions-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1a1a;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 4px;
    text-shadow: none;
}

/* Table Controls */
.table-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

/* Column Dropdown */
.column-dropdown {
    position: relative;
    display: inline-block;
}

.column-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 12px;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.column-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.column-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    min-width: 300px;
    max-height: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    z-index: 1000;
    overflow: hidden;
}

.column-dropdown.open .column-dropdown-content {
    display: block;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.dropdown-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: rgba(0, 212, 170, 0.2);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 4px;
    padding: 4px 8px;
    color: #00d4aa;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.action-btn:hover {
    background: rgba(0, 212, 170, 0.3);
    border-color: rgba(0, 212, 170, 0.5);
}

.dropdown-columns {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px;
}

.column-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    border-radius: 4px;
}

.column-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 1);
}

.column-toggle input[type="checkbox"] {
    accent-color: #00d4aa;
    cursor: pointer;
}

.column-toggle label {
    cursor: pointer;
    flex: 1;
}

/* Column hiding styles */
.column-hidden {
    display: none !important;
}

/* Watchlist specific styles */
.watchlist-controls {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.watchlist-controls h4 {
    color: #00d4aa;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.add-ticker-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#tickerInput {
    flex: 1;
    padding: 10px 12px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    text-transform: uppercase;
}

#tickerInput:focus {
    outline: none;
    border-color: #00d4aa;
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2);
}

.add-ticker-btn {
    background: linear-gradient(135deg, #00d4aa 0%, #00b896 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.add-ticker-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.add-ticker-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.watchlist-count {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    text-align: center;
}

.actions-column {
    width: 80px;
    text-align: center;
}

.remove-ticker-btn {
    background: rgba(255, 59, 48, 0.8);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.remove-ticker-btn:hover {
    background: rgba(255, 59, 48, 1);
    transform: translateY(-1px);
}

.empty-watchlist {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.empty-watchlist h3 {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.empty-watchlist p {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Analysis Tab Styles */
.analysis-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 20px;
}

.analysis-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.analysis-section h3 {
    color: #fff;
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.section-description {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.stocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.stock-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.stock-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.stock-ticker {
    font-weight: 600;
    color: #4FC3F7;
    font-size: 1rem;
    margin-bottom: 5px;
}

.stock-metrics {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stock-metric {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.stock-metric-label {
    color: rgba(255, 255, 255, 0.7);
}

.stock-metric-value {
    color: #fff;
    font-weight: 500;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.stat-value {
    color: #fff;
    font-weight: 600;
}

/* Long/Short Portfolio Styles */
.long-short-metrics {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.portfolio-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.portfolio-section h4 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.portfolio-table-section {
    margin-bottom: 30px;
}

.portfolio-table-section h3 {
    color: #fff;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    border-left: 4px solid #4FC3F7;
}

