/* Temperature Monitoring System Global Styles */

.history-section {
    margin-top: 2rem;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    padding: 1.5rem;
    border: 1px solid rgba(226, 232, 240, 0.7);
}
.history-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #0f172a;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}
.data-table thead {
    background: #f8fafc;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #475569;
}
.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}
th.sortable {
    cursor: pointer;
}

th.sortable.active {
    background: #344763;
}
.data-row:hover {
    background: #f8fafc;
    transition: background 0.2s ease;
}
.date-cell .date-main {
    font-weight: 700;
    color: #0f172a;
}
.date-cell .time-sub {
    font-size: 0.85rem;
    color: #64748b;
}
.temp-cell .temp-value {
    font-weight: 700;
    color: #111827;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #0f172a;
}
.status-badge.neutral {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
}
.actions-cell .action-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.actions-cell .action-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}
.empty-state {
    text-align: center;
    padding: 24px;
    color: #94a3b8;
    font-weight: 600;
}
.pagination-container {
    margin-top: 1rem;
}

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

.page-header {
    background: #2563eb;
    color: white;
    padding: 30px;
    border-radius: 0px;
    margin-bottom: 30px;
    text-align: center;
}

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

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

.monitoring-section,
.history-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.monitoring-section h2,
.history-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 2px solid #f1f2f6;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-card.critical {
    border-color: #e74c3c;
    background: linear-gradient(45deg, #ffffff, #fdf2f2);
}

.stat-card.warning {
    border-color: #f39c12;
    background: linear-gradient(45deg, #ffffff, #fef9f0);
}

.stat-card.normal {
    border-color: #27ae60;
    background: linear-gradient(45deg, #ffffff, #f0f8f4);
}

.stat-card.no-data {
    border-color: #95a5a6;
    background: linear-gradient(45deg, #ffffff, #f8f9fa);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-value.critical {
    color: #e74c3c;
}
.stat-value.warning {
    color: #f39c12;
}
.stat-value.normal {
    color: #27ae60;
}
.stat-value.no-data {
    color: #95a5a6;
}

.stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 600;
    margin-bottom: 3px;
}

.stat-time {
    font-size: 0.8rem;
    color: #bdc3c7;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-indicator.critical {
    background: #e74c3c;
    animation: pulse 2s infinite;
}

.status-indicator.warning {
    background: #f39c12;
}
.status-indicator.normal {
    background: #27ae60;
}
.status-indicator.no-data {
    background: #95a5a6;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.chart-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.chart-container h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

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

.filter-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.filter-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.form-control:focus {
    border-color: #3498db;
    outline: none;
}

.number-cell {
    text-align: center;
    font-family: monospace;
    font-weight: 600;
}

.diff-cell {
    color: #7c3aed;
    /* purple */
}

.time-main {
    font-weight: 600;
}

.date-sub {
    font-size: 12px;
    color: #9ca3af;
}

.status-badge.success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.status-badge.danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.period-stats {
    margin-bottom: 25px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-box {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #ecf0f1;
}

.stat-box.critical {
    border-color: #e74c3c;
    background: #fdf2f2;
}

.stat-box strong {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: #2c3e50;
}

.stat-box.critical strong {
    color: #e74c3c;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.data-row.critical {
    background: linear-gradient(90deg, #fdf2f2, #ffffff);
    border-left: 4px solid #e74c3c;
}

.data-row.warning {
    background: linear-gradient(90deg, #fef9f0, #ffffff);
    border-left: 4px solid #f39c12;
}

.data-row.normal {
    background: linear-gradient(90deg, #f0f8f4, #ffffff);
    border-left: 4px solid #27ae60;
}

.date-main {
    font-weight: 600;
    color: #2c3e50;
}

.time-sub {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.temp-value {
    font-size: 1.2rem;
    font-weight: bold;
}

.temp-value.critical {
    color: #e74c3c;
}
.temp-value.warning {
    color: #f39c12;
}
.temp-value.normal {
    color: #27ae60;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.critical {
    background: #e74c3c;
    color: white;
}

.status-badge.warning {
    background: #f39c12;
    color: white;
}

.status-badge.normal {
    background: #27ae60;
    color: white;
}

.action-alert {
    color: #e74c3c;
    font-weight: 600;
}

.action-ok {
    color: #27ae60;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.empty-message {
    font-size: 1.1rem;
}

.lubrication-alert {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
    animation: shake 0.5s ease-in-out infinite alternate;
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.3);
}

@keyframes shake {
    from {
        transform: translateX(-2px);
    }
    to {
        transform: translateX(2px);
    }
}

.footer-info {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .temperature-container {
        padding: 10px;
    }

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

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

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}
