/* ROM Hack Studio Styles */

.studio-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.upload-section {
    text-align: center;
    padding: 40px;
}

.upload-area {
    border: 3px dashed var(--panel-border, #333);
    border-radius: 12px;
    padding: 60px 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.2);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent-bright, #e94560);
    background: rgba(233, 69, 96, 0.1);
}

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
}

.upload-placeholder p {
    margin: 8px 0;
    color: var(--text-dim, #888);
}

.upload-progress {
    margin-top: 20px;
}

.progress-bar {
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-bright), #ff6b6b);
    width: 0%;
    transition: width 0.3s ease;
    animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Asset Section */
.asset-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--panel-border, #333);
    padding-bottom: 8px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text, #eaeaea);
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.1);
}

.tab-btn.active {
    background: var(--accent-bright, #e94560);
    color: white;
}

.sprite-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 4px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
}

.sprite-tile {
    width: 40px;
    height: 40px;
    background-repeat: no-repeat;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: all 0.2s;
    image-rendering: pixelated;
}

.sprite-tile:hover {
    border-color: var(--accent-bright, #e94560);
    transform: scale(1.1);
    z-index: 10;
}

.sprite-tile.selected {
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0,255,0,0.5);
}

/* Editor Section */
.editor-toolbar {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tool-group,
.layer-group,
.zoom-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

.tool-btn.active {
    border-color: var(--accent-bright, #e94560);
    background: rgba(233, 69, 96, 0.2);
}

.editor-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
}

.tile-palette {
    background: rgba(0,0,0,0.3);
    padding: 16px;
    border-radius: 8px;
}

.selected-tile-preview {
    width: 64px;
    height: 64px;
    background: rgba(0,0,0,0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.selected-tile-preview .placeholder {
    color: var(--text-dim, #888);
    font-size: 0.8rem;
}

.level-canvas-container {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    overflow: auto;
    max-height: 400px;
    position: relative;
}

#levelCanvas {
    background: #1a1a2e;
    cursor: crosshair;
}

.level-properties {
    margin-top: 16px;
    padding: 16px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
}

.property-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.property-group label {
    min-width: 100px;
}

.property-group input[type="range"] {
    flex: 1;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--panel-bg, #16213e);
    padding: 32px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
}

.entity-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.entity-btn {
    padding: 16px;
    background: rgba(255,255,255,0.1);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text, #eaeaea);
    cursor: pointer;
    transition: all 0.2s;
}

.entity-btn:hover {
    border-color: var(--accent-bright, #e94560);
    background: rgba(233, 69, 96, 0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }
    
    .tile-palette {
        display: flex;
        gap: 16px;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .editor-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sprite-grid {
        grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    }
}

/* Enhanced button styles for clickability */
.start-hack-btn {
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
    cursor: pointer !important;
}

.rom-select-card {
    pointer-events: auto !important;
    user-select: none;
}

.rom-select-card * {
    pointer-events: auto;
}

/* Ensure gallery is visible and interactive */
#romGallery {
    pointer-events: auto !important;
    min-height: 200px;
}

/* Fix for any overlay issues */
.rom-select-card:hover .start-hack-btn {
    background: var(--accent-bright, #e94560);
    color: white;
}
