/* dashboard/static/css/dashboard.css */

/* General Styles */
body {
    background-color: #f8f9fa;
}
/* Fix chart container heights */
.card canvas {
    max-height: 350px;
}

/* Set explicit container heights for each chart type */
.progress-circle canvas, 
.temp-gauge canvas {
    height: 150px !important;
    width: 150px !important;
}

/* For smaller screens */
@media (max-width: 768px) {
    .progress-circle canvas, 
    .temp-gauge canvas {
        height: 120px !important;
        width: 120px !important;
    }
}

/* Fix for line charts */
.card-body canvas:not(.progress-circle canvas):not(.temp-gauge canvas) {
    max-height: 300px !important;
}
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1rem;
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    padding: 0.75rem 1rem;
}

/* Progress Circle and Gauge Styles */
.progress-circle, .temp-gauge {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto;
}

.progress-circle-percentage, .temp-gauge-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: bold;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
}

/* Transitions for smoother updates */
.progress-bar {
    transition: width 0.5s ease-in-out;
}

/* Card hover effect */
.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease-in-out;
}

/* Scrollable areas */
#io-devices, #temp-sensors {
    max-height: 150px;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Dashboard Grid Responsiveness */
@media (max-width: 768px) {
    .progress-circle, .temp-gauge {
        width: 120px;
        height: 120px;
    }
    
    .progress-circle-percentage, .temp-gauge-value {
        font-size: 18px;
    }
}

/* Dark Mode Styles */
[data-bs-theme="dark"] {
    --bs-body-bg: #212529;
    --bs-body-color: #dee2e6;
}

[data-bs-theme="dark"] .card {
    background-color: #2c3034;
    border-color: #373b3e;
}

[data-bs-theme="dark"] .card-header {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .table {
    color: #dee2e6;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    color: #dee2e6;
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .progress {
    background-color: #373b3e;
}

/* Animation for refreshing data */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.refreshing {
    animation: pulse 1s infinite;
}

/* Additional Chart Styling */
canvas {
    max-width: 100%;
}

/* Badge styling */
.badge {
    font-weight: 500;
}

/* Settings button hover effect */
.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Active history button */
.history-btn.active {
    background-color: #6c757d;
    color: white;
}