/* VS Code Dark Blue Theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: #0d1117;
    color: #c9d1d9;
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #161b22 0%, #21262d 100%);
    border-radius: 12px;
    border: 1px solid #30363d;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #58a6ff;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(88, 166, 255, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    color: #8b949e;
    margin-bottom: 30px;
    font-weight: 300;
}

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

.stat-card {
    background: #21262d;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #30363d;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: #58a6ff;
    box-shadow: 0 8px 25px rgba(88, 166, 255, 0.15);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #58a6ff;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chart Section */
.chart-section {
    background: #161b22;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid #30363d;
}

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

.chart-header h2 {
    font-size: 1.8rem;
    color: #f0f6fc;
    font-weight: 600;
}

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

.chart-btn {
    padding: 8px 16px;
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.9rem;
}

.chart-btn:hover {
    background: #30363d;
    border-color: #58a6ff;
}

.chart-btn.active {
    background: #58a6ff;
    border-color: #58a6ff;
    color: #0d1117;
    font-weight: 600;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 500px; /* Back to normal height */
    background: #0d1117;
    border-radius: 8px;
    border: 1px solid #21262d;
    overflow: hidden;
}

.chart {
    width: 100%;
    height: 100%;
}

.chart-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #161b22;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8b949e;
    z-index: 10;
}

.chart-loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #30363d;
    border-top: 3px solid #58a6ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* Indicator Controls */
.indicator-controls {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #30363d;
}

.indicator-controls h3 {
    color: #f0f6fc;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.indicator-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.indicator-btn {
    padding: 10px 18px;
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    min-width: 80px;
    text-align: center;
}

.indicator-btn:hover {
    background: #30363d;
    border-color: #58a6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.15);
}

.indicator-btn.active {
    background: #58a6ff;
    border-color: #58a6ff;
    color: #0d1117;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.indicator-btn.active::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    background: #238636;
    color: #ffffff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid #0d1117;
}

/* Indicator Windows */
.indicator-windows {
    margin-top: 20px;
}

.indicator-window {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.indicator-window:hover {
    border-color: #58a6ff;
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.15);
}

.indicator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #21262d;
    border-bottom: 1px solid #30363d;
}

.indicator-title {
    color: #f0f6fc;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.indicator-value {
    color: #58a6ff;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    font-weight: 600;
}

.indicator-chart {
    height: 120px;
    background: #0d1117;
    position: relative;
}

.indicator-chart canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Indicator Controls */

/* Data Section */
.data-section {
    background: #161b22;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid #30363d;
}

.data-section h2 {
    font-size: 1.8rem;
    color: #f0f6fc;
    margin-bottom: 25px;
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #30363d;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #0d1117;
}

.data-table th {
    background: #21262d;
    color: #f0f6fc;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #30363d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #21262d;
    color: #c9d1d9;
    font-family: 'Consolas', monospace;
}

.data-table tr:hover {
    background: #161b22;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.loading {
    text-align: center;
    color: #8b949e;
    font-style: italic;
}

/* Info Section */
.info-section {
    margin-bottom: 40px;
}

/* Technical Analysis Section */
.technical-analysis-section {
    background: #161b22;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid #30363d;
}

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

.ta-header h2 {
    font-size: 1.8rem;
    color: #f0f6fc;
    font-weight: 600;
}

.timeframe-controls {
    display: flex;
    gap: 8px;
    background: #21262d;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #30363d;
}

.timeframe-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #c9d1d9;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
}

.timeframe-btn:hover {
    background: #30363d;
    color: #58a6ff;
}

.timeframe-btn.active {
    background: #58a6ff;
    color: #0d1117;
    font-weight: 600;
}

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

.indicator-card {
    background: #21262d;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #30363d;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 320px; /* Ensure consistent height */
}

.indicator-card:hover {
    transform: translateY(-3px);
    border-color: #58a6ff;
    box-shadow: 0 8px 25px rgba(88, 166, 255, 0.15);
}

