/* Investment Analyst Flask Frontend Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
}

.nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Technical Analysis Styles */
.technical-analysis {
    max-width: 1400px;
    margin: 0 auto;
}

.technical-analysis h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 2.5rem;
}

/* Status Card */
.status-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #007bff;
}

.status-card h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.status-indicator {
    font-size: 1.1rem;
}

.status-success {
    color: #28a745;
    font-weight: bold;
}

.status-error {
    color: #dc3545;
    font-weight: bold;
}

.status-details {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* Controls Section */
.controls-section {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.select-input {
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 1rem;
    min-width: 150px;
    background: white;
    transition: border-color 0.3s ease;
}

.select-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Search Section */
.search-section {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #28a745;
}

.search-section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.search-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 300px;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.search-results {
    margin-top: 1rem;
}

.search-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin: 0.5rem 0;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.search-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.search-result-success {
    border-left: 4px solid #28a745;
}

.search-result-warning {
    border-left: 4px solid #ffc107;
}

.search-result-info {
    flex: 1;
}

.search-result-status {
    display: block;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.search-tip {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 1rem;
    padding: 1rem;
    background: #e7f3ff;
    border-radius: 5px;
    border-left: 4px solid #007bff;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
    margin: 1rem 0;
}

.loading-message {
    background: #d1ecf1;
    color: #0c5460;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #bee5eb;
    margin: 1rem 0;
    text-align: center;
}

.loading {
    color: #007bff;
    font-style: italic;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Analysis Results */
.analysis-results {
    margin-top: 2rem;
}

.analysis-results h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 2rem;
}

/* Chart Sections */
.chart-section {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    text-align: center;
}

.chart-section canvas {
    max-width: 100%;
    height: auto;
}

/* Analysis Cards */
.analysis-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.analysis-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #007bff;
    transition: transform 0.3s ease;
}

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

.analysis-card.ai-insights {
    border-left-color: #6f42c1;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
}

.analysis-card h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.2rem;
}

.card-content {
    font-size: 0.95rem;
}

/* Info Grids */
.info-grid, .signals-grid, .ai-grid {
    display: grid;
    gap: 0.75rem;
}

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

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

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

.info-item, .signal-item, .ai-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid #e9ecef;
}

.info-item label, .signal-item label, .ai-item label {
    font-weight: 600;
    color: #495057;
}

.info-item .value, .ai-item .value {
    font-weight: 500;
    color: #2c3e50;
}

.signal {
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}

.signal.buy {
    background: #d4edda;
    color: #155724;
}

.signal.sell {
    background: #f8d7da;
    color: #721c24;
}

.signal.hold {
    background: #fff3cd;
    color: #856404;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        justify-content: center;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-controls {
        flex-direction: column;
    }

    .search-input {
        min-width: auto;
    }

    .search-result {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .analysis-cards {
        grid-template-columns: 1fr;
    }

    .info-grid, .ai-grid {
        grid-template-columns: 1fr;
    }

    .technical-analysis h1 {
        font-size: 2rem;
    }
}

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

    .technical-analysis h1 {
        font-size: 1.5rem;
    }

    .analysis-card, .status-card, .controls-section, .search-section {
        padding: 1rem;
    }
}

/* Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Accessibility */
.btn:focus, .select-input:focus, .search-input:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .header, .footer, .search-section, .controls-section {
        display: none;
    }
    
    .analysis-results {
        margin-top: 0;
    }
    
    .analysis-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
