/**
 * drag_drop.css - Estilos para Drag and Drop
 * Adicionar ao ferramentas.css ou incluir separadamente
 * 
 * @version 1.0.0
 * @date 2026-01-20
 */

/* ══════════════════════════════════════════════════════════════════
   FANTASMA (elemento visual durante arrasto)
   ══════════════════════════════════════════════════════════════════ */

.drag-fantasma {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    opacity: 0.9;
    transition: opacity 0.1s;
}

.drag-fantasma-modulo {
    background: rgba(255, 255, 255, 0.95);
    border: 2px dashed #3ea6ff;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.drag-fantasma-modulo canvas {
    border-radius: 4px;
}

.drag-fantasma-acessorio {
    background: rgba(255, 255, 255, 0.95);
    border: 2px dashed #4CAF50;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.drag-fantasma-acessorio img {
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
}

/* ══════════════════════════════════════════════════════════════════
   INDICADOR DE POSIÇÃO (linha vertical onde módulo vai cair)
   ══════════════════════════════════════════════════════════════════ */

.drag-indicador-posicao {
    position: fixed;
    width: 4px;
    background: linear-gradient(180deg, #3ea6ff 0%, #1976d2 100%);
    border-radius: 2px;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 10px rgba(62, 166, 255, 0.6);
    animation: pulse-indicador 0.5s infinite alternate;
}

@keyframes pulse-indicador {
    from { 
        opacity: 0.7;
        box-shadow: 0 0 10px rgba(62, 166, 255, 0.4);
    }
    to { 
        opacity: 1;
        box-shadow: 0 0 20px rgba(62, 166, 255, 0.8);
    }
}

/* ══════════════════════════════════════════════════════════════════
   LIXEIRA - Estados
   ══════════════════════════════════════════════════════════════════ */

/* Estado normal (já definido no editor.php, mas repetindo aqui para referência) */
.lixeira-btn {
    width: 50px;
    height: 50px;
    border: 2px dashed #3a4550;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #6e7681;
    transition: all 0.2s ease;
    cursor: default;
    background: transparent;
}

/* Estado destacada (quando arrasto inicia) */
.lixeira-btn.destacada {
    border-color: #f85149;
    color: #f85149;
    animation: pulse-lixeira 0.5s infinite alternate;
}

/* Estado ativa (mouse sobre ela com item arrastando) */
.lixeira-btn.ativa {
    background: rgba(248, 81, 73, 0.25);
    border-color: #f85149;
    border-style: solid;
    border-width: 3px;
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(248, 81, 73, 0.5);
}

/* Animação de pulso */
@keyframes pulse-lixeira {
    from { 
        transform: scale(1);
        box-shadow: 0 0 5px rgba(248, 81, 73, 0.3);
    }
    to { 
        transform: scale(1.08);
        box-shadow: 0 0 15px rgba(248, 81, 73, 0.5);
    }
}

/* Animação de shake (item inválido) */
.lixeira-btn.shake {
    animation: shake-lixeira 0.5s ease-in-out;
}

@keyframes shake-lixeira {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ══════════════════════════════════════════════════════════════════
   PAINEL DE ACESSÓRIOS
   ══════════════════════════════════════════════════════════════════ */

/* Painel lateral (já definido no editor.php) */
.painel-acessorios {
    position: fixed;
    right: -320px;
    top: 0;
    width: 300px;
    height: 100vh;
    background: var(--panel, #161b22);
    border-left: 1px solid var(--border, #1e242d);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    transition: right 0.3s ease;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.painel-acessorios.aberto {
    right: 0;
}

/* Item de acessório em estado de drag */
.acessorio-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Item de acessório - cursor grab */
.acessorio-item {
    cursor: grab;
}

.acessorio-item:active {
    cursor: grabbing;
}

/* Placeholder quando arrastando */
.acessorio-placeholder {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a3442;
    border-radius: 4px;
    font-size: 20px;
    color: #6e7681;
}

/* ══════════════════════════════════════════════════════════════════
   MÓDULO DESTACADO (destino válido durante drag)
   ══════════════════════════════════════════════════════════════════ */

.modulo-destino-valido {
    outline: 3px dashed #4CAF50 !important;
    outline-offset: 3px;
}

.modulo-destino-ativo {
    outline: 3px solid #4CAF50 !important;
    outline-offset: 3px;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
}

/* ══════════════════════════════════════════════════════════════════
   CURSOR GLOBAL DURANTE DRAG
   ══════════════════════════════════════════════════════════════════ */

body.dragging,
body.dragging * {
    cursor: grabbing !important;
}

/* ══════════════════════════════════════════════════════════════════
   BOTÃO ACESSÓRIOS (habilitado)
   ══════════════════════════════════════════════════════════════════ */

#btnAcessorios:not(.disabled) {
    opacity: 1;
    cursor: pointer;
}

#btnAcessorios:not(.disabled):hover {
    background: var(--toolbar-btn-hover, #243040);
    border-color: var(--accent, #3ea6ff);
    transform: translateY(-2px);
}
