/* GEX Analyzer Frontend Widget CSS */

.gex-analyzer-widget {
    background: #0f1419;
    border-radius: 12px;
    padding: 30px;
    color: #e6edf3;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: auto;
}

.gex-analyzer-widget.theme-light {
    background: #ffffff;
    color: #24292f;
}

/* Header */
.gex-widget-header {
    border-bottom: 2px solid #30363d;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.gex-widget-title {
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.gex-widget-title .icon {
    font-size: 32px;
}

.gex-widget-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.symbol-badge,
.dte-badge,
.timestamp {
    background: #1c2128;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.symbol-badge {
    background: #58a6ff;
    color: #000;
}

/* Loading */
.gex-widget-loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #30363d;
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Metrics Grid */
.gex-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: #1c2128;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.metric-label {
    color: #8b949e;
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 5px;
}

.metric-sub {
    color: #58a6ff;
    font-size: 14px;
    font-weight: 600;
}

.price-card .metric-value {
    color: #58a6ff;
}

.bias-card.bullish {
    border-color: #7ee787;
}

.bias-card.bullish .metric-value {
    color: #7ee787;
}

.bias-card.bearish {
    border-color: #ff7b72;
}

.bias-card.bearish .metric-value {
    color: #ff7b72;
}

/* Sentiment Section */
.gex-sentiment-section {
    background: #1c2128;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px 0;
}

.section-description {
    color: #8b949e;
    font-size: 14px;
    margin: 0 0 20px 0;
}

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

.sentiment-item {
    text-align: center;
    padding: 20px 15px;
    background: #0f1419;
    border-radius: 8px;
}

.sentiment-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.sentiment-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: #8b949e;
}

.sentiment-percent {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.sentiment-item.buy .sentiment-percent {
    color: #7ee787;
}

.sentiment-item.range .sentiment-percent {
    color: #f9e2af;
}

.sentiment-item.sell .sentiment-percent {
    color: #ff7b72;
}

.sentiment-bar {
    height: 8px;
    background: #30363d;
    border-radius: 4px;
    overflow: hidden;
}

.sentiment-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.sentiment-item.buy .sentiment-fill {
    background: #7ee787;
}

.sentiment-item.range .sentiment-fill {
    background: #f9e2af;
}

.sentiment-item.sell .sentiment-fill {
    background: #ff7b72;
}

/* Chart Section */
.gex-chart-section {
    background: #1c2128;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.chart-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.chart-btn {
    background: #30363d;
    border: none;
    color: #e6edf3;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.chart-btn:hover {
    background: #3d444d;
}

.chart-btn.active {
    background: #58a6ff;
    color: #000;
}

.chart-wrapper {
    height: 350px;
    position: relative;
}

/* Support & Resistance */
.gex-sr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.sr-section {
    background: #1c2128;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 25px;
}

.levels-container {
    margin-top: 15px;
}

.level-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #0f1419;
    border-radius: 6px;
    margin-bottom: 10px;
}

.level-price {
    font-weight: 700;
    font-size: 16px;
}

.level-dist {
    color: #8b949e;
    font-size: 13px;
}

.no-data {
    text-align: center;
    color: #8b949e;
    font-style: italic;
    padding: 20px;
}

/* Breakout Section */
.gex-breakout-section {
    background: #1c2128;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

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

.breakout-column h4 {
    font-size: 16px;
    margin: 0 0 15px 0;
    color: #8b949e;
}

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

.breakout-item {
    background: #0f1419;
    border-left: 3px solid #58a6ff;
    border-radius: 6px;
    padding: 12px 15px;
}

.breakout-level {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
}

.breakout-label {
    font-size: 12px;
    color: #58a6ff;
    text-transform: uppercase;
    font-weight: 600;
}

/* Footer */
.gex-widget-footer {
    border-top: 1px solid #30363d;
    padding-top: 20px;
    margin-top: 30px;
    text-align: center;
    color: #8b949e;
    font-size: 13px;
}

/* Error State */
.gex-widget-error {
    text-align: center;
    padding: 60px 20px;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.error-message {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.error-sub {
    color: #8b949e;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .gex-analyzer-widget {
        padding: 20px;
    }
    
    .gex-metrics-grid,
    .sentiment-grid,
    .gex-sr-grid,
    .breakout-grid {
        grid-template-columns: 1fr;
    }
    
    .gex-widget-title {
        font-size: 22px;
    }
}
