/**
 * METERING DASHBOARD - Estilos específicos
 * Version: 3.0 (2025-12-20) - Static Indicator + Skeleton Screens
 * Lohmia UI System
 */

/* =============================================
   CSS VARIABLES - Paleta Lohmia
   ============================================= */
:root {
    --lohmia-accent: #00D4AA;
    --lohmia-accent-hover: #00B894;
    --lohmia-accent-shadow: rgba(0, 212, 170, 0.4);
}

/* =============================================
   GRID LAYOUT - Métricas 2x2
   ============================================= */
.metrics-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 20px !important;
}

@media (max-width: 600px) {
    .metrics-grid {
        grid-template-columns: 1fr !important;
    }
}

/* =============================================
   CARD STYLES
   ============================================= */
.card {
    margin-bottom: 20px;
}

.grid .card,
.metrics-grid .card {
    margin-bottom: 0;
}

/* =============================================
   LIVE STATUS - Indicador estático con timestamp
   ============================================= */
.live-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    vertical-align: middle;
    font-size: 12px;
    /* Badge sutil opcional */
    background: rgba(0, 212, 170, 0.08);
    border: 1px solid rgba(0, 212, 170, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #00D4AA;
    border-radius: 50%;
    flex-shrink: 0;
    /* SIN ANIMACIÓN - punto sólido estático */
}

.status-text {
    font-size: 12px;
    font-weight: 600;
    color: #00D4AA;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.status-separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

.last-update {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    white-space: nowrap;
}

/* =============================================
   VIEW CONTENT - Para bottom-nav
   ============================================= */
.view-content {
    display: none;
}

.view-content.active {
    display: block;
}

/* =============================================
   SVG ICON STYLES - Sistema unificado
   ============================================= */

/* Title icon (h1) */
.title-icon {
    width: 28px;
    height: 28px;
    vertical-align: middle;
    margin-right: 8px;
    stroke: var(--lohmia-accent);
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Card title icons */
.card-title-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 6px;
    stroke: var(--lohmia-accent);
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Card secondary icon (right side) */
.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon svg {
    width: 24px;
    height: 24px;
    stroke: rgba(255, 255, 255, 0.5);
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.2s ease;
}

.card:hover .card-icon svg {
    stroke: var(--lohmia-accent);
}

/* Button icons */
.btn-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Status icons (success, warning, error) */
.status-icon {
    vertical-align: middle;
    margin-right: 8px;
}

.status-icon.success {
    stroke: #10b981;
}

.status-icon.warning {
    stroke: #f59e0b;
}

.status-icon.error {
    stroke: #ef4444;
}

/* Toast notification SVG icons */
.toast-svg {
    flex-shrink: 0;
}

.toast.success .toast-svg {
    stroke: #10b981;
}

.toast.warning .toast-svg {
    stroke: #f59e0b;
}

.toast.error .toast-svg {
    stroke: #ef4444;
}

.toast.info .toast-svg {
    stroke: #00D4AA;
}

/* No alerts message */
.no-alerts {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #10b981;
    font-size: 14px;
}

.no-alerts svg {
    margin-right: 8px;
    stroke: #10b981;
}

/* =============================================
   SKELETON SCREENS - Loading placeholders
   ============================================= */

/* Variables skeleton */
:root {
    --skeleton-bg: rgba(255, 255, 255, 0.08);
    --skeleton-pulse-from: 0.4;
    --skeleton-pulse-to: 0.7;
}

/* Animación de pulso sutil - SOLO opacity, NO rotación */
@keyframes skeletonPulse {
    0%, 100% { opacity: var(--skeleton-pulse-from); }
    50% { opacity: var(--skeleton-pulse-to); }
}

/* Grid skeleton para métricas */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.skeleton-metric {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

/* Lista skeleton para alertas */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-list-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

/* Tabla skeleton */
.skeleton-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-row {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.skeleton-cell {
    flex: 1;
    height: 16px;
    background: var(--skeleton-bg);
    border-radius: 4px;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

/* Respetar preferencias de animación reducida */
@media (prefers-reduced-motion: reduce) {
    .skeleton-line,
    .skeleton-cell {
        animation: none;
        opacity: 0.5;
    }
}
