/* ========================================================================== */
/* TOOLBAR FLOTANTE HORIZONTAL - CalidadView                                */
/* ========================================================================== */

.calidad-toolbar {
    position: fixed;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 5000;
    transform: translateX(-100%);
    animation: toolbarSlideIn 0.18s ease-out;
    backdrop-filter: blur(8px);
}

@keyframes toolbarSlideIn {
    from {
        opacity: 0;
        transform: translateX(-100%) translateY(6px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-100%) translateY(0) scale(1);
    }
}

/* ========================================================================== */
/* BOTONES DEL TOOLBAR                                                       */
/* ========================================================================== */

.toolbar-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}

.toolbar-btn svg {
    width: 17px;
    height: 17px;
    stroke: white;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.toolbar-btn:hover:not(:disabled) {
    transform: scale(1.12);
}

.toolbar-btn:active:not(:disabled) {
    transform: scale(0.93);
}

.toolbar-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    transform: none !important;
    filter: grayscale(0.5);
}

/* ========================================================================== */
/* COLORES POR ACCIÓN (gradientes 135deg)                                    */
/* ========================================================================== */

/* Reasignar Marca - Naranja */
.tb-btn-orange {
    background: linear-gradient(135deg, #F07400, #d06200);
    box-shadow: 0 2px 8px rgba(240, 116, 0, 0.35);
}
.tb-btn-orange:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(240, 116, 0, 0.55);
}

/* Reasignar Categoría - Cyan */
.tb-btn-cyan {
    background: linear-gradient(135deg, #00b4ff, #0099dd);
    box-shadow: 0 2px 8px rgba(0, 180, 255, 0.35);
}
.tb-btn-cyan:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(0, 180, 255, 0.55);
}

/* Reasignar Tipo / Reasignar Censo - Púrpura */
.tb-btn-purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
}
.tb-btn-purple:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.55);
}

/* Reasignar Proveedor - Teal */
.tb-btn-teal {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.35);
}
.tb-btn-teal:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(20, 184, 166, 0.55);
}

/* Reasignar Tamaño - Indigo */
.tb-btn-indigo {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}
.tb-btn-indigo:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.55);
}

/* Reasignar Tag - Amarillo */
.tb-btn-yellow {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.35);
}
.tb-btn-yellow:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.55);
}
.tb-btn-yellow svg {
    stroke: #333;
}

/* Modificar Tag - Ámbar */
.tb-btn-amber {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}
.tb-btn-amber:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.55);
}
.tb-btn-amber svg {
    stroke: #333;
}

/* Modificar Segundo - Azul */
.tb-btn-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}
.tb-btn-blue:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.55);
}

/* Reasignar Sin Publicidad - Rojo */
.tb-btn-red {
    background: linear-gradient(135deg, #dc3545, #c82333);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.35);
}
.tb-btn-red:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.55);
}

/* Abrir Ubicación - Verde */
.tb-btn-green {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.35);
}
.tb-btn-green:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.55);
}

/* ========================================================================== */
/* SEPARADOR VERTICAL EN TOOLBAR                                             */
/* ========================================================================== */

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 2px;
    opacity: 0.5;
}

/* ========================================================================== */
/* TOOLTIP PERSONALIZADO (estilo festivo ControlEmpleados)                    */
/* ========================================================================== */

.toolbar-btn {
    position: relative;
}

.toolbar-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    padding: 0.4rem 0.7rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 5001;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(240, 116, 0, 0.3);
    pointer-events: none;
    letter-spacing: 0.02em;
    background-clip: padding-box;
}

/* Glow sutil arriba del tooltip */
.toolbar-tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #F07400, #00b4ff);
    border-radius: 50%;
    opacity: 0.3;
    filter: blur(6px);
}

/* Flecha inferior */
.toolbar-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #16213e;
}

/* Texto con gradiente naranja */
.toolbar-tooltip {
    background-clip: padding-box;
}

.toolbar-btn:hover:not(:disabled) .toolbar-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* Glow animado en hover */
.toolbar-btn:hover:not(:disabled) .toolbar-tooltip::before {
    animation: toolbarTooltipGlow 1.5s ease-in-out infinite;
}

@keyframes toolbarTooltipGlow {
    0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.6; transform: translateX(-50%) scale(1.2); }
}

/* ---- Modo claro ---- */
:root.light-mode .toolbar-tooltip {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: rgba(102, 126, 234, 0.5);
}

:root.light-mode .toolbar-tooltip::after {
    border-top-color: #764ba2;
}

/* ========================================================================== */
/* MODO CLARO                                                                */
/* ========================================================================== */

:root.light-mode .calidad-toolbar {
    background: rgba(255, 255, 255, 0.95);
    border-color: #e0e0e0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
}

:root.light-mode .toolbar-separator {
    background: #d0d0d0;
}

/* ========================================================================== */
/* RESPONSIVE                                                                 */
/* ========================================================================== */

@media (max-width: 1024px) {
    .toolbar-btn {
        width: 34px;
        height: 34px;
    }
    .toolbar-btn svg {
        width: 15px;
        height: 15px;
    }
    .calidad-toolbar {
        gap: 4px;
        padding: 6px 10px;
    }
}

@media (max-width: 768px) {
    .toolbar-btn {
        width: 32px;
        height: 32px;
    }
    .toolbar-btn svg {
        width: 14px;
        height: 14px;
    }
    .calidad-toolbar {
        gap: 3px;
        padding: 5px 8px;
    }
    .toolbar-btn:hover:not(:disabled) {
        transform: none;
    }
}
