body {
    margin: 0;
    padding: 0;
    background-color: #1e1e1e;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

#ui-container {
    width: 320px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(30, 30, 30, 0.95);
    border-right: 1px solid #444;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 2px 0 10px rgba(0,0,0,0.5);
}

#ui-container::-webkit-scrollbar {
    width: 5px;
}
#ui-container::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}

h1 {
    font-size: 1.4rem;
    margin: 0 0 5px 0;
    color: #e0e0e0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.panel {
    background: rgba(40, 40, 40, 0.85);
    border: 1px solid #555;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.panel h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    text-transform: uppercase;
    color: #ccc;
    letter-spacing: 1px;
}

p {
    font-size: 0.8rem;
    color: #aaaaaa;
    line-height: 1.4;
    margin: 0;
}

button {
    background: #e0e0e0;
    color: #222;
    border: 1px solid #aaa;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

button:hover:not([disabled]) {
    background: #d0d0d0;
    border-color: #888;
}

button[disabled] {
    background: #444;
    color: #777;
    border-color: #333;
    cursor: not-allowed;
}

.btn-action {
    background: #3a86ff;
    color: #fff;
    border-color: #2b65c2;
    width: 100%;
}
.btn-action:hover:not([disabled]) {
    background: #2b65c2;
    border-color: #1e4a91;
}

input[type="file"] {
    font-size: 0.8rem;
    color: #ccc;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 5px;
}

.settings-group label {
    font-size: 0.85rem;
    color: #ccc;
}

select {
    background: #333;
    color: #eee;
    border: 1px solid #555;
    padding: 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

#workspace {
    flex-grow: 1;
    display: flex;
    padding: 20px;
    gap: 20px;
    background-color: #121212;
    overflow: auto;
}

.preview-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #222;
    border: 1px dashed #555;
    border-radius: 8px;
    padding: 15px;
    min-width: 0;
}

.preview-box h4 {
    margin: 0 0 15px 0;
    color: #aaa;
    text-align: center;
    font-weight: normal;
    text-transform: uppercase;
    font-size: 12px;
}

#original-container, #svg-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#original-container img, #svg-container svg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: repeating-conic-gradient(#333 0% 25%, transparent 0% 50%) 50% / 20px 20px;
    border-radius: 4px;
}

#canvas-container { width: 100%; height: 100%; position: relative; }
#canvas-container canvas { display: block; outline: none; }

@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
        background-color: #121212;
    }
    #ui-container {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        box-sizing: border-box;
        height: auto;
        max-height: none;
        background: rgba(25, 25, 25, 1);
        padding: 20px 15px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.5);
        z-index: 20;
    }
    #workspace {
        flex-direction: column;
        height: auto;
        overflow: visible;
        min-height: 500px;
        padding: 15px;
        gap: 15px;
    }
    .preview-box {
        min-height: 250px;
        border-radius: 16px;
        background: #1a1a1a;
        border: 1px solid rgba(255,255,255,0.05);
    }
    .panel {
        background: rgba(40, 40, 40, 0.6);
        border: 1px solid rgba(255,255,255,0.05);
        border-radius: 16px;
        padding: 15px;
    }
    button, select, input[type="file"] {
        min-height: 48px;
        font-size: 14px;
        border-radius: 10px;
    }
    #canvas-container {
        min-height: 350px;
        border-radius: 16px;
        overflow: hidden;
    }
}

