/* Free Transcribe – clean centered card layout */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #16a34a;
    --success-hover: #15803d;
    --bg: #f1f5f9;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.app-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.main-card {
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    padding: 2rem;
}

.main-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--text);
    text-align: center;
}

.main-title i {
    color: var(--primary);
    margin-right: 0.35rem;
}

.main-subtitle {
    text-align: center;
    color: var(--muted);
    margin: 0 0 1.5rem 0;
    font-size: 1rem;
}

.upload-section {
    margin-bottom: 1.5rem;
}

.upload-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0 0 0.5rem 0;
    color: var(--text);
}

/* Hide file input; label for="file-input" opens it on click */
.file-input-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
}

.drop-zone {
    display: block;
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}

.browse-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.browse-btn:hover {
    color: var(--primary-hover);
}

.browse-btn i {
    font-size: 1.25rem;
}

.supported-formats {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0.5rem 0 0 0;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.file-info i {
    color: var(--success);
    font-size: 1.5rem;
}

.file-name {
    font-weight: 600;
    display: block;
}

.file-size {
    font-size: 0.85rem;
    color: var(--muted);
}

.model-section {
    margin-bottom: 1.5rem;
}

.model-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0 0 0.5rem 0;
    color: var(--text);
}

.model-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.model-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.model-pill:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.model-pill input {
    margin: 0 0.25rem 0 0;
    accent-color: var(--primary);
}

.model-pill span {
    color: var(--muted);
    font-size: 0.8rem;
    margin-left: 0.15rem;
}

.model-pill:has(input:checked) {
    border-color: var(--primary);
    background: #eff6ff;
    font-weight: 500;
}

.btn-start {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    background: var(--success);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-start:hover:not(:disabled) {
    background: var(--success-hover);
}

.btn-start:disabled {
    background: var(--muted);
    cursor: not-allowed;
    opacity: 0.8;
}

.progress-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.progress-text {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.progress-bar-wrap {
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-bar-inner {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-pct {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}

.results-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.results-heading {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: var(--success);
}

.results-heading i {
    margin-right: 0.35rem;
}

.transcript-box {
    width: 100%;
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    resize: vertical;
    min-height: 280px;
    font-family: inherit;
    margin-bottom: 1rem;
}

.transcript-box:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.download-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-dl {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.btn-dl:hover:not(:disabled) {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
}

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

@media (max-width: 640px) {
    .app-wrap {
        padding: 1rem 0.75rem;
    }
    .main-card {
        padding: 1.5rem;
    }
    .model-pills {
        flex-direction: column;
    }
    .model-pill {
        justify-content: center;
    }
}
