@import "../../style.css";

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
}

.app {
    max-width: 1200px;
    margin: 48px auto 64px;
    padding: 0 var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}

.header h1 {
    margin: 0;
    font-size: 32px;
    letter-spacing: 0.02em;
}

.header .lede {
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    align-self: center;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.step-pill {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 13px;
}

.card {
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    align-items: center;
    flex-wrap: wrap;
}

.section-heading h2 {
    margin: 0;
}

.section-label {
    display: inline-block;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.hint {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.hint.small {
    font-size: 12px;
}

.layout {
    display: grid;
    gap: var(--space-3);
}

.layout--split {
    grid-template-columns: minmax(0, 1fr) 560px;
    align-items: start;
}

.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.drop-zone {
    position: relative;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    padding: var(--space-3);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.drop-zone:hover {
    border-color: rgba(56, 189, 248, 0.6);
    background: rgba(56, 189, 248, 0.05);
}

.drop-zone.is-dragover {
    border-color: rgba(34, 211, 238, 0.9);
    background: rgba(34, 211, 238, 0.12);
    transform: translateY(-2px);
}

.drop-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    text-align: center;
}

.primary {
    margin: 0;
    font-weight: 700;
}

.secondary {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.ghost-button:hover {
    border-color: rgba(56, 189, 248, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.ghost-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.ghost-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.file-meta {
    display: grid;
    gap: 6px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.meta-row .label {
    color: var(--muted);
}

.meta-row .value {
    font-family: var(--font-mono);
}

.control-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.control {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-strong);
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 14px;
    font-weight: 600;
}

.muted {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.mono {
    font-family: var(--font-mono);
}

input[type="range"] {
    width: 100%;
}

.toggle-row,
.radio-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.toggle-row label,
.radio-row label {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    cursor: pointer;
}

.control-actions {
    gap: 12px;
}

.button-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.status-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--muted);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.08);
    flex-shrink: 0;
}

.preview-stack {
    display: grid;
    gap: var(--space-3);
}

.preview-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.canvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.pill {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    font-size: 12px;
    color: var(--muted);
}

.canvas-frame {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #0d1525;
    overflow: hidden;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkerboard {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 32px 32px;
    background-position: 0 0, 0 16px, 16px -16px, -16px 0px;
    opacity: 0.5;
}

.canvas-stack {
    position: relative;
    display: inline-block;
    z-index: 1;
}

.canvas-stack canvas {
    display: block;
    image-rendering: auto;
}

#overlayCanvas {
    position: absolute;
    inset: 0;
    cursor: crosshair;
    touch-action: none;
    z-index: 2;
}

#cursorCanvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.hidden {
    display: none !important;
}

@media (max-width: 980px) {
    .layout--split {
        grid-template-columns: 1fr;
    }

    .header {
        text-align: left;
    }

    .steps {
        justify-content: flex-start;
    }
}
