/* Map Editor Styles */

.map-editor {
    position: fixed;
    left: 0;
    top: 0;
    width: 200px;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-right: 2px solid #e94560;
    color: #fff;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 10px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
}

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

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(233, 69, 96, 0.2);
    border-bottom: 1px solid #e94560;
}

.editor-header h3 {
    margin: 0;
    font-size: 11px;
}

.editor-close {
    background: none;
    border: none;
    color: #e94560;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
}

.editor-close:hover {
    color: #fff;
    background: #e94560;
}

.editor-tabs {
    display: flex;
    gap: 2px;
    padding: 8px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.editor-tab {
    flex: 1;
    padding: 8px 4px;
    background: rgba(255,255,255,0.1);
    border: 1px solid transparent;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.editor-tab:hover {
    background: rgba(255,255,255,0.2);
}

.editor-tab.active {
    background: #e94560;
    border-color: #fff;
}

.editor-assets {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    align-content: start;
}

.asset-item {
    background: rgba(255,255,255,0.1);
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.asset-item:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(233, 69, 96, 0.5);
}

.asset-item.selected {
    background: rgba(233, 69, 96, 0.3);
    border-color: #e94560;
}

.asset-preview {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    image-rendering: pixelated;
}

.asset-name {
    font-size: 7px;
    text-align: center;
    margin-top: 2px;
    word-break: break-word;
    line-height: 1.2;
    opacity: 0.8;
}

.editor-options {
    padding: 8px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.option-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.option-row:last-child {
    margin-bottom: 0;
}

.option-row label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.option-row select {
    flex: 1;
    padding: 4px;
    background: #1a1a2e;
    border: 1px solid #e94560;
    color: #fff;
    border-radius: 4px;
    font-family: inherit;
    font-size: 9px;
}

.option-row input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #e94560;
}

.editor-tools {
    display: flex;
    gap: 4px;
    padding: 8px;
    justify-content: center;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: rgba(255,255,255,0.2);
}

.tool-btn.active {
    background: #e94560;
    border-color: #fff;
}

.editor-zoom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.zoom-btn {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: #4ecdc4;
    border-color: #4ecdc4;
}

.editor-rotation {
    padding: 4px 8px;
    text-align: center;
    font-size: 9px;
    color: #e94560;
    background: rgba(0,0,0,0.2);
}

.editor-brush-size {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(0,0,0,0.2);
    font-size: 9px;
}

.editor-brush-size.hidden {
    display: none;
}

.brush-btn {
    padding: 4px 6px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    font-size: 8px;
    transition: all 0.2s;
}

.brush-btn:hover {
    background: rgba(255,255,255,0.2);
}

.brush-btn.active {
    background: #4ecdc4;
    border-color: #4ecdc4;
    color: #1a1a2e;
}

#zoom-level {
    min-width: 50px;
    text-align: center;
    font-size: 10px;
    color: #4ecdc4;
}

#editor-hint {
    display: block;
    font-size: 8px;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
}

.editor-actions {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.action-btn {
    padding: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 9px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #e94560;
    border-color: #e94560;
}

.action-btn.active {
    background: #4ecdc4;
    border-color: #4ecdc4;
    color: #1a1a2e;
}

.editor-status {
    padding: 8px;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 8px;
    opacity: 0.8;
}

/* Cursor preview */
.editor-cursor-preview {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    opacity: 0.7;
    image-rendering: pixelated;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: 2px dashed #e94560;
}

.editor-cursor-preview.hidden {
    display: none;
}

/* Editor hint when in fullscreen */
.editor-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #e94560;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s;
}

.editor-hint.visible {
    opacity: 1;
}

/* Scrollbar styling */
.editor-assets::-webkit-scrollbar {
    width: 6px;
}

.editor-assets::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}

.editor-assets::-webkit-scrollbar-thumb {
    background: #e94560;
    border-radius: 3px;
}

.editor-assets::-webkit-scrollbar-thumb:hover {
    background: #ff6b6b;
}