.indicator-card h3 {
    color: #58a6ff;
    font-size: 1.2rem;
    font-weight: 600;
}

.speedometer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    justify-content: space-between;
    margin-bottom: 15px;
}

.speedometer-container canvas {
    margin-bottom: 10px;
}

.indicator-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f0f6fc;
    margin-bottom: 5px;
}

.indicator-signal {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 60px;
    display: inline-block;
    text-align: center;
}

.indicator-signal.buy {
    background: rgba(35, 134, 54, 0.25);
    color: #56d364;
    border: 1.5px solid #238636;
    box-shadow: 0 0 10px rgba(35, 134, 54, 0.3);
}

.indicator-signal.sell {
    background: rgba(248, 81, 73, 0.25);
    color: #f85149;
    border: 1.5px solid #da3633;
    box-shadow: 0 0 10px rgba(248, 81, 73, 0.3);
}

.indicator-signal.neutral {
    background: rgba(248, 197, 85, 0.25);
    color: #f8c555;
    border: 1.5px solid #d29922;
    box-shadow: 0 0 10px rgba(248, 197, 85, 0.3);
}

.indicator-description {
    margin-top: 15px;
}

.indicator-description p {
    color: #8b949e;
    font-size: 0.9rem;
    line-height: 1.4;
}

.ta-summary {
    border-top: 1px solid #30363d;
    padding-top: 25px;
    text-align: center;
}

