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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.search-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

#tickerSearch {
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 25px;
    width: 300px;
    text-transform: uppercase;
    outline: none;
    transition: all 0.3s ease;
    text-align: center;
}

#tickerSearch:focus {
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    background: white;
    border-radius: 15px;
    margin: 20px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.error-message {
    background: #fee;
    color: #c33;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    border: 2px solid #fcc;
    margin: 20px 0;
}

.hidden {
    display: none !important;
}

.ticker-header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.ticker-info h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

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

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
}

.performance-summary {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.score-card {
    text-align: center;
}

.score {
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
}

.score-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
}

.quality-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.quality-excellent {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.quality-good {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #b8daff;
}

.quality-fair {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.quality-poor {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.chart-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.chart-header h3 {
    color: #2c3e50;
    font-size: 1.5rem;
}

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

.chart-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
}

.chart-controls input[type="checkbox"] {
    transform: scale(1.2);
    accent-color: #667eea;
}

#ohlcChart {
    width: 100% !important;
    height: 500px !important;
}

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

.metric-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.metric-card h4 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.1rem;
    flex: 1;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.metric-detail {
    color: #666;
    font-size: 0.9rem;
}

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

.detail-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.detail-card h4 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.2rem;
    flex: 1;
}

.param-grid {
    display: grid;
    gap: 15px;
}

.param-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.param-label {
    font-weight: 600;
    color: #555;
}

.summary-content {
    margin-bottom: 30px;
}

.summary-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.summary-header h2 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 10px;
}

.summary-subtitle {
    color: #666;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.overview-card {
    background: white;
    padding: 30px 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
    position: relative;
}

.overview-card:hover {
    transform: translateY(-5px);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.card-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.card-label {
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 600;
}

.accuracy-summary {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.accuracy-summary h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.5rem;
}

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

.accuracy-card h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.accuracy-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

.stat-value {
    font-weight: bold;
    color: #667eea;
    font-size: 1rem;
}

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

.insight-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.insight-card h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.distribution-stats, .model-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dist-item, .model-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.dist-item:last-child, .model-item:last-child {
    border-bottom: none;
}

.dist-label, .model-label {
    font-weight: 600;
    color: #555;
}

.dist-value, .model-value {
    color: #667eea;
    font-weight: bold;
}

.search-prompt {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.search-prompt p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #555;
}

.popular-tickers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.ticker-tag {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.ticker-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    position: relative;
}

.overview-card .info-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #667eea;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.6;
    transition: all 0.3s ease;
    padding: 6px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    z-index: 10;
}

.accuracy-card .info-icon {
    color: #667eea;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.6;
    transition: all 0.3s ease;
    padding: 6px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    margin-left: auto;
}

.info-icon:hover {
    opacity: 1;
    background: rgba(102, 126, 234, 0.25);
    transform: scale(1.15);
}

.reset-zoom-btn {
    background-color: #FF9800;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.reset-zoom-btn:hover {
    background-color: #F57C00;
}

.zoom-hint {
    font-size: 12px;
    color: #666;
    margin-left: auto;
    font-style: italic;
}

