/**
 * TELEMETRY DASHBOARD - Estilo WEG Industrial
 * Painel flutuante de telemetria com visual moderno
 */

/* ========================================
   CONTAINER PRINCIPAL
   ======================================== */
#telemetry-dashboard {
    position: fixed;
    z-index: 9999;
    width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    user-select: none;
}

#telemetry-dashboard.minimized {
    width: 280px;
}

.telemetry-panel {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    overflow: hidden;
}


/* ========================================
   HEADER E CONTROLES
   ======================================== */
.telemetry-header {
    background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
    padding: 12px 16px;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.telemetry-header .title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
}

.telemetry-header .pulse-icon {
    animation: pulse 2s infinite;
}

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

.telemetry-header .controls {
    display: flex;
    gap: 8px;
}

.telemetry-header .btn-control {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.telemetry-header .btn-control:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}


/* ========================================
   BODY E SCROLLBAR
   ======================================== */
.telemetry-body {
    padding: 16px;
    max-height: 600px;
    overflow-y: auto;
}

.telemetry-body::-webkit-scrollbar {
    width: 6px;
}

.telemetry-body::-webkit-scrollbar-track {
    background: rgba(51, 65, 85, 0.3);
}

.telemetry-body::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 3px;
}

.telemetry-body::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

#telemetry-dashboard.minimized .telemetry-body {
    display: none;
}


/* ========================================
   STATUS BADGE
   ======================================== */
.status-online {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-text {
    color: #22c55e;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
}


/* ========================================
   METRIC CARDS
   ======================================== */
.metric-card {
    border-radius: 8px;
    padding: 8px;
    /* margin-bottom: 12px; */
    border: 1px solid;
}

.metric-card.yellow {
    background: rgba(234, 179, 8, 0.05);
    border-color: rgba(234, 179, 8, 0.3);
}

.metric-card.purple {
    background: rgba(168, 85, 247, 0.05);
    border-color: rgba(168, 85, 247, 0.3);
}

.metric-card.blue {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
}

.metric-card.green {
    background: rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.3);
}

.metric-card.cyan {
    background: rgba(6, 182, 212, 0.05);
    border-color: rgba(6, 182, 212, 0.3);
}

.metric-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.metric-icon {
    font-size: 14px;
}

.metric-icon.yellow { color: #eab308; }
.metric-icon.purple { color: #a855f7; }
.metric-icon.blue { color: #3b82f6; }
.metric-icon.green { color: #22c55e; }
.metric-icon.cyan { color: #06b6d4; }

.metric-title {
    color: white;
    font-weight: bold;
    font-size: 12px;
    letter-spacing: 1px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-label {
    color: #94a3b8;
    font-size: 12px;
}

.metric-value {
    color: white;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}


/* ========================================
   BOTÃO EXPORTAR
   ======================================== */
.btn-export {
    width: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    color: white;
    font-weight: bold;
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-export:hover {
    background: linear-gradient(90deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
    transform: translateY(-2px);
}