* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    color: #fff;
}

h1 {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
    text-align: center;
}

.editor-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    max-width: 600px;
    width: 100%;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    background: #2d3a4f;
}

#previewCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: move;
}

.upload-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(45, 58, 79, 0.95);
    border: 3px dashed rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: #e85d4c;
    background: rgba(45, 58, 79, 0.98);
}

.upload-zone.drag-over {
    border-color: #e85d4c;
    background: rgba(232, 93, 76, 0.1);
}

.upload-zone.hidden {
    display: none;
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.upload-text {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

#fileInput {
    display: none;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 500px;
}

.slider-group {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.slider-group.visible {
    display: flex;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e85d4c;
    cursor: pointer;
    transition: transform 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #e85d4c 0%, #c94a3a 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(232, 93, 76, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 93, 76, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

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

.btn svg {
    width: 20px;
    height: 20px;
}

.instructions {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.instructions strong {
    color: rgba(255, 255, 255, 0.9);
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2d3a4f;
    color: white;
    padding: 15px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid #4ade80;
}

.toast.error {
    border-left: 4px solid #f87171;
}

.language-toggle {
    display: flex;
    gap: 10px;
    align-self: flex-end;
    margin-bottom: 20px;
}

.language-btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.language-btn.active {
    background: #e85d4c;
    border-color: #e85d4c;
    color: #fff;
    box-shadow: 0 4px 12px rgba(232, 93, 76, 0.3);
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.5rem;
    }

    .canvas-wrapper {
        max-width: 350px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}
