/* ==================== EDITOR DE BASE - ESTILOS ==================== */

/* Overlay principal do editor */
.editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    pointer-events: none;
}

.editor-overlay.hidden {
    display: none;
}

.editor-overlay > * {
    pointer-events: auto;
}

/* ==================== HUD DO EDITOR ==================== */

.editor-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(180deg, rgba(11, 13, 15, 0.98) 0%, rgba(11, 13, 15, 0.95) 100%);
    border-bottom: 2px solid #3A4F5C;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 2001;
}

.editor-money {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Teko', sans-serif;
    font-size: 28px;
    color: #7A9B4A;
}

.money-icon {
    color: #BFA84A;
}

.editor-title {
    font-family: 'Teko', sans-serif;
    font-size: 22px;
    letter-spacing: 3px;
    color: #C4C4B0;
    text-transform: uppercase;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

.editor-action-btn {
    padding: 8px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: #1A1F24;
    border: 1px solid #3A3F44;
    color: #C4C4B0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-action-btn:hover {
    background: #2A2E33;
    border-color: #4A4F54;
}

.editor-action-btn.primary {
    border-color: #3A4F5C;
    color: #6AB0FF;
}

.editor-action-btn.primary:hover {
    background: rgba(58, 79, 92, 0.3);
}

.editor-action-btn.success {
    background: rgba(91, 110, 58, 0.3);
    border-color: #5B6E3A;
    color: #7A9B4A;
}

.editor-action-btn.success:hover {
    background: rgba(91, 110, 58, 0.5);
}

/* ==================== PALETA DE OBJETOS ==================== */

.editor-palette {
    position: fixed;
    top: 60px;
    left: 10px;
    width: 200px;
    max-height: calc(100vh - 140px);
    background: rgba(11, 13, 15, 0.95);
    border: 1px solid #2A2E33;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.palette-header {
    padding: 12px;
    background: #1A1F24;
    border-bottom: 1px solid #2A2E33;
}

.palette-header > span {
    font-family: 'Teko', sans-serif;
    font-size: 16px;
    letter-spacing: 2px;
    color: #C4C4B0;
}

.palette-tabs {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.palette-tab {
    flex: 1;
    padding: 6px 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    background: transparent;
    border: 1px solid #3A3F44;
    color: #7A7A6A;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.palette-tab:hover {
    border-color: #5A5F64;
    color: #C4C4B0;
}

.palette-tab.active {
    background: #3A4F5C;
    border-color: #3A4F5C;
    color: #E0E0D0;
}

.palette-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* Cards de objetos na paleta */
.palette-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    background: #1A1F24;
    border: 1px solid #2A2E33;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.palette-item:hover {
    background: #2A2E33;
    border-color: #3A4F5C;
    transform: translateY(-2px);
}

.palette-item.selected {
    background: rgba(58, 79, 92, 0.3);
    border-color: #3A4F5C;
    box-shadow: 0 0 10px rgba(58, 79, 92, 0.3);
}

.palette-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    border-color: #5A8FAC;
}

.palette-item[draggable="true"] {
    cursor: grab;
}

.palette-item[draggable="true"]:active {
    cursor: grabbing;
}

.palette-item-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.palette-item-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: #C4C4B0;
    text-align: center;
}

.palette-item-cost {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    color: #7A9B4A;
    margin-top: 3px;
}

/* ==================== PAINEL DE PROPRIEDADES ==================== */

.editor-properties {
    position: fixed;
    top: 60px;
    right: 10px;
    width: 240px;
    background: rgba(11, 13, 15, 0.95);
    border: 1px solid #2A2E33;
    border-radius: 8px;
    overflow: hidden;
}

.editor-properties.hidden {
    display: none;
}

.properties-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #1A1F24;
    border-bottom: 1px solid #2A2E33;
}

.properties-header span {
    font-family: 'Teko', sans-serif;
    font-size: 16px;
    letter-spacing: 1px;
    color: #C4C4B0;
}

.properties-header .close-btn {
    background: transparent;
    border: none;
    color: #7A7A6A;
    font-size: 16px;
    cursor: pointer;
}

.properties-header .close-btn:hover {
    color: #C4C4B0;
}

.properties-content {
    padding: 12px;
}

.property-group {
    margin-bottom: 15px;
}

.property-group label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #7A7A6A;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.property-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.property-row span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #7A7A6A;
}

.property-row input[type="number"] {
    width: 50px;
    padding: 5px 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    background: #1A1F24;
    border: 1px solid #3A3F44;
    color: #C4C4B0;
    border-radius: 4px;
}

.property-row input[type="number"]:focus {
    outline: none;
    border-color: #3A4F5C;
}

.property-row input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: #1A1F24;
    border-radius: 3px;
}

.property-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #3A4F5C;
    border-radius: 50%;
    cursor: pointer;
}

/* Color Picker */
.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: #E0E0D0;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.property-cost {
    font-family: 'Teko', sans-serif;
    font-size: 24px;
    color: #BFA84A;
}

.property-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.prop-btn {
    flex: 1;
    padding: 8px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    background: #1A1F24;
    border: 1px solid #3A3F44;
    color: #C4C4B0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prop-btn:hover {
    background: #2A2E33;
}

.prop-btn.danger {
    border-color: #7A1F1F;
    color: #9A2F2F;
}

.prop-btn.danger:hover {
    background: rgba(122, 31, 31, 0.2);
}

/* ==================== BARRA DE FERRAMENTAS ==================== */

