/* Pixel Art Editor Styles */

.pixel-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 20px;
}

.pixel-editor-modal.hidden {
    display: none;
}

.pixel-editor-container {
    background: #1a1a1a;
    border: 3px solid #6aaa64;
    border-radius: 12px;
    padding: 30px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.pixel-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3a3a3a;
}

.pixel-editor-header h2 {
    font-family: 'Press Start 2P', monospace;
    font-size: 16px;
    color: #6aaa64;
    margin: 0;
}

.pixel-editor-close {
    background: none;
    border: none;
    color: #999;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pixel-editor-close:hover {
    color: #fff;
}

.pixel-editor-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 30px;
}

/* Canvas Area */
.pixel-canvas-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pixel-canvas {
    display: grid;
    gap: 1px;
    background: #2a2a2a;
    padding: 10px;
    border-radius: 8px;
    justify-self: center;
}

.pixel-cell {
    width: 20px;
    height: 20px;
    background: transparent;
    border: 1px solid #444;
    cursor: crosshair;
    transition: transform 0.1s;
}

.pixel-cell:hover {
    transform: scale(1.1);
    border-color: #6aaa64;
}

.pixel-cell.filled {
    border-color: #666;
}

/* Canvas Controls */
.canvas-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.canvas-control-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 8px 16px;
    background: #2a2a2a;
    border: 2px solid #6aaa64;
    color: #6aaa64;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.canvas-control-btn:hover {
    background: rgba(106, 170, 100, 0.2);
    border-color: #7bc96f;
    color: #7bc96f;
}

.canvas-control-btn:active {
    transform: scale(0.95);
}

/* Tools Panel */
.pixel-tools {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 200px;
}

.tool-section {
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    padding: 15px;
}

.tool-section h3 {
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    color: #6aaa64;
    margin: 0 0 12px 0;
}

/* Color Picker */
.color-picker-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.color-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input-wrapper input[type="color"] {
    width: 50px;
    height: 35px;
    border: 2px solid #444;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

.color-input-wrapper input[type="text"] {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 8px;
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 4px;
    color: #fff;
}

.current-color-display {
    width: 100%;
    height: 40px;
    border: 2px solid #444;
    border-radius: 4px;
    margin-top: 5px;
}

/* Preset Colors */
.preset-colors {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 10px;
}

.preset-color {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #444;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-color:hover {
    border-color: #6aaa64;
    transform: scale(1.1);
}

.preset-color.active {
    border-color: #6aaa64;
    box-shadow: 0 0 8px rgba(106, 170, 100, 0.5);
}

/* Tool Buttons */
.tool-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    padding: 10px;
    background: #1a1a1a;
    border: 2px solid #444;
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.tool-btn:hover {
    border-color: #6aaa64;
    color: #6aaa64;
}

.tool-btn.active {
    background: rgba(106, 170, 100, 0.2);
    border-color: #6aaa64;
    color: #6aaa64;
}

/* Grid Size Selector */
.grid-size-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.grid-size-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    padding: 8px;
    background: #1a1a1a;
    border: 2px solid #444;
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.grid-size-btn:hover {
    border-color: #6aaa64;
    color: #6aaa64;
}

.grid-size-btn.active {
    background: rgba(106, 170, 100, 0.2);
    border-color: #6aaa64;
    color: #6aaa64;
}

/* Preview */
.pixel-preview {
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

.pixel-preview-sprite {
    position: relative;
    width: 8px;
    height: 8px;
    transform: scale(8);
    background: transparent;
}

/* Export Section */
.export-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.export-output {
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 4px;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #6aaa64;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pixel-editor-container {
        padding: 15px;
        max-height: 95vh;
    }

    .pixel-editor-content {
        grid-template-columns: 1fr;
    }

    .pixel-cell {
        width: 15px;
        height: 15px;
    }

    .pixel-tools {
        min-width: auto;
    }
}