/* Indicators Summary Styles */
.indicators-summary {
    margin-bottom: 30px;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.summary-section {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 20px;
}

.summary-section h3 {
    color: #58a6ff;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.summary-signal {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 8px;
    background: #161b22;
}

.summary-signal .signal-text {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.summary-signal.buy-summary .signal-text {
    color: #56d364;
}

.summary-signal.sell-summary .signal-text {
    color: #f85149;
}

.summary-signal.neutral-summary .signal-text {
    color: #f8c555;
}

.signal-count {
    font-size: 0.8rem;
    color: #8b949e;
    font-weight: 400;
}

.indicators-list {
    margin-bottom: 15px;
}

.indicator-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #21262d;
    border-radius: 6px;
    border: 1px solid #30363d;
    transition: all 0.2s ease;
}

.indicator-item:hover {
    background: #30363d;
}

.indicator-item.hidden {
    display: none;
}

.indicator-name {
    font-size: 0.85rem;
    color: #c9d1d9;
    font-weight: 400;
    flex: 1;
    text-align: left;
}

.indicator-value {
    font-size: 0.8rem;
    color: #8b949e;
    margin: 0 10px;
    font-family: 'Consolas', monospace;
}

.indicator-action {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    min-width: 50px;
    text-align: center;
}

.indicator-action.buy {
    background: rgba(35, 134, 54, 0.2);
    color: #56d364;
    border: 1px solid #238636;
}

.indicator-action.sell {
    background: rgba(248, 81, 73, 0.2);
    color: #f85149;
    border: 1px solid #da3633;
}

.indicator-action.neutral {
    background: rgba(248, 197, 85, 0.2);
    color: #f8c555;
    border: 1px solid #d29922;
}

.show-more-btn {
    background: transparent;
    border: none;
    color: #58a6ff;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 8px 0;
    width: 100%;
    text-align: center;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.show-more-btn:hover {
    background: rgba(88, 166, 255, 0.1);
    color: #79c0ff;
}

.overall-signal h3 {
    color: #f0f6fc;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.signal-indicator {
    display: inline-block;
    background: #0d1117;
    border: 2px solid #30363d;
    border-radius: 12px;
    padding: 25px 35px;
    transition: all 0.3s ease;
    min-width: 200px;
}

.signal-indicator.buy-signal {
    border-color: #238636;
    background: rgba(35, 134, 54, 0.15);
    box-shadow: 0 0 20px rgba(35, 134, 54, 0.2);
}

.signal-indicator.sell-signal {
    border-color: #da3633;
    background: rgba(248, 81, 73, 0.15);
    box-shadow: 0 0 20px rgba(248, 81, 73, 0.2);
}

.signal-indicator.neutral-signal {
    border-color: #d29922;
    background: rgba(248, 197, 85, 0.15);
    box-shadow: 0 0 20px rgba(248, 197, 85, 0.2);
}

.signal-text {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.signal-indicator.buy-signal .signal-text {
    color: #56d364;
}

.signal-indicator.sell-signal .signal-text {
    color: #f85149;
}

.signal-indicator.neutral-signal .signal-text {
    color: #f8c555;
}

.signal-strength {
    height: 6px;
    background: #21262d;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    width: 100px;
    margin: 0 auto;
}

.signal-strength::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #238636, #56d364);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.signal-indicator.buy-signal .signal-strength::after {
    background: linear-gradient(90deg, #238636, #56d364);
    width: var(--strength-width, 0%);
}

.signal-indicator.sell-signal .signal-strength::after {
    background: linear-gradient(90deg, #da3633, #f85149);
    width: var(--strength-width, 0%);
}

.signal-indicator.neutral-signal .signal-strength::after {
    background: linear-gradient(90deg, #d29922, #f8c555);
    width: var(--strength-width, 0%);
}

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

.info-card {
    background: #161b22;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #30363d;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    border-color: #58a6ff;
    box-shadow: 0 8px 25px rgba(88, 166, 255, 0.15);
}

.info-card h3 {
    color: #58a6ff;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

.info-card p {
    color: #c9d1d9;
    margin-bottom: 20px;
    line-height: 1.7;
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card li {
    color: #c9d1d9;
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.info-card li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: #58a6ff;
    font-size: 0.8rem;
}

.info-card strong {
    color: #f0f6fc;
}

/* Download Links */
.download-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.download-btn {
    display: inline-block;
    padding: 12px 20px;
    background: #21262d;
    color: #c9d1d9;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #30363d;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
}

.download-btn:hover {
    background: #30363d;
    border-color: #58a6ff;
    color: #58a6ff;
    transform: translateY(-2px);
}

.download-btn.primary {
    background: #238636;
    border-color: #238636;
    color: #ffffff;
}

.download-btn.primary:hover {
    background: #2ea043;
    border-color: #2ea043;
    color: #ffffff;
}

/* Footer */
.footer {
    background: #0d1117;
    border-top: 1px solid #21262d;
    padding: 30px 20px;
    text-align: center;
    margin-top: 40px;
}

.footer-content p {
    color: #8b949e;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.footer a {
    color: #58a6ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #79c0ff;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chart-controls {
        justify-content: center;
    }
    
    .chart-container {
        height: 400px; /* Normal mobile height */
    }
    
    .ta-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .timeframe-controls {
        justify-content: center;
    }
    
    .indicators-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .indicator-card {
        padding: 20px;
    }
    
    .speedometer-container canvas {
        width: 180px;
        height: 135px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .info-card {
        padding: 20px;
    }
    
    .container {
        padding: 15px;
    }
    
    .indicator-buttons {
        gap: 8px;
    }
    
    .indicator-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px; /* Smaller mobile height */
    }
    
    .chart-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .timeframe-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .speedometer-container canvas {
        width: 160px;
        height: 120px;
    }
    
    .signal-indicator {
        padding: 15px 20px;
    }
    
    .signal-text {
        font-size: 1.1rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
        font-size: 0.8rem;
    }
    
    .indicator-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-width: 60px;
    }
    
    .indicator-controls h3 {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .indicator-chart {
        height: 100px;
    }
    
    .indicator-header {
        padding: 10px 12px;
    }
    
    .indicator-title {
        font-size: 0.8rem;
    }
    
    .indicator-value {
        font-size: 0.75rem;
    }
}

/* Custom scrollbar for dark theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #161b22;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* Selection styling */
::selection {
    background: #58a6ff;
    color: #0d1117;
}

::-moz-selection {
    background: #58a6ff;
    color: #0d1117;
}