.editor-toolbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(11, 13, 15, 0.95);
    border: 1px solid #2A2E33;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.toolbar-group {
    display: flex;
    gap: 5px;
}

.toolbar-separator {
    width: 1px;
    height: 30px;
    background: #3A3F44;
    margin: 0 5px;
}

.tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-btn span {
    font-size: 18px;
}

.tool-btn small {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    color: #7A7A6A;
    text-transform: uppercase;
}

.tool-btn:hover {
    background: #1A1F24;
    border-color: #3A3F44;
}

.tool-btn.active {
    background: #3A4F5C;
    border-color: #3A4F5C;
}

.tool-btn.active small {
    color: #E0E0D0;
}

.toolbar-info {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #7A7A6A;
    padding: 0 10px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== INDICADOR DE ÁREA ==================== */

.editor-area-indicator {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 15px;
    background: rgba(11, 13, 15, 0.8);
    border: 1px solid #3A4F5C;
    border-radius: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #7A7A6A;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==================== GIZMOS ==================== */

.gizmo-handle {
    cursor: pointer;
}

.gizmo-axis-x {
    stroke: #ff4444;
    fill: #ff4444;
}

.gizmo-axis-y {
    stroke: #44ff44;
    fill: #44ff44;
}

.gizmo-axis-z {
    stroke: #4444ff;
    fill: #4444ff;
}

/* ==================== SELEÇÃO DE OBJETO ==================== */

.editor-selection-box {
    position: absolute;
    border: 2px dashed #3A4F5C;
    background: rgba(58, 79, 92, 0.1);
    pointer-events: none;
}

/* ==================== RESPONSIVO MOBILE ==================== */

@media (max-width: 768px) {
    .editor-hud {
        padding: 0 10px;
        height: 45px;
    }

    .editor-money {
        font-size: 22px;
    }

    .editor-title {
        display: none;
    }

    .editor-action-btn {
        padding: 6px 12px;
        font-size: 10px;
    }

    .editor-palette {
        width: 150px;
        left: 5px;
    }

    .palette-content {
        grid-template-columns: 1fr;
    }

    .palette-tabs {
        flex-direction: column;
    }

    .editor-properties {
        width: 200px;
        right: 5px;
    }

    .editor-toolbar {
        width: calc(100% - 20px);
        max-width: 400px;
        padding: 8px 10px;
        bottom: 10px;
    }

    .toolbar-info {
        display: none;
    }

    .tool-btn {
        padding: 6px 10px;
    }

    .tool-btn small {
        display: none;
    }
}

/* ==================== ANIMAÇÕES ==================== */

@keyframes editorPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(58, 79, 92, 0.3); }
    50% { box-shadow: 0 0 20px rgba(58, 79, 92, 0.5); }
}

.editor-pulse {
    animation: editorPulse 2s ease-in-out infinite;
}

/* ==================== CURSOR PERSONALIZADO ==================== */

.editor-cursor-move {
    cursor: move !important;
}

.editor-cursor-rotate {
    cursor: crosshair !important;
}

.editor-cursor-scale {
    cursor: nwse-resize !important;
}

.editor-cursor-place {
    cursor: cell !important;
}

.editor-cursor-height {
    cursor: ns-resize !important;
}

/* ==================== BOTÕES ESPECIAIS DA TOOLBAR ==================== */

.tool-btn.danger:hover {
    background: rgba(139, 0, 0, 0.3);
    border-color: #8B0000;
}

.tool-btn.danger span {
    filter: drop-shadow(0 0 3px rgba(139, 0, 0, 0.5));
}

.tool-btn.toggle.active {
    background: rgba(122, 155, 74, 0.3);
    border-color: #7A9B4A;
}

.tool-btn.toggle.active small {
    color: #7A9B4A;
}

/* ==================== PAINEL DE ATALHOS ==================== */

.editor-shortcuts {
    position: fixed;
    bottom: 90px;
    right: 10px;
    background: rgba(11, 13, 15, 0.9);
    border: 1px solid #2A2E33;
    border-radius: 8px;
    padding: 10px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #7A7A6A;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.editor-shortcuts:hover {
    opacity: 1;
}

.shortcut-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
}

.shortcut-row kbd {
    display: inline-block;
    min-width: 24px;
    padding: 2px 5px;
    background: #1A1F24;
    border: 1px solid #3A3F44;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: #C4C4B0;
    text-align: center;
}

/* ==================== DRAG AND DROP ==================== */

#cesiumContainer.drag-over {
    outline: 3px dashed #5A8FAC;
    outline-offset: -3px;
}

#cesiumContainer.drag-over::after {
    content: 'Solte aqui para criar objeto';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(11, 13, 15, 0.9);
    color: #5A8FAC;
    padding: 15px 30px;
    border-radius: 8px;
    font-family: 'Teko', sans-serif;
    font-size: 22px;
    letter-spacing: 2px;
    pointer-events: none;
    z-index: 1000;
}

/* ==================== ELEMENTOS DESKTOP ONLY ==================== */

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .editor-shortcuts {
        display: none;
    }

    .tool-btn small {
        font-size: 7px;
    }

    /* Em mobile, mostrar menos botões */
    .toolbar-group.tools-primary .tool-btn[data-tool="height"] {
        display: none;
    }

    .tool-btn[data-action="reset"],
    .tool-btn[data-action="camera-top"],
    .tool-btn[data-action="camera-iso"] {
        display: none;
    }
}
