/* Sprite Generator Tool Styles */

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.u-container {
    max-width: none !important;
    padding: 0 !important;
    height: 100vh;
}

#app {
    display: flex;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #1e1e1e;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Controls Panel - Left */
#controls-panel {
    width: 300px;
    min-width: 300px;
    background: #252526;
    border-right: 1px solid #3e3e42;
    overflow-y: auto;
    padding: 20px;
}

#controls-panel h2 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #82CAFA;
}

#controls-panel h3 {
    margin: 20px 0 10px 0;
    font-size: 14px;
    color: #cccccc;
    border-bottom: 1px solid #3e3e42;
    padding-bottom: 5px;
}

#controls-panel section {
    margin-bottom: 20px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #3e3e42;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #1e1e1e;
}

.upload-area:hover {
    border-color: #82CAFA;
    background: #2a2a2a;
}

.upload-area.drag-over {
    border-color: #82CAFA;
    background: #2a2a2a;
}

/* Controls */
.control-group {
    margin: 10px 0;
}

.control-group label {
    display: block;
    margin: 8px 0;
    font-size: 13px;
}

.control-group input[type="text"],
.control-group input[type="number"] {
    width: 100%;
    padding: 6px 8px;
    background: #3c3c3c;
    border: 1px solid #3e3e42;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.control-group input[type="text"]:focus,
.control-group input[type="number"]:focus {
    outline: none;
    border-color: #82CAFA;
}

.control-group input[type="checkbox"] {
    margin-right: 8px;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #0e639c;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1177bb;
}

.btn-secondary {
    background: #3e3e42;
    color: #e0e0e0;
}

.btn-secondary:hover:not(:disabled) {
    background: #4e4e52;
}

.btn-success {
    background: #0e7d0e;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #16a316;
}

.btn-danger {
    background: #a82e2e;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c44444;
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
    background: #3e3e42;
    color: #e0e0e0;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    margin: 0 2px;
}

.btn-small:hover {
    background: #4e4e52;
}

/* Frame List */
#frame-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
}

.frame-item {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 8px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.frame-item:hover {
    border-color: #82CAFA;
}

.frame-item.selected {
    border-color: #82CAFA;
    background: #2a2a2a;
}

.frame-preview {
    width: 40px;
    height: 40px;
    background: #3c3c3c;
    border-radius: 3px;
    image-rendering: pixelated;
}

.frame-info {
    flex: 1;
}

.frame-info input {
    width: 100%;
    padding: 4px;
    background: #3c3c3c;
    border: 1px solid #3e3e42;
    color: #e0e0e0;
    border-radius: 3px;
    font-size: 12px;
}

.frame-delete {
    background: #a82e2e;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}

.frame-delete:hover {
    background: #c44444;
}

/* Animation List */
#animation-list {
    margin-top: 10px;
}

.animation-item {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
}

.animation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.animation-name {
    font-weight: bold;
    color: #82CAFA;
}

.animation-frames {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 50px;
    padding: 8px;
    background: #2a2a2a;
    border-radius: 3px;
    border: 1px dashed #3e3e42;
}

.animation-frame {
    width: 40px;
    height: 40px;
    background: #3c3c3c;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: move;
    position: relative;
    padding: 0;
    overflow: hidden;
    transition: opacity 0.2s, transform 0.2s;
}

.animation-frame canvas {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
}

.animation-frame:hover {
    border-color: #82CAFA;
    transform: scale(1.05);
}

.animation-frame-delete {
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background: #a82e2e;
    color: white;
    border: none;
    border-radius: 0 3px 0 3px;
    cursor: pointer;
    font-size: 12px;
    line-height: 14px;
    padding: 0;
    display: none;
    z-index: 10;
}

.animation-frame:hover .animation-frame-delete {
    display: block;
}

.animation-frame-delete:hover {
    background: #c44444;
}

.animation-frame-time {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 9px;
    background: rgba(0,0,0,0.7);
    padding: 1px 3px;
    border-radius: 2px;
}

/* Editor Panel - Center */
#editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #2a2a2a;
    position: relative;
}

#canvas-container {
    flex: 1;
    position: relative;
    overflow: auto;
    background: #1e1e1e;
}

#editor-canvas {
    display: block;
    cursor: crosshair;
    image-rendering: pixelated;
}

#canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

#editor-controls {
    background: #252526;
    border-top: 1px solid #3e3e42;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
}

#editor-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Preview Panel - Right */
#preview-panel {
    width: 300px;
    min-width: 300px;
    background: #252526;
    border-left: 1px solid #3e3e42;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

#preview-panel h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #82CAFA;
}

#preview-canvas {
    width: 100%;
    height: 200px;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    image-rendering: pixelated;
}

#preview-controls {
    margin: 15px 0;
}

#preview-controls select {
    width: 100%;
    padding: 6px 8px;
    background: #3c3c3c;
    border: 1px solid #3e3e42;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 10px;
}

#preview-info {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 10px;
    font-size: 12px;
    margin-top: 15px;
}

#preview-info p {
    margin: 5px 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #3e3e42;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4e4e52;
}

/* Selection rectangle on canvas */
.selection-rect {
    stroke: #82CAFA;
    stroke-width: 2;
    fill: rgba(130, 202, 250, 0.1);
}

/* Frame rectangle on canvas */
.frame-rect {
    stroke: #0e7d0e;
    stroke-width: 2;
    fill: rgba(14, 125, 14, 0.1);
}

.frame-rect.selected {
    stroke: #82CAFA;
    stroke-width: 3;
}

/* Hide default file input */
input[type="file"] {
    display: none;
}

/* Image info */
#image-info {
    margin-top: 10px;
    font-size: 12px;
    color: #cccccc;
}

#image-info p {
    margin: 5px 0;
}
