/* mystt - Persian Call Transcription Service Styles */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Vazirmatn', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }

.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 1rem; }

.header { background: var(--card-bg); border-bottom: 1px solid var(--border); padding: 1rem 0; position: sticky; top: 0; z-index: 100; }
.header .container { display: flex; justify-content: space-between; align-items: center; }
.header h1 a { color: var(--primary); text-decoration: none; font-weight: 700; font-size: 1.5rem; }
.header nav { display: flex; gap: 1.5rem; }
.header nav a { color: var(--text-muted); text-decoration: none; font-weight: 500; transition: color 0.2s; }
.header nav a:hover { color: var(--primary); }

.main { flex: 1; padding: 2rem 0; }

.footer { background: var(--card-bg); border-top: 1px solid var(--border); padding: 1.5rem 0; text-align: center; color: var(--text-muted); font-size: 0.875rem; }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-header h2 { font-size: 1.5rem; font-weight: 600; }

.badge { background: var(--primary); color: white; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; }
.badge-word { background: #dbeafe; color: #1e40af; }
.badge-phrase { background: #fef3c7; color: #92400e; }

.status-badge { padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-downloading { background: #dbeafe; color: #1e40af; }
.status-transcribing { background: #e0e7ff; color: #3730a3; }
.status-done { background: #dcfce7; color: #166534; }
.status-failed { background: #fee2e2; color: #991b1b; }

.filters { background: var(--card-bg); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.filters .filter-group { margin-bottom: 1rem; }
.filters .filter-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.875rem; }
.filters .filter-group input, .filters .filter-group select { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; font-size: 0.875rem; }
.filters .filter-actions { display: flex; gap: 0.5rem; align-items: flex-end; }
@media (min-width: 768px) { .filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) gap 1rem; align-items: end; } .filters .filter-group { margin-bottom: 0; } .filters .filter-actions { grid-column: 1 / -1; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.5rem 1rem; border: none; border-radius: var(--radius); font-family: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: #475569; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }

.table-responsive { overflow-x: auto; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.875rem 1rem; text-align: right; border-bottom: 1px solid var(--border); }
th { background: #f8fafc; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }
.transcript-preview { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; font-size: 0.8125rem; color: var(--text-muted); }
.empty { text-align: center; color: var(--text-muted); padding: 3rem !important; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.page-info { color: var(--text-muted); font-size: 0.875rem; }

.call-detail-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin-bottom: 2rem; }
@media (min-width: 900px) { .call-detail-grid { grid-template-columns: 1fr 400px; } }

.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.card h3 { margin-bottom: 1rem; font-size: 1.125rem; font-weight: 600; }
dl { display: grid; grid-template-columns: 120px 1fr; gap: 0.5rem 1rem; }
dt { color: var(--text-muted); font-size: 0.875rem; }
dd { font-weight: 500; }
dd.error { color: var(--danger); }

.audio-card audio { width: 100%; }

.transcript-section { margin-top: 2rem; }
.transcript-text { white-space: pre-wrap; font-family: 'Vazirmatn', monospace; line-height: 2; padding: 1.5rem; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.transcript-text.corrected { direction: rtl; }
.transcript-text.raw { direction: rtl; color: var(--text-muted); font-size: 0.875rem; }
.raw-transcript summary { cursor: pointer; margin: 1rem 0; color: var(--text-muted); font-weight: 500; }

.words-timeline { display: flex; flex-wrap: wrap; gap: 0.375rem; padding: 1rem; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.word-token { padding: 0.25rem 0.5rem; background: #f1f5f9; border-radius: 4px; font-size: 0.875rem; cursor: pointer; transition: all 0.2s; border: 1px solid transparent; }
.word-token:hover { background: var(--primary); color: white; border-color: var(--primary); }

.corrections-table { width: 100%; }
.corrections-table td { vertical-align: middle; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.modal-content { background: var(--card-bg); border-radius: var(--radius); padding: 1.5rem; width: 100%; max-width: 500px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
.modal-content h3 { margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.form-group input, .form-group select { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; }
.form-group input[type="checkbox"] { width: auto; margin-left: 0.5rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.5rem; }

.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }

@media (max-width: 640px) {
    dl { grid-template-columns: 1fr; gap: 0.25rem 0; }
    dt { font-weight: 500; }
}