/* W3.5 Activity 7: Chart.js Styling */

* {
    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;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-secondary {
    background: #2196F3;
    color: white;
}

.btn-accent {
    background: #FF9800;
    color: white;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.chart-controls .btn {
    background: #e0e0e0;
    color: #333;
}

.chart-controls .btn:hover {
    background: #d0d0d0;
}

.sort-stock.btn-active {
    background: #333 !important;
    color: white !important;
    box-shadow: inset 0 3px 5px rgba(0,0,0,0.3) !important;
    font-weight: 700 !important;
    transform: scale(0.98);
}

.status {
    text-align: center;
    margin-bottom: 30px;
}

.status-indicator {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255,255,255,0.9);
    border-radius: 20px;
    font-weight: 600;
    color: #333;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.chart-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.chart-container h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.chart-container canvas {
    max-height: 300px;
    width: 100% !important;
    height: auto !important;
}

.chart-info {
    margin-top: 10px;
    text-align: center;
}

.chart-info small {
    color: #666;
    font-style: italic;
}

.data-preview {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.data-preview h3 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.data-preview pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.4;
    color: #495057;
    max-height: 300px;
    overflow-y: auto;
}

/* Loading animations */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.chart-container.loading::after {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.9);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    color: #666;
}

/* Responsive design */
@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

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

    .btn {
        width: 200px;
    }

    header h1 {
        font-size: 2rem;
    }
}

/* Chart-specific styling overrides */
.chart-container#weather-container {
    border-left: 4px solid #4CAF50;
}

.chart-container#stock-container {
    border-left: 4px solid #2196F3;
}

.chart-container#user-container {
    border-left: 4px solid #FF9800;
}

.chart-container#performance-container {
    border-left: 4px solid #9C27B0;
}