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

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

.app {
    max-width: 1160px;
    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;
}

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

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

.drop-row {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: var(--space-3);
    align-items: stretch;
}

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

.drop-zone.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

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

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

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

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

.file-info .value {
    font-size: 16px;
    font-weight: 600;
}

.file-info .meta {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.file-actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-start;
    gap: var(--space-2);
}

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

.page-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-strong);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-2);
    animation: pulse 1.4s ease-in-out infinite;
}

.page-loading::after {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(56, 189, 248, 0.4);
    border-top-color: var(--accent-strong);
    animation: spin 0.9s linear infinite;
    display: inline-block;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 rgba(34, 211, 238, 0.0); }
    50% { box-shadow: 0 0 16px rgba(34, 211, 238, 0.25); }
    100% { box-shadow: 0 0 0 rgba(34, 211, 238, 0.0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.page-nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.page-indicator {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.6);
}

.selection-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
}

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

.selection-meta .value {
    font-weight: 600;
}

.empty-state {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: var(--space-3);
    text-align: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.02);
}

.page-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.page-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    padding: var(--space-2);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 220px;
}

.page-card input {
    accent-color: var(--accent);
}

.page-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.page-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.page-thumb {
    border-radius: 10px;
    overflow: hidden;
    background: #0d1525;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 12px;
}

.page-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

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

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

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

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

.scale-size {
    margin: 0;
    color: var(--accent-strong);
    font-size: 14px;
    font-family: var(--font-mono);
    font-weight: 600;
}

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

.field span {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.field input[type="text"],
.field select {
    width: 100%;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0d1525;
    color: var(--text);
    font-family: var(--font-sans);
}

.field input[type="color"] {
    width: 44px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    padding: 0;
}

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

.field-row input[type="range"] {
    flex: 1;
}

.checkbox-row {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.checkbox-row span {
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
}

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

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

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

.ghost-button,
.pill-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 999px;
    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;
    font-weight: 600;
}

.ghost-button.accent-button {
    border-color: rgba(34, 211, 238, 0.7);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(34, 211, 238, 0.2));
    color: #e6faff;
    box-shadow: 0 8px 20px rgba(34, 211, 238, 0.18);
}

.ghost-button.accent-button:hover {
    border-color: rgba(34, 211, 238, 0.9);
    box-shadow: 0 10px 28px rgba(34, 211, 238, 0.28);
}

.pill-button {
    border-color: rgba(56, 189, 248, 0.6);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(34, 211, 238, 0.3));
    color: #e6faff;
}

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

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

.ghost-button:disabled,
.pill-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.error-banner {
    margin: 0;
    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;
}

.progress {
    height: 10px;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
}

#progressFill,
#pageProgressFill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    transition: width 0.2s ease;
}

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

.hidden {
    display: none !important;
}

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

@media (max-width: 640px) {
    .controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-card {
        min-height: 200px;
    }
}
