/* Sherpa Vietnamese ASR — minimal modern UI (light) */

:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --border: #e7e9ee;
    --border-strong: #d6d9e0;
    --text: #1f2430;
    --text-soft: #5b6472;
    --text-faint: #8b93a3;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-soft: #eef0fe;
    --danger: #dc2626;
    --ok: #16a34a;
    --warn: #b45309;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(20, 24, 35, .04), 0 1px 3px rgba(20, 24, 35, .06);
    --shadow-md: 0 6px 24px rgba(20, 24, 35, .07);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
        "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 650;
    letter-spacing: -.01em;
}

.brand-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7c6cff);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.brand-name {
    font-size: 16px;
}

.header-link {
    color: var(--text-soft);
    text-decoration: none;
    font-size: 13.5px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    transition: all .15s ease;
}

.header-link:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

/* Main */
.app-main {
    flex: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 12px 24px 48px;
}

.hero {
    text-align: center;
    padding: 24px 0 28px;
}

.hero-title {
    font-size: 28px;
    font-weight: 720;
    letter-spacing: -.02em;
    margin: 0 0 8px;
}

.hero-sub {
    color: var(--text-soft);
    margin: 0;
    font-size: 15px;
}

/* Card */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 18px;
}

/* Drop zone */
.drop-zone {
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: #fcfcfd;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
    outline: none;
}

.drop-zone:hover,
.drop-zone:focus-visible {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.drop-icon {
    color: var(--accent);
    margin-bottom: 6px;
}

.drop-main {
    margin: 4px 0 6px;
    font-size: 15px;
    color: var(--text);
}

.drop-link {
    color: var(--accent);
    font-weight: 600;
}

.drop-hint {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-faint);
}

.file-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    color: var(--text);
}

.file-chip svg {
    color: var(--accent);
    flex-shrink: 0;
}

.file-name {
    font-weight: 560;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: var(--text-faint);
    font-size: 13px;
    flex-shrink: 0;
}

.chip-clear {
    margin-left: auto;
    border: none;
    background: transparent;
    color: var(--text-faint);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 6px;
    flex-shrink: 0;
}

.chip-clear:hover {
    color: var(--danger);
}

/* Actions / buttons */
.actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn {
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 580;
    border-radius: var(--radius-sm);
    padding: 11px 20px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s ease;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    justify-content: center;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    flex: 1;
    box-shadow: 0 1px 2px rgba(79, 70, 229, .25);
}

.btn-primary:not(:disabled):hover {
    background: var(--accent-hover);
}

.btn-ghost {
    background: var(--surface);
    color: var(--text-soft);
    border-color: var(--border-strong);
}

.btn-ghost:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-soft {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 8px 14px;
    font-size: 13.5px;
}

.btn-soft:hover {
    background: #e3e6fd;
}

/* Progress */
.progress {
    margin-top: 18px;
}

.progress-row {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--text-soft);
    margin-bottom: 8px;
}

.progress-track {
    height: 8px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), #7c6cff);
    border-radius: 999px;
    transition: width .3s ease;
}

.progress-fill.indeterminate {
    width: 35% !important;
    animation: slide 1.2s ease-in-out infinite;
}

@keyframes slide {
    0% { margin-left: -35%; }
    100% { margin-left: 100%; }
}

.queue-info {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--warn);
    text-align: center;
}

/* Result */
.result-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.result-title {
    font-weight: 650;
    font-size: 16px;
}

.result-meta {
    color: var(--text-faint);
    font-size: 12.5px;
    margin-left: 2px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transcript {
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

.spk-block {
    border-left: 3px solid var(--accent);
    padding: 2px 0 2px 14px;
    margin: 0 0 16px;
}

.spk-label {
    font-weight: 650;
    font-size: 13.5px;
    margin-bottom: 3px;
}

.spk-text {
    color: var(--text);
}

.seg-span {
    cursor: pointer;
    border-radius: 4px;
    padding: 1px 1px;
    transition: background .12s ease;
}

.seg-span:hover {
    background: var(--accent-soft);
}

.seg-highlight {
    background: #fff3cd;
    box-shadow: 0 0 0 2px #fff3cd;
}

.word-suspect {
    color: #b06a2c;
}

/* Player */
.player {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.btn-play {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s ease;
}

.btn-play:hover {
    background: var(--accent-hover);
}

.player-seek {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: var(--border);
    cursor: pointer;
}

.player-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.player-seek::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #fff;
    cursor: pointer;
}

.player-time {
    font-size: 12.5px;
    color: var(--text-soft);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* Footer */
.app-footer {
    text-align: center;
    color: var(--text-faint);
    font-size: 12.5px;
    padding: 20px 0 8px;
}

.dot-sep {
    margin: 0 7px;
}

/* Toast */
.toast-host {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    pointer-events: none;
}

.toast {
    background: #1f2430;
    color: #fff;
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    box-shadow: var(--shadow-md);
    animation: toast-in .2s ease;
    max-width: 88vw;
}

.toast.error {
    background: var(--danger);
}

.toast.success {
    background: #15803d;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 560px) {
    .app-header, .app-main { padding-left: 16px; padding-right: 16px; }
    .hero-title { font-size: 23px; }
    .card { padding: 16px; }
    .drop-zone { padding: 28px 14px; }
}
