/**
 * Dropdown de Operações - Design System Figma
 *
 * Estilos para o dropdown de operações na listagem, baseado nas
 * especificações do Figma (dropdown_menu_light.css e dropdown_menu_dark.css)
 *
 * @package GALES Design System
 * @since 2025-12-11
 */

/* ==========================================================================
   DROPDOWN CONTAINER
   ========================================================================== */

.operacao-items {
    box-sizing: border-box !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 5px !important;
    position: absolute;
    width: 200px !important;
    right: 0;
    top: 100%;
    margin-top: 4px;

    /* Light mode - default (Figma specs) */
    background: #F6F6F9 !important;
    border: 1px solid #CED3E2 !important;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.09) !important;
    border-radius: 6px !important;
    z-index: 9999 !important;
}

/* Esconder por padrão */
.operacao-items.hidden {
    display: none !important;
}

/* Mostrar quando ativo */
.operacao-items.show {
    display: flex !important;
}

/* ==========================================================================
   DROPDOWN CONTAINER - INNER
   ========================================================================== */

.operacao-items-container {
    width: 100%;
}

.operacao-items-container ul,
.operacao-items .mdl-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100% !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* ==========================================================================
   MENU ITEM - BASE STYLES
   ========================================================================== */

.operacao-items .mdl-menu__item,
.operacao-items .mdl-list__item {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    padding: 8px !important;
    gap: 12px;
    width: 190px !important;
    height: 40px !important;

    /* Light mode (Figma specs) */
    background: #F6F6F9 !important;

    cursor: pointer;
    transition: background-color 0.15s ease, border-radius 0.15s ease;

    /* Reset MDL/Flowbite styles */
    position: relative !important;
    overflow: visible !important;
    opacity: 1 !important;
    transform: none !important;
    border: none !important;
    margin: 0 !important;
    min-width: unset !important;
    box-shadow: none !important;
}

/* Hover state */
.operacao-items .mdl-menu__item:hover,
.operacao-items .mdl-list__item:hover {
    background: #ECEDF2 !important;
    border-radius: 6px !important;
}

/* ==========================================================================
   MENU ITEM - CONTENT
   ========================================================================== */

.operacao-items .mdl-list__item-primary-content {
    display: flex !important;
    flex-direction: row;
    align-items: center !important;
    gap: 12px !important;
    flex: 1;
}

/* Icon container */
.operacao-items .icone-ipe,
.operacao-items .mdi,
.operacao-items .material-icons {
    width: 18px;
    height: 18px;
    font-size: 18px !important;
    line-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    /* Light mode - icon color */
    color: #394360 !important;
}

/* Text label */
.operacao-items .mdl-list__item-primary-content p {
    margin: 0 !important;
    padding: 0;
    width: auto;
    flex: 1;

    /* Tipografia/P3 - Figma */
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 14px;
    line-height: 24px;

    /* Light mode - text color */
    color: #394360 !important;
}

/* ==========================================================================
   DIVIDER (se houver separadores)
   ========================================================================== */

.operacao-items hr,
.operacao-items .divider {
    width: 190px;
    height: 0px;
    border: none;
    border-top: 1px solid #CED3E2;
    margin: 4px 0;
}

/* ==========================================================================
   DARK MODE
   ========================================================================== */

[data-theme="dark"] .operacao-items,
html.dark .operacao-items,
html.dark-mode .operacao-items {
    background: #141926 !important;
    border: 1px solid #2A2F41 !important;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2) !important;
}

/* Menu items - dark mode */
[data-theme="dark"] .operacao-items .mdl-menu__item,
[data-theme="dark"] .operacao-items .mdl-list__item,
html.dark .operacao-items .mdl-menu__item,
html.dark .operacao-items .mdl-list__item,
html.dark-mode .operacao-items .mdl-menu__item,
html.dark-mode .operacao-items .mdl-list__item {
    background: #141926 !important;
}

/* Hover - dark mode */
[data-theme="dark"] .operacao-items .mdl-menu__item:hover,
[data-theme="dark"] .operacao-items .mdl-list__item:hover,
html.dark .operacao-items .mdl-menu__item:hover,
html.dark .operacao-items .mdl-list__item:hover,
html.dark-mode .operacao-items .mdl-menu__item:hover,
html.dark-mode .operacao-items .mdl-list__item:hover {
    background: #212533 !important;
}

/* Icons - dark mode */
[data-theme="dark"] .operacao-items .icone-ipe,
[data-theme="dark"] .operacao-items .mdi,
[data-theme="dark"] .operacao-items .material-icons,
html.dark .operacao-items .icone-ipe,
html.dark .operacao-items .mdi,
html.dark .operacao-items .material-icons,
html.dark-mode .operacao-items .icone-ipe,
html.dark-mode .operacao-items .mdi,
html.dark-mode .operacao-items .material-icons {
    color: #A2A8B9 !important;
}

/* Text - dark mode */
[data-theme="dark"] .operacao-items .mdl-list__item-primary-content p,
html.dark .operacao-items .mdl-list__item-primary-content p,
html.dark-mode .operacao-items .mdl-list__item-primary-content p {
    color: #BFC3CF !important;
}

/* Divider - dark mode */
[data-theme="dark"] .operacao-items hr,
[data-theme="dark"] .operacao-items .divider,
html.dark .operacao-items hr,
html.dark .operacao-items .divider,
html.dark-mode .operacao-items hr,
html.dark-mode .operacao-items .divider {
    border-top-color: #2A2F41;
}

/* ==========================================================================
   BOTÃO DE OPERAÇÕES (três pontos)
   ========================================================================== */

.div-operacao {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.operacao-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid #CED3E2;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.operacao-button:hover {
    background: #ECEDF2;
}

.operacao-button .material-icons {
    font-size: 20px;
    color: #12151F;
}

/* Dark mode - botão */
[data-theme="dark"] .operacao-button,
html.dark .operacao-button,
html.dark-mode .operacao-button {
    border-color: rgba(224, 226, 235, 0.16);
}

[data-theme="dark"] .operacao-button:hover,
html.dark .operacao-button:hover,
html.dark-mode .operacao-button:hover {
    background: rgba(224, 226, 235, 0.08);
}

[data-theme="dark"] .operacao-button .material-icons,
html.dark .operacao-button .material-icons,
html.dark-mode .operacao-button .material-icons {
    color: #E0E2EB;
}

/* ==========================================================================
   BOTÃO DETALHAR (visível fora do dropdown)
   ========================================================================== */

.listagem-operacao {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.listagem-operacao .icone-listagem {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid #CED3E2;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.listagem-operacao .icone-listagem:hover {
    background: #ECEDF2;
}

.listagem-operacao .icone-listagem .icone-ipe {
    font-size: 18px;
    color: #394360;
}

/* Dark mode - botão detalhar */
[data-theme="dark"] .listagem-operacao .icone-listagem,
html.dark .listagem-operacao .icone-listagem,
html.dark-mode .listagem-operacao .icone-listagem {
    border-color: rgba(224, 226, 235, 0.16);
}

[data-theme="dark"] .listagem-operacao .icone-listagem:hover,
html.dark .listagem-operacao .icone-listagem:hover,
html.dark-mode .listagem-operacao .icone-listagem:hover {
    background: rgba(224, 226, 235, 0.08);
}

[data-theme="dark"] .listagem-operacao .icone-listagem .icone-ipe,
html.dark .listagem-operacao .icone-listagem .icone-ipe,
html.dark-mode .listagem-operacao .icone-listagem .icone-ipe {
    color: #A2A8B9;
}
