/* Configuración global de la fuente Inter (Bootstrap usa su propia stack, pero mantenemos esta) */
html {
    font-family: 'Inter', sans-serif;
}

/* Ocultar el cursor original de arrastre en el body para evitar conflictos visuales */
body {
    cursor: default;
}

/*
        ========================================================
        ESTILOS DEL MENÚ FLOTANTE
        ========================================================
        */

/* Contenedor principal del widget flotante */
.draggable-menu-widget {
    position: fixed;
    z-index: 1050;
    /* Z-index alto como en Bootstrap Modals */
    display: flex;
    align-items: center;
    padding: 8px;
    background-color: #343a40;
    /* bg-dark de Bootstrap */
    border-radius: 1rem;
    /* Bordes redondeados */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    transition: top 0.3s ease, left 0.3s ease;
    touch-action: none;
    cursor: grab;
}

/* Orientación Vertical (Default) */
.draggable-menu-widget.vertical {
    flex-direction: column;
}

/* Orientación Horizontal */
.draggable-menu-widget.horizontal {
    flex-direction: row;
}

/* Estado anclado (pinned) */
.pinned {
    cursor: default !important;
}

/* Elementos individuales del menú */
.menu-item {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    color: #ccc;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
    line-height: 0;
    cursor: pointer;
}

/* Estilo para los iconos dentro del menu-item (usa el color del padre) */
.menu-item svg {
    fill: #ffffff;
    stroke: #ffffff !important;
    stroke-width: 0.6px !important;
    /* Transición también para la transformación (rotación) */
    transition: stroke 0.6s, fill 0.6s, transform 0.6s ease-out;
    /* Mejora el renderizado de gráficos vectoriales para mayor nitidez */
    shape-rendering: geometricPrecision;
}

.menu-item:hover svg {
    fill: #eda5b2 !important;
    stroke: #eda5b2 !important;
    stroke-width: 0.6px !important;
}

.menu-item:hover {
    background-color: rgba(237, 165, 178, 0.2);
    transform: scale(1.05);
}

/* -------------------------------------- */
/* ESTADO ACTIVO DEL ÍTEM SELECCIONADO (SÓLO ÍCONO) */
/* -------------------------------------- */

.menu-item.item-active {
    background-color: rgba(237, 165, 178, 0.2);
}

.menu-item.item-active svg {
    fill: #FFE3E9 !important;
    stroke: #FFE3E9 !important;
    stroke-width: 0.6px !important;
    /* GIRA 360 GRADOS CUANDO ESTÁ ACTIVO */
    transform: rotate(360deg);
}

/* --- AJUSTES DE MARGEN SEGÚN ORIENTACIÓN --- */

/* Ajuste de margen para Vertical (Margen superior/inferior) */
.vertical .menu-item {
    margin: 6px 0;
}

.vertical .menu-dots {
    margin-bottom: 10px;
    margin-right: 0;
}

.vertical .pin-button-style {
    margin-top: 10px;
    margin-bottom: 15px;
    margin-left: 0;
}

/* Ajuste de margen para Horizontal (Margen izquierdo/derecho) */
.horizontal .menu-item {
    margin: 0 6px;
}

.horizontal .menu-dots {
    height: 40px;
    width: 30px;
    margin-right: 10px;
    margin-bottom: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.horizontal .pin-button-style {
    margin-left: 10px;
    margin-top: 0;
}

/* Manejador de arrastre (dots) */
.menu-dots {
    cursor: grab;
    /*font-size: 0.8rem;*/
    line-height: 0.6;
    color: #ccc;
    height: 30px;
    opacity: 0.8;
}

.menu-dots:hover {
    background-color: transparent;
    transform: none;
    opacity: 1;
}

/* Botón de anclaje (pin) */
.pin-button-style {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    color: #ccc;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
    line-height: 0;
}

/* Aplica una transición a la rotación del SVG */
.pin-button-style svg {
    fill: #ffffff;
    stroke: #ffffff !important;
    stroke-width: 0.6px !important;
    /* Transición también para la transformación (rotación) */
    transition: stroke 0.2s, fill 0.2s, transform 0.2s ease-out;
    /* Mejora el renderizado de gráficos vectoriales para mayor nitidez */
    shape-rendering: geometricPrecision;
}

.pin-button-style:hover {
    background-color: rgba(237, 165, 178, 0.2);
}

.pin-button-style:hover svg {
    fill: #eda5b2 !important;
    stroke: #eda5b2 !important;
    stroke-width: 0.6px !important;
}

/* Estado activo del pin */
.pin-active {
    background-color: rgba(237, 165, 178, 0.2);
}

.pin-active svg {
    fill: #FFE3E9 !important;
    stroke: #FFE3E9 !important;
    stroke-width: 0.6px !important;
    /* GIRA 45 GRADOS CUANDO ESTÁ ACTIVO */
    transform: rotate(45deg);
}

/* --- ESTILOS PARA SWITCH TOGGLE DENTRO DE MENÚS FLOTANTES Y TABLAS DE METRICAS --- */
.draggable-menu-widget .form-switch .form-check-input,
.attention-table .form-switch .form-check-input,
.start_attention-table .form-switch .form-check-input,
.end_attention-table .form-switch .form-check-input,
.cognitive-demand-table .form-switch .form-check-input,
.engagement-table .form-switch .form-check-input,
.memory-table .form-switch .form-check-input,
#aoi-metrics-table-container .form-switch .form-check-input {
    background-color: #ffffff !important;
    border-color: #EDA5B2 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3ccircle cx='10' cy='10' r='7' fill='%23EDA5B2'/%3e%3c/svg%3e") !important;
    transition: background-position 0.15s ease-in-out, background-image 0.15s ease-in-out, border-color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.draggable-menu-widget .form-switch .form-check-input:checked,
.attention-table .form-switch .form-check-input:checked,
.start_attention-table .form-switch .form-check-input:checked,
.end_attention-table .form-switch .form-check-input:checked,
.cognitive-demand-table .form-switch .form-check-input:checked,
.engagement-table .form-switch .form-check-input:checked,
.memory-table .form-switch .form-check-input:checked,
#aoi-metrics-table-container .form-switch .form-check-input:checked {
    background-color: #EDA5B2 !important;
    border-color: #EDA5B2 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3ccircle cx='10' cy='10' r='7' fill='%23ffffff'/%3e%3c/svg%3e") !important;
}

.draggable-menu-widget .form-switch .form-check-input:focus,
.attention-table .form-switch .form-check-input:focus,
.start_attention-table .form-switch .form-check-input:focus,
.end_attention-table .form-switch .form-check-input:focus,
.cognitive-demand-table .form-switch .form-check-input:focus,
.engagement-table .form-switch .form-check-input:focus,
.memory-table .form-switch .form-check-input:focus,
#aoi-metrics-table-container .form-switch .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(237, 165, 178, 0.25) !important;
    border-color: #EDA5B2 !important;
}


