/* === LAYOUT FIXES - KEIMADA LIVE === */
/* Correcciones específicas para evitar solapamiento y mejorar UX */

/* === SISTEMA DE ESPACIADO INTELIGENTE === */

/* Contenedor para elementos flotantes derechos */
.floating-elements-right {
    position: fixed;
    right: 20px;
    top: 0;
    height: 100vh;
    width: 0;
    z-index: var(--z-context-indicators);
    pointer-events: none;
}

/* Distribuir elementos flotantes verticalmente */
.floating-element {
    position: absolute;
    pointer-events: auto;
}

.floating-element.top {
    top: 20px;
}

.floating-element.middle {
    top: 50%;
    transform: translateY(-50%);
}

.floating-element.bottom {
    bottom: 30px;
}

/* === CORRECCIONES ESPECÍFICAS === */

/* More Options y Chat - Mejorar visibilidad de trigger */
.more-options-btn {
    position: relative;
    z-index: var(--z-header);
}

.more-options-btn::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: transparent;
    border-radius: 50%;
    transition: background 0.3s ease;
}

/* Hover effect removed for cleaner UX */

/* Chat toggle button - Mejor visibilidad */
.chat-toggle-btn {
    position: relative;
    z-index: var(--z-header);
}

.chat-toggle-btn::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: chatIndicatorPulse 2s ease-in-out infinite;
}

.chat-toggle-btn:hover::after,
.chat-panel.open .chat-toggle-btn::after {
    opacity: 1;
}

@keyframes chatIndicatorPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* === RESPONSIVE STACK MANAGEMENT === */

/* En móvil - Reorganizar elementos para evitar solapamiento */
@media (max-width: 768px) {
    /* Stack de elementos derechos en móvil */
    .mobile-right-stack {
        position: fixed;
        right: 10px;
        top: 70px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        z-index: var(--z-context-indicators);
    }
    
    /* Notifications - Posición fija en móvil */
    .notification-system {
        position: fixed !important;
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
        z-index: var(--z-notifications) !important;
    }
    
    .notification-container {
        max-width: none !important;
    }
}

/* === MEJORAS DE CONTRASTE Y VISIBILIDAD === */

/* Mejorar contraste de botones importantes */
.critical-action-btn {
    box-shadow: 0 0 0 2px rgba(233, 77, 173, 0.3);
    background: linear-gradient(135deg, var(--accent-color), var(--accent-text));
}

.critical-action-btn:hover {
    box-shadow: 0 0 0 3px rgba(233, 77, 173, 0.5);
    transform: scale(1.05);
}

/* === INDICADORES DE ESTADO MEJORADOS === */

/* Sistema de badges para indicar funcionalidad */
.component-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border: 2px solid white;
    border-radius: 50%;
    font-size: 0.6em;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* === SMOOTH TRANSITIONS PARA TODOS === */

/* Aplicar transiciones suaves a elementos interactivos */
button, .clickable, .interactive {
    transition: all var(--duration-fast) var(--ease-smooth);
}

/* Hover effects removed for cleaner UX - no global brightness changes */

/* === CORRECCIÓN DE OVERLAYS === */

/* Smart Overlay - Reducir altura para no interferir con FAB */
.smart-overlay {
    max-height: 150px !important;
    padding: 16px 0 !important;
}

/* === ACCESIBILIDAD MEJORADA === */

/* Focus visible mejorado */
*:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

/* === DEBUG HELPERS (remover en producción) === */

.debug-bounds {
    outline: 1px solid red !important;
}

.debug-z-index::before {
    content: attr(data-z-index);
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    z-index: 99999;
}
