/* Sensor Data Table Styles */

.sensor-table-container {
    padding: 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Table Wrapper */
.sensor-table-wrapper {
    flex: 1;
    overflow: hidden;
    margin-bottom: 8px;
}

.sensor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

/* Table Header */
.sensor-table thead {
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.1) 0%, rgba(78, 203, 115, 0.1) 100%);
}

.sensor-table th {
    padding: 7px 6px;
    text-align: left;
    color: #00d4ff;
    font-weight: 600;
    font-size: 12px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
    white-space: nowrap;
}

/* Table Body */
.sensor-table tbody {
    display: block;
    max-height: 180px;
    overflow-y: auto;
}

.sensor-table tbody::-webkit-scrollbar {
    width: 4px;
}

.sensor-table tbody::-webkit-scrollbar-track {
    background: rgba(0, 212, 255, 0.1);
    border-radius: 2px;
}

.sensor-table tbody::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 2px;
}

.sensor-table tbody::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}

.sensor-table thead,
.sensor-table tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.sensor-table td {
    padding: 5px 6px;
    color: #8ab4f8;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

/* Table Row Styles */
.sensor-table tbody tr {
    transition: all 0.2s ease;
    cursor: pointer;
}

.sensor-table tbody tr:hover {
    background: rgba(0, 212, 255, 0.08);
}

.sensor-table tbody tr.status-normal {
    border-left: 2px solid #4ecb73;
}

.sensor-table tbody tr.status-warning {
    border-left: 2px solid #ffaa00;
    background: rgba(255, 170, 0, 0.05);
    animation: rowBreath 2s ease-in-out infinite;
}

.sensor-table tbody tr.status-danger {
    border-left: 2px solid #ff3366;
    background: rgba(255, 51, 102, 0.08);
    animation: rowPulse 1.5s ease-in-out infinite;
}

/* Status Indicator */
.sensor-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sensor-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.sensor-status-dot.normal {
    background: #4ecb73;
    box-shadow: 0 0 6px rgba(78, 203, 115, 0.6);
}

.sensor-status-dot.warning {
    background: #ffaa00;
    box-shadow: 0 0 6px rgba(255, 170, 0, 0.6);
}

.sensor-status-dot.danger {
    background: #ff3366;
    box-shadow: 0 0 8px rgba(255, 51, 102, 0.8);
}

.sensor-status-text {
    font-size: 12px;
}

.sensor-status-text.normal {
    color: #4ecb73;
}

.sensor-status-text.warning {
    color: #ffaa00;
}

.sensor-status-text.danger {
    color: #ff3366;
}

/* Sensor Value */
.sensor-value {
    font-weight: 600;
    color: #fff;
}

.sensor-value.normal {
    color: #4ecb73;
}

.sensor-value.warning {
    color: #ffaa00;
}

.sensor-value.danger {
    color: #ff3366;
}

/* Update Time */
.sensor-update-time {
    font-size: 11px;
    color: #6b8ba8;
}

/* Pagination Controls */
.sensor-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 0;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
}

.sensor-pagination-info {
    font-size: 12px;
    color: #8ab4f8;
}

.sensor-pagination-controls {
    display: flex;
    gap: 4px;
}

.sensor-pagination-btn {
    padding: 4px 10px;
    font-size: 12px;
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sensor-pagination-btn:hover:not(:disabled) {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.5);
}

.sensor-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.sensor-pagination-btn.active {
    background: rgba(0, 212, 255, 0.3);
    border-color: #00d4ff;
    font-weight: 600;
}

/* Loading State */
.sensor-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 180px;
    color: #8ab4f8;
    font-size: 12px;
}

.sensor-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    margin-left: 8px;
    border: 2px solid rgba(0, 212, 255, 0.2);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Animations */
@keyframes rowBreath {

    0%,
    100% {
        background: rgba(255, 170, 0, 0.05);
    }

    50% {
        background: rgba(255, 170, 0, 0.12);
    }
}

@keyframes rowPulse {

    0%,
    100% {
        background: rgba(255, 51, 102, 0.08);
    }

    50% {
        background: rgba(255, 51, 102, 0.15);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Value Update Animation */
.sensor-value.updating {
    animation: valueUpdate 0.5s ease;
}

@keyframes valueUpdate {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
        color: #00d4ff;
    }
}

/* Column Widths */
.sensor-table th:nth-child(1),
.sensor-table td:nth-child(1) {
    width: 16%;
}

.sensor-table th:nth-child(2),
.sensor-table td:nth-child(2) {
    width: 24%;
}

.sensor-table th:nth-child(3),
.sensor-table td:nth-child(3) {
    width: 14%;
    text-align: center;
}

.sensor-table th:nth-child(4),
.sensor-table td:nth-child(4) {
    width: 14%;
    text-align: center;
}

.sensor-table th:nth-child(5),
.sensor-table td:nth-child(5) {
    width: 14%;
    text-align: center;
}

.sensor-table th:nth-child(6),
.sensor-table td:nth-child(6) {
    width: 18%;
    text-align: center;
    font-size: 11px;
}
