/* ========================================
   SISTEMA DE TOASTS NATIVO
   ======================================== */

#toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    min-width: 280px;
    max-width: 380px;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #f5f5f5;
    background: rgba(30, 30, 30, 0.96);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Iconos según tipo (usando pseudo-elementos) */
.toast::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
}

.toast-success {
    border-left: 4px solid #4caf50;
}

.toast-success::before {
    background: #4caf50;
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}

.toast-error {
    border-left: 4px solid #f44336;
}

.toast-error::before {
    background: #f44336;
    content: '✕';
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}

.toast-warning {
    border-left: 4px solid #ff9800;
}

.toast-warning::before {
    background: #ff9800;
    content: '⚠';
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}

.toast-info {
    border-left: 4px solid #2196f3;
}

.toast-info::before {
    background: #2196f3;
    content: 'ℹ';
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}

/* Animaciones */
.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-hide {
    opacity: 0;
    transform: translateX(30px);
}

/* Responsive */
@media (max-width: 768px) {
    #toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }
}

/* ====================================== */
/* CONSOLA DE DEBUG FLOTANTE */
/* Con soporte para ZOOM y SCROLL */
/* ====================================== */

/* Botón flotante para abrir la consola cuando está cerrada */
#debug-console-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #ff0000;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 999998;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.5);
    font-size: 24px;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#debug-console-toggle:hover {
    transform: scale(1.1);
}

#debug-console-toggle:active {
    transform: scale(0.95);
}

/* Consola de debug */
#debug-console {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45%;
    background: rgba(0, 0, 0, 0.95);
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    z-index: 999999;
    border-top: 3px solid #ff0000;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.8);
    flex-direction: column;
}

/* Header de la consola */
#debug-console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: rgba(255, 0, 0, 0.2);
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

#debug-console-header strong {
    color: #ff0000;
    font-size: 13px;
    font-weight: bold;
}

#debug-console-header .debug-controls {
    display: flex;
    gap: 5px;
}

#debug-console-header button {
    background: #ff0000;
    color: white;
    border: none;
    padding: 5px 12px;
    cursor: pointer;
    border-radius: 3px;
    font-weight: bold;
    font-size: 11px;
    transition: background 0.2s;
}

#debug-console-header button:hover {
    background: #cc0000;
}

#debug-console-header button:active {
    background: #990000;
}

/* Contenedor del log con zoom independiente */
#debug-log-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: rgba(0, 0, 0, 0.98);
}

#debug-log-content {
    width: 100%;
    height: 100%;
    padding: 10px;
    overflow: auto;
    overflow-x: auto;
    overflow-y: auto;
    touch-action: pan-x pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
    transform-origin: top left;
    transition: transform 0.1s ease-out;
}

/* Permitir que el contenido no se ajuste automáticamente */
#debug-log-content > div {
    white-space: pre-wrap;
    word-break: break-word;
    min-width: max-content;
}

/* Scrollbar personalizado para mejor visualización */
#debug-log-content::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

#debug-log-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

#debug-log-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 0, 0.3);
    border-radius: 5px;
}

#debug-log-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 0, 0.5);
}

/* Ajuste del contenedor principal cuando la consola está abierta */
body.debug-console-open #app-main-container {
    padding-bottom: 45vh;
    transition: padding-bottom 0.3s ease;
}
#app-main-container 
{
		overflow-x: auto;
		overflow-y: auto;
}

/* Ajustes para móvil */
@media (max-width: 768px) {
    #debug-console {
        height: 50%;
    }
    
    body.debug-console-open #app-main-container {
        padding-bottom: 50vh;
    }
    
    #debug-log-content {
        font-size: 10px;
        padding: 8px;
    }
    
    #debug-console-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 15px;
        right: 15px;
    }
}

/* Ajustes para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    #debug-console {
        height: 40%;
    }
    
    body.debug-console-open #app-main-container {
        padding-bottom: 40vh;
    }
}
/* ========================================
   BANNER DE ACTUALIZACIÓN PWA (ESTILO GERENCIAL)
   ======================================== */

#pwa-update-banner {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 10000;
    width: 90%;
    max-width: 500px;
    background: rgba(15, 23, 42, 0.9); /* Azul profundo gerencial */
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 
                0 0 20px rgba(0, 150, 255, 0.2); /* Brillo sutil IA */
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#pwa-update-banner.show {
    transform: translateX(-50%) translateY(0);
}

.pwa-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #ffffff;
}

.pwa-icon {
    font-size: 1.5rem;
    color: #00d2ff; /* Cyan futurista */
    animation: pulse-blue 2s infinite;
}

.pwa-text h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.pwa-text p {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

.pwa-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-pwa-update {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.btn-pwa-update:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 210, 255, 0.4);
}

@keyframes pulse-blue {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* ========================================
   AJUSTES DE RESPONSIVIDAD PARA LOGIN
   ======================================== */

@media (max-width: 768px) {
    /* El contenedor de login ocupa casi toda la pantalla en móvil */
    .login-container {
        width: 95% !important;
        margin: 10px auto;
        padding: 1.5rem !important;
    }

    #pwa-update-banner {
        bottom: 1rem;
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .pwa-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .pwa-actions {
        width: 100%;
    }

    .btn-pwa-update {
        width: 100%;
    }
}