/* Risk Level Styling */
.risk-level {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.risk-level.low {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.risk-level.medium {
    color: #FF9800;
    background: rgba(255, 152, 0, 0.1);
}

.risk-level.high {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.risk-level.very-high {
    color: #d32f2f;
    background: rgba(211, 47, 47, 0.15);
}

/* Change Indicator */
.change-indicator {
    font-weight: 600;
    font-size: 0.9em;
}

.change-indicator.positive {
    color: #4CAF50;
}

.change-indicator.positive::before {
    content: "▲ ";
}

.change-indicator.negative {
    color: #f44336;
}

.change-indicator.negative::before {
    content: "▼ ";
}

/* Direction Arrow */
.direction-arrow {
    font-size: 1.2em;
    margin-right: 0.3em;
}

.accuracy-card {
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    position: relative;
}

.accuracy-card .card-header {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accuracy-card .card-header h4 {
    margin: 0;
    flex: 1;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 25px 30px 15px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.4rem;
}

.close-modal {
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close-modal:hover {
    color: #667eea;
}

.modal-body {
    padding: 25px 30px 30px;
}

.modal-body #modalDescription {
    color: #555;
    line-height: 1.6;
    margin-bottom: 25px;
    font-size: 1rem;
}

.examples-section {
    display: grid;
    gap: 20px;
}

.example-good, .example-bad {
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid;
}

.example-good {
    background: #f8fff8;
    border-left-color: #4caf50;
}

.example-bad {
    background: #fff8f8;
    border-left-color: #f44336;
}

.example-good h4, .example-bad h4 {
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.example-good h4 {
    color: #2e7d32;
}

.example-bad h4 {
    color: #c62828;
}

.example-good p, .example-bad p {
    margin: 0;
    color: #555;
    line-height: 1.5;
}

/* Market Direction Styles */
.market-overview {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 20px 0;
}

.market-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.market-indicator.bullish {
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.market-indicator.bearish {
    background: linear-gradient(135deg, #f44336, #e57373);
    color: white;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.confidence-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    margin-left: 8px;
}

.prediction-count {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
}

/* Indices Summary Styles */
.indices-summary {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.indices-summary h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

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

.index-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #ddd;
    transition: all 0.3s ease;
}

.index-card.bullish {
    border-left-color: #4CAF50;
}

.index-card.bearish {
    border-left-color: #f44336;
}

.index-card.neutral {
    border-left-color: #ff9800;
}

.index-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.index-header h4 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 4px;
}

.index-subtitle {
    color: #666;
    font-size: 0.9rem;
}

.index-data {
    margin-top: 15px;
}

.current-price {
    font-size: 1.4rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.target-price {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 8px;
}

.change-indicator {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.change-indicator.bullish {
    color: #4CAF50;
}

.change-indicator.bearish {
    color: #f44336;
}

.change-indicator.neutral {
    color: #ff9800;
}

.confidence {
    font-size: 0.9rem;
    color: #666;
}

/* Market Sentiment Styles */
.market-sentiment {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    padding: 20px;
    color: white;
}

.sentiment-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sentiment-icon {
    font-size: 2rem;
}

.sentiment-text {
    flex: 1;
}

.sentiment-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.sentiment-stats {
    font-size: 0.9rem;
    opacity: 0.9;
}

.sentiment-percentage {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Market Overview Stats */
.market-overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* Predictions Grid */
.predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.prediction-item {
    background: white;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border-left: 3px solid #ddd;
    transition: all 0.3s ease;
}

.prediction-item.bullish {
    border-left-color: #4CAF50;
}

.prediction-item.bearish {
    border-left-color: #f44336;
}

.prediction-item.neutral {
    border-left-color: #ff9800;
}

.prediction-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pred-ticker {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1rem;
    margin-bottom: 6px;
}

.pred-direction {
    font-weight: 600;
    margin-bottom: 4px;
}

.prediction-item.bullish .pred-direction {
    color: #4CAF50;
}

.prediction-item.bearish .pred-direction {
    color: #f44336;
}

.prediction-item.neutral .pred-direction {
    color: #ff9800;
}

.pred-confidence {
    font-size: 0.85rem;
    color: #666;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .search-container {
        flex-direction: column;
        align-items: center;
    }

    #tickerSearch {
        width: 100%;
        max-width: 300px;
    }

    .ticker-header {
        flex-direction: column;
        text-align: center;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chart-controls {
        flex-direction: column;
        gap: 10px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .details-section {
        grid-template-columns: 1fr;
    }

    .market-overview {
        flex-direction: column;
        gap: 15px;
    }

    .indices-grid {
        grid-template-columns: 1fr;
    }

    .market-overview-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .predictions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}