/* ==========================================
   Visium24 - Estilos Complementarios para Tailwind
   ========================================== */

/* Este archivo contiene solo estilos que Tailwind no puede manejar
   o que requieren personalizacion especifica */

/* ===== VARIABLES CSS (para compatibilidad) ===== */
:root {
    --color-primary: #4a90e2;
    --color-primary-dark: #3a7bc8;
    --color-secondary: #667eea;
    --color-success: #28a745;
    --color-danger: #dc3545;
    --color-warning: #ffc107;
}

/* ===== FIX DATE/TIME INPUT ICONS ===== */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

input[type="datetime-local"] {
    min-width: 190px;
}

/* ===== SECTION TITLES MOVED TO HEADER ===== */
h2.section-title {
    display: none;
}

/* ===== FIX CHART.JS CANVAS Z-INDEX ===== */
canvas {
    position: relative;
    z-index: 0;
}

/* ===== SIDEBAR MENU ===== */
#sidebar {
    background-color: #0E1530;
    font-family: sans-serif;
}

#sidebar .sidebar-header {
    border-color: rgba(255, 255, 255, 0.1);
}

.sidebar-item {
    color: #D9D9D9;
}

.sidebar-item:hover,
.sidebar-item.active {
    background-color: #3B82F6 !important;
    color: #0F172A !important;
}

/* ===== SCROLLBAR PERSONALIZADO ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== ESTILOS PARA COMPONENTES GENERADOS POR JS ===== */

/* Tarjetas de dispositivos (generadas dinamicamente) */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.device-card {
    background: #1F2A44;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.device-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.device-card h3 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.device-card .device-info {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.8;
}

.device-card .device-info p {
    margin: 0.5rem 0;
}

.device-card .device-info strong {
    color: #1e293b;
    font-weight: 600;
}

/* Badges de estado */
.status-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-online {
    background: #dcfce7;
    color: #166534;
}

.status-offline {
    background: #fee2e2;
    color: #991b1b;
}

/* Tablas de datos */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    background: #1F2A44;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

.data-table th {
    background: #1F2A44;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: #1F2A44;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Info box */
.info-box {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: #eff6ff;
    border-left: 4px solid var(--color-primary);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.info-box strong {
    color: var(--color-primary);
    font-weight: 600;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 5rem 1.25rem;
    color: #94a3b8;
}

.empty-state p {
    font-size: 1rem;
    margin-top: 0.75rem;
}

/* Botones generados por JS */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

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

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .devices-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .device-card {
        padding: 1rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .data-table {
        font-size: 0.75rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}
