/* ─────────────────────────────────────────────
   Lottie-to Webapp  ·  styles.css
   ───────────────────────────────────────────── */

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

:root {
    --bg:        #141419;
    --surface:   #1e1e26;
    --surface2:  #26262f;
    --border:    #35354a;
    --accent:    #7c6af7;
    --accent-h:  #9b8dff;
    --text:      #e0dff5;
    --text-dim:  #8888aa;
    --error:     #f76a6a;
    --success:   #6af79e;
    --radius:    10px;
    --gap:       20px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────── */
header {
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    gap: 14px;
}

header .logo {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), #5b4de0);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}

header h1 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
header p  { font-size: 0.8rem; color: var(--text-dim); margin-top: 2px; }

/* ── Main layout ─────────────────────────────────────────── */
main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 340px;
    grid-template-rows: auto 1fr;
    gap: var(--gap);
    padding: var(--gap) 32px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ── Drop zone ───────────────────────────────────────────── */
#dropZone {
    grid-column: 1 / -1;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: var(--surface);
}

#dropZone:hover,
#dropZone.drag-over {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

#dropZone .drop-icon  { font-size: 2.4rem; margin-bottom: 10px; }
#dropZone h2          { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
#dropZone p           { font-size: 0.85rem; color: var(--text-dim); }

#fileInput { display: none; }

/* ── Preview ─────────────────────────────────────────────── */
#previewSection {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    flex-direction: column;
    gap: 14px;
    min-height: 220px;
    align-items: center;
}

#previewSection h3 { font-size: 0.9rem; color: var(--text-dim); align-self: flex-start; }

#previewCanvas {
    background-image: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-color: #fff;
    border-radius: 6px;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}

/* ── Export panel ────────────────────────────────────────── */
#exportSection {
    display: none;
    flex-direction: column;
    gap: 14px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}

.panel h3 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-dim);
    margin-bottom: 14px;
}

/* Form controls */
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }

label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 5px;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 10px;
    color: var(--text);
    font-size: 0.88rem;
    outline: none;
    transition: border-color .15s;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: var(--accent);
}

select option { background: var(--surface2); }

/* Dimension row */
.dim-row {
    display: flex; align-items: center; gap: 8px;
}
.dim-row input { flex: 1; }
.dim-sep { color: var(--text-dim); font-size: 0.9rem; }

/* Checkbox row */
.check-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.88rem;
}

input[type="checkbox"] {
    width: 15px; height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Export button */
#exportBtn {
    width: 100%;
    padding: 11px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, opacity .15s;
    letter-spacing: -0.01em;
}

#exportBtn:hover:not(:disabled) { background: var(--accent-h); }
#exportBtn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Status bar ──────────────────────────────────────────── */
.status-bar {
    grid-column: 1 / -1;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 0.85rem;
    color: var(--text-dim);
    min-height: 38px;
    display: flex; align-items: center;
}

.status-bar.error { color: var(--error); border-color: var(--error); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 720px) {
    main {
        grid-template-columns: 1fr;
        padding: 14px 16px;
    }
    #previewSection, #exportSection { grid-column: 1; }
}
