/* Technical Analysis Styling */

/* Layout Improvements */
.analysis-container {
    padding: 0;
}

.symbol-search {
    margin-bottom: 2rem;
}

.symbol-search .form-control {
    border-radius: 12px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.symbol-search .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Chart Container */
.chart-container {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 1rem;
}

.chart-wrapper {
    position: relative;
    height: 400px;
    padding: 1rem;
}

.secondary-chart {
    height: 200px;
}

/* Loading Spinner */
.chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Technical Indicators Panel */
.indicator-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.indicator-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    z-index: 1;
}

.indicator-panel > * {
    position: relative;
    z-index: 2;
}

.indicator-panel h5 {
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.indicator-panel h5::before {
    content: '📊';
    font-size: 1.2em;
}

/* Gauge Charts */
.gauge-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 1rem 0;
}

.gauge-item {
    text-align: center;
    flex: 1;
}

.gauge-canvas {
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.gauge-label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
}

.gauge-value {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Analysis Controls */
.analysis-controls {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
}

.control-group {
    margin-bottom: 1rem;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.btn-group .btn {
    border-radius: 8px;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

.btn-group .btn.active {
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    border-color: #0d6efd;
    color: white;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
    transform: translateY(-1px);
}

/* Custom Checkboxes */
.form-check {
    margin-bottom: 0.75rem;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-label {
    font-weight: 500;
    color: #495057;
    cursor: pointer;
}

/* Symbol Suggestions */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.suggestions-list .list-group-item {
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.suggestions-list .list-group-item:hover {
    background-color: #f8f9fa;
}

.suggestions-list .list-group-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.suggestions-list .list-group-item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .analysis-container {
        padding: 0 1rem;
    }
    
    .chart-wrapper {
        height: 300px;
        padding: 0.5rem;
    }
    
    .secondary-chart {
        height: 150px;
    }
    
    .indicator-panel {
        padding: 1rem;
    }
    
    .gauge-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .gauge-item {
        width: 100%;
    }
    
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        flex: 1;
        min-width: calc(50% - 0.25rem);
        margin-right: 0;
    }
}

@media (max-width: 576px) {
    .symbol-search .form-control {
        font-size: 1rem;
        padding: 0.5rem 0.75rem;
    }
    
    .analysis-controls {
        padding: 1rem;
    }
    
    .chart-wrapper {
        height: 250px;
    }
    
    .secondary-chart {
        height: 120px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Chart Fullscreen */
.chart-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: white;
    padding: 2rem;
}

.chart-fullscreen .chart-wrapper {
    height: calc(100vh - 4rem);
}

.fullscreen-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.fullscreen-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .chart-container {
        background: #2d3748;
        border: 1px solid #4a5568;
    }
    
    .analysis-controls {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .control-group label {
        color: #e2e8f0;
    }
    
    .form-check-label {
        color: #e2e8f0;
    }
    
    .suggestions-list {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .suggestions-list .list-group-item {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .suggestions-list .list-group-item:hover {
        background: #4a5568;
    }
}
