:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f3f4f6;
    --card-bg: #ffffff;
    --text: #1f2937;
    --border: #e5e7eb;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: flex-start;
    min-height: 100vh;
    flex-direction: column;
    align-items: center; 
}

.container { width: 100%; max-width: 550px; margin-top: 10px; }

header { text-align: center; margin-bottom: 20px; }
h1 { margin-bottom: 5px; color: #111827; font-size: 1.5rem; }
.subtitle { color: #6b7280; font-size: 0.9rem; margin-top: 0; }

.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    padding: 24px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

/* DRAG & DROP ZONE */
.drop-zone {
    border: 2px dashed #9ca3af;
    border-radius: 8px;
    position: relative;
    text-align: center;
    padding: 25px 15px;
    background: #f9fafb;
    transition: all 0.2s ease;
    cursor: pointer;
}

.drop-zone:hover, .drop-zone.dragover {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
}

.drop-content .icon { font-size: 2rem; display: block; margin-bottom: 5px; }
.drop-content p { margin: 0; font-size: 0.95rem; }
.drop-content .formats { font-size: 0.75rem; color: #6b7280; margin-top: 5px; }

/* El input real es invisible pero cubre todo para capturar el click */
.file-input-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

small { display: block; margin-top: 8px; color: #6b7280; font-size: 0.85rem; }

/* INPUTS Y CHECKBOX */
.form-group { margin-bottom: 18px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }

input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #4b5563;
}
.checkbox-wrapper input { margin-right: 8px; cursor: pointer; }
.checkbox-wrapper label { margin-bottom: 0; font-weight: normal; cursor: pointer; }

/* SLIDERS GRID */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}
input[type="range"] { width: 100%; cursor: pointer; }

/* EDITOR CANVAS */
.canvas-wrapper {
    width: 100%;
    border: 2px dashed #d1d5db;
    margin-bottom: 10px;
    background: #e5e7eb;
    display: flex;
    justify-content: center;
    overflow: hidden;
}
canvas { max-width: 100%; height: auto; cursor: crosshair; display: block; touch-action: none; }
.instruction { font-size: 0.8rem; color: #6b7280; margin-bottom: 5px; }

/* BOTONES Y ALERTAS */
button, .btn-download {
    display: block; width: 100%; padding: 12px;
    background-color: var(--primary); color: white;
    border: none; border-radius: 6px; font-weight: 600;
    cursor: pointer; font-size: 1rem; text-align: center;
    text-decoration: none; transition: 0.2s;
    box-sizing: border-box;
}
button:hover, .btn-download:hover { background-color: var(--primary-hover); }
button:disabled { background-color: #9ca3af; cursor: not-allowed; }

.btn-secondary {
    background-color: white; color: var(--text);
    border: 1px solid #d1d5db; padding: 8px; font-size: 0.9rem;
}
.btn-secondary:hover { background-color: #f3f4f6; }

.hidden { display: none !important; }

.info-box {
    background: #eff6ff; border-left: 4px solid #3b82f6;
    padding: 10px; font-size: 0.85rem; color: #1e40af;
    margin-bottom: 15px;
}

.result { text-align: center; }
.success-icon { font-size: 3rem; color: #10b981; margin-bottom: 10px; }

.footer-credits {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #6b7280; /* Un gris suave */
}

.footer-credits a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-credits a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.preview-container {
    margin: 20px 0;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

#previewVisual {
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    background: #ddd;
    border-radius: 4px;
}

#previewVisual img {
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#previewVisual iframe {
    width: 100%;
    height: 400px;
    border: none;
}