/* public/css/custom.css - Estilos personalizados para el sistema de pantallas LCD */

/* Variables CSS */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #212529;
    --light-color: #f8f9fa;
}

/* Estilos generales */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    line-height: 1.6;
}

/* Header */
header h1 {
    font-weight: 300;
    letter-spacing: -0.5px;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Tabla */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    font-size: 0.875rem;
    border-top: none;
    padding: 1rem 0.75rem;
}

.table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Botones */
.refresh-btn {
    min-width: 100px;
    transition: all 0.2s ease-in-out;
}

.refresh-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.refresh-btn:disabled {
    transform: none;
    box-shadow: none;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Estados de loading */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Badges de estado */
.badge {
    font-size: 0.75em;
    font-weight: 500;
    padding: 0.375rem 0.5rem;
}

.badge.bg-success {
    background-color: var(--success-color) !important;
}

.badge.bg-warning {
    background-color: var(--warning-color) !important;
    color: var(--dark-color) !important;
}

.badge.bg-danger {
    background-color: var(--danger-color) !important;
}

/* Iconos */
.fas, .far {
    font-size: 0.875em;
}

/* Toast notifications */
.toast {
    min-width: 300px;
}

.toast-header {
    font-weight: 600;
}

/* Responsive design */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

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

    .refresh-btn {
        min-width: 80px;
        font-size: 0.8rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .card-header h5 {
        font-size: 1rem;
    }

    #connectionIndicator {
        top: 10px !important;
        right: 10px !important;
        margin: 0 !important;
    }
}

@media (max-width: 576px) {
    .table-responsive {
        font-size: 0.8rem;
    }

    .refresh-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .badge {
        font-size: 0.65em;
        padding: 0.25rem 0.375rem;
    }

    /* Ocultar columnas menos importantes en móvil */
    .table th:nth-child(4),
    .table td:nth-child(4) {
        display: none;
    }
}

/* Animaciones */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.pulsing {
    animation: pulse 1s infinite;
}

/* Focus states para accesibilidad */
.btn:focus,
.btn:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Indicador de conexión */
#connectionIndicator {
    z-index: 1000;
}

#connectionIcon {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

#connectionIcon.offline {
    color: #dc3545 !important;
    animation: blink 1s infinite;
}

#connectionIcon.checking {
    color: #ffc107 !important;
    animation: pulse-connection 1.5s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

@keyframes pulse-connection {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Estados de conexión (legacy) */
.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

.status-online {
    color: var(--success-color);
}

.status-offline {
    color: var(--danger-color);
}

/* Mejoras de accesibilidad */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print styles */
@media print {
    .btn,
    .toast-container {
        display: none !important;
    }

    .table {
        color: black !important;
    }
}

/* Dark mode support (futuro) */
@media (prefers-color-scheme: dark) {
    /* Estilos para dark mode pueden agregarse aquí en el futuro */
}

/* Utilidades personalizadas */
.text-truncate-mobile {
    @media (max-width: 576px) {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
}