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

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

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

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

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

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

.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;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.section-heading h2,
.section-heading h3 {
    margin: 0;
}

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

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

.mode-toggle {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.mode-btn {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.mode-btn.is-active {
    border-color: rgba(56, 189, 248, 0.7);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(14, 165, 233, 0.08));
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.mode-btn:hover {
    transform: translateY(-1px);
}

.mode-hint {
    color: var(--muted);
    font-size: 13px;
}

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

.layout--split {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: stretch;
}

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

.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 {
    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;
}

.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);
}

.folder-picker {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    padding: var(--space-3);
}

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

.button-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: 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;
}

.summary-grid {
    display: grid;
    gap: 8px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

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

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

.size-warning {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.08);
    color: #fecdd3;
    font-size: 13px;
}

.preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.preview-frame {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0b1220;
    padding: 8px;
}

.preview-frame img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

.file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.file-body {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 12px;
    color: var(--muted);
}

.file-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.icon-button {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.icon-button:hover {
    border-color: rgba(56, 189, 248, 0.6);
    transform: translateY(-1px);
}

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

.list-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-3);
}

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

.option-label {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

.field span {
    color: var(--muted);
}

.field-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-row input[disabled] {
    opacity: 0.6;
}

.field.is-disabled {
    opacity: 0.55;
}

.field.is-disabled input,
.field.is-disabled select {
    pointer-events: none;
}

select,
input[type="text"],
input[type="number"],
input[type="range"] {
    width: 100%;
}

select,
input[type="text"],
input[type="number"] {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0d1525;
    color: var(--text);
    font-size: 14px;
}

input[type="range"] {
    accent-color: var(--accent);
}

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

.status {
    color: var(--muted);
    font-size: 14px;
}

.actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.error-banner {
    margin: 0 0 var(--space-2);
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.08);
    color: #fecdd3;
    font-size: 14px;
}

.mono {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}

.hidden {
    display: none !important;
}

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

    .preview-frame img {
        height: 200px;
    }
}

@media (max-width: 640px) {
    .app {
        margin: 36px auto 60px;
    }

    .header h1 {
        font-size: 28px;
    }
}
