/* static/css/styles.css */

/* Animaciones personalizadas */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
    }
}

/* Estilos generales */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

.pulse-glow {
    animation: pulse-glow 2s infinite;
}

/* Tarjetas con efecto hover */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Estados de dispositivo */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-online {
    background-color: #10B981;
    color: white;
}

.status-offline {
    background-color: #6B7280;
    color: white;
}

.status-alarm {
    background-color: #EF4444;
    color: white;
    animation: pulse 1.5s infinite;
}

/* Botones personalizados */
.btn-primary {
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563EB 0%, #1E40AF 100%);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    transform: translateY(-2px);
}

/* Tablas */
.table-striped tbody tr:nth-child(odd) {
    background-color: #F9FAFB;
}

.table-hover tbody tr:hover {
    background-color: #F3F4F6;
}

/* Formularios */
.form-input {
    transition: all 0.2s ease;
}

.form-input:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Loader */
.loader {
    border: 4px solid #F3F4F6;
    border-top: 4px solid #3B82F6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.loader-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    animation: slideUp 0.3s ease-out;
}

/* Dashboard stats */
.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
}

/* Scrollbar personalizada */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    animation: slideUp 0.3s ease;
}

/* Badges para eventos */
.event-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

.event-info {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.event-success {
    background-color: #D1FAE5;
    color: #065F46;
}

.event-warning {
    background-color: #FEF3C7;
    color: #92400E;
}

.event-danger {
    background-color: #FEE2E2;
    color: #991B1B;
}

/* Alertas de alarma */
@keyframes alarm-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.alarm-active {
    animation: alarm-pulse 1s infinite;
    border-color: #dc2626 !important;
    background: linear-gradient(45deg, #fef2f2, #fee2e2) !important;
}

.alarm-flash {
    animation: flash 0.5s infinite alternate;
}

@keyframes flash {
    from {
        background-color: #fee2e2;
    }

    to {
        background-color: #fca5a5;
    }
}

/* Responsive utilities */
@media (max-width: 640px) {
    .mobile-stack {
        flex-direction: column !important;
    }

    .mobile-full {
        width: 100% !important;
    }
}

/* static/css/styles.css - Actualización para móviles */

/* Base responsive */
@media (max-width: 640px) {
    body {
        font-size: 16px;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-container {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Mejorar toques */
    .touch-target {
        min-height: 44px;
        min-width: 44px;
    }

    /* Mejorar inputs en iOS */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Mejoras de tarjetas para móviles */
.mobile-card {
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-card:active {
    transform: scale(0.98);
}

/* Estados de alarma simplificados */
.alarm-status {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
}

.alarm-status-safe {
    background-color: #D1FAE5;
    color: #065F46;
}

.alarm-status-armed {
    background-color: #FEE2E2;
    color: #991B1B;
    animation: pulse 2s infinite;
}

.alarm-status-alert {
    background-color: #FEF3C7;
    color: #92400E;
    animation: pulse 1s infinite;
}

.alarm-status-offline {
    background-color: #F3F4F6;
    color: #6B7280;
}

/* Botones móviles grandes */
.mobile-btn {
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    border-radius: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.mobile-btn:active {
    transform: scale(0.95);
}

.mobile-btn-primary {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
}

.mobile-btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
}

.mobile-btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
}

/* Grid responsive para estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* Animación para modales móviles */
@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-mobile {
    animation: slideInFromBottom 0.3s ease;
}

/* Scroll suave para móviles */
.scroll-mobile {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Mejorar visibilidad de estado */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-online {
    background-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-offline {
    background-color: #6B7280;
}

.status-alarm {
    background-color: #EF4444;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

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

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Clases utilitarias para responsive */
.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .show-mobile {
        display: block;
    }

    .hide-mobile {
        display: none;
    }
}

/* Mejorar tipografía para móviles */
@media (max-width: 640px) {
    h1 {
        font-size: 1.75rem;
        line-height: 2.25rem;
    }

    h2 {
        font-size: 1.5rem;
        line-height: 2rem;
    }

    h3 {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }

    p {
        line-height: 1.5;
    }
}

/* Espaciado seguro para barra de navegación móvil */
.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom, 70px);
}


/* Estilos para notificaciones móviles */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Mejoras para tabs móviles */
.mobile-tab-container {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
}

/* Animaciones para modales móviles */
@keyframes slide-up-modal {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-modal {
    animation: slide-up-modal 0.3s ease-out;
}

/* Mejoras para formularios en móviles */
@media (max-width: 640px) {
    .form-section {
        margin-bottom: 1.5rem;
        padding: 1rem;
        background: white;
        border-radius: 0.75rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .form-section h3 {
        font-size: 1.125rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #f3f4f6;
    }
}

/* Estados para elementos interactivos */
.interactive-item {
    transition: all 0.2s ease;
}

.interactive-item:active {
    transform: scale(0.98);
}

.interactive-item:hover {
    background-color: #f9fafb;
}

/* Scroll personalizado para móviles */
.mobile-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.mobile-scroll::-webkit-scrollbar {
    display: none;
}

/* Espaciado seguro para iPhone */
.safe-area-padding {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Estilos para botones de acción flotantes */
.floating-action-button {
    position: fixed;
    bottom: 5rem;
    right: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    z-index: 40;
}

.floating-action-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
}

/* Mejoras para listas en móviles */
.mobile-list-item {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-list-item:last-child {
    border-bottom: none;
}

.mobile-list-item:active {
    background-color: #f9fafb;
}

/* Estados de carga para móviles */
.mobile-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6b7280;
}

.mobile-loading i {
    margin-right: 0.5rem;
    animation: spin 1s linear infinite;
}