:root {
    --bg-color: #0f111a;
    --panel-bg: rgba(25, 28, 41, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-color: #7c3aed;
    --accent-hover: #6d28d9;
    --text-color: #f3f4f6;
    --text-muted: #9ca3af;
    --radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-image: radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.15) 0%, transparent 40%),
                      radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 40%);
}

.app-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    width: 100%;
    max-width: 1100px;
    height: 700px;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Panel de Control */
.control-panel {
    padding: 30px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #a78bfa;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

textarea, select {
    background: rgba(15, 17, 26, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-color);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

textarea:focus, select:focus {
    border-color: var(--accent-color);
}

textarea {
    resize: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), #4f46e5);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: auto;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Área de Visualización */
.preview-area {
    display: flex;
    flex-direction: column;
    padding: 30px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.badge {
    background: rgba(124, 58, 237, 0.2);
    color: #c4b5fd;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.canvas-container {
    flex: 1;
    background: rgba(10, 11, 16, 0.5);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.placeholder-content {
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.placeholder-content i {
    font-size: 3rem;
    color: #4b5563;
}

.placeholder-content span {
    font-size: 0.8rem;
}

/* Loader Styles */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--text-muted);
}

.spinner {
    width: 45px;
    height: 45px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Resultado */
.result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.result-card img {
    max-height: 380px;
    max-width: 100%;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.result-actions {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        height: auto;
    }
}