/* Dashboard styles */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f9fafb;
    --dark-text: #1f2937;
    --medium-text: #4b5563;
    --light-text: #9ca3af;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--dark-text);
    line-height: 1.5;
}

.dashboard-card {
    min-height: 450px;
    position: relative;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.dashboard-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

.summary-card {
    min-height: 120px;
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
}

/* Logo styling */
.logo-container {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    background-color: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

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

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto;
}

/* Chart tooltip customization */
.chart-tooltip {
    background-color: rgba(31, 41, 55, 0.9);
    color: white;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Fix for chart aspect ratio */
canvas.chartjs-render-monitor {
    max-height: 350px;
}

/* For the larger chart that spans multiple columns */
.lg\:col-span-3 .chart-container {
    height: 400px;
}

/* Special handling for the material-defect chart (larger) */
#material-defect-chart {
    max-height: 400px !important;
}

/* Ensure adequate spacing between charts and insights text */
.dashboard-card .mt-8 {
    margin-top: 2rem !important;
}

/* Add padding around charts */
.chart-padding {
    padding: 10px;
}

/* Time period selector styling */
.time-selector select, 
.time-granularity select {
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background-color: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--dark-text);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.time-selector select:focus,
.time-granularity select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Add a subtle highlighting effect to time period labels */
.time-period-label {
    font-weight: 500;
    color: var(--primary-dark);
    transition: all 0.3s ease;
    position: relative;
}

/* Add animation for loading state */
.loading {
    opacity: 0.7;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Add a pulsing effect for loading indicator */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

body.loading-data .chart-container {
    animation: pulse 1.5s infinite;
}

/* Insights boxes styling */
.bg-gray-50 {
    background-color: #f9fafb;
}

/* Executive summary section */
.prose {
    max-width: 65ch;
    color: var(--dark-text);
}

.prose h4 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--primary-dark);
}

.prose ul {
    margin-top: 0.5em;
    margin-bottom: 1em;
}

.prose li {
    margin-top: 0.25em;
    margin-bottom: 0.25em;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .chart-container {
        height: 300px;
    }
    
    .dashboard-card {
        min-height: 400px;
    }
}

@media (max-width: 640px) {
    .chart-container {
        height: 250px;
    }
    
    .dashboard-card {
        min-height: 350px;
    }
}