/* ==========================================
   Transcription Benchmark - Design System
   ========================================== */

:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #06b6d4;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Neutral */
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-input: #0f172a;
    --border: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Effects */
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --glow-primary: 0 0 40px rgba(99, 102, 241, 0.3);
    --glow-success: 0 0 40px rgba(16, 185, 129, 0.3);

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ==========================================
   Layout
   ========================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 32px 0;
}

/* ==========================================
   Cards & Glassmorphism
   ========================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow);
}

.card-glass {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================
   Navigation
   ========================================== */

.navbar {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav {
    display: flex;
    gap: 24px;
    list-style: none;
}

.navbar-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 8px 16px;
    border-radius: var(--radius);
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--text);
    background: var(--bg-card);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ==========================================
   Buttons
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

/* ==========================================
   Forms
   ========================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: var(--font);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-input::placeholder {
    color: var(--text-dim);
}

/* ==========================================
   Login Page
   ========================================== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a2e 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* ==========================================
   Dashboard Stats
   ========================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--glow-primary);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.stat-icon.primary {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.stat-icon.secondary {
    background: rgba(6, 182, 212, 0.2);
    color: var(--secondary);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================
   Tables
   ========================================== */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 16px;
    text-align: left;
}

th {
    background: var(--bg-card);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    border-top: 1px solid var(--border);
}

tr:hover td {
    background: var(--bg-card);
}

/* ==========================================
   Audio Player
   ========================================== */

.audio-player {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.audio-player audio {
    width: 100%;
    height: 50px;
    border-radius: var(--radius);
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

.audio-time {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================
   Transcription Editor
   ========================================== */

.transcription-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--border);
    min-height: 400px;
}

.transcription-text {
    width: 100%;
    min-height: 300px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
    font-family: var(--font);
    resize: vertical;
    transition: all 0.3s ease;
}

.transcription-text:focus {
    outline: none;
    border-color: var(--primary);
}

.transcription-text.blurred {
    filter: blur(8px);
    user-select: none;
    pointer-events: none;
}

.transcription-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* ==========================================
   Timer
   ========================================== */

.timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary);
    background: rgba(6, 182, 212, 0.1);
    padding: 12px 20px;
    border-radius: var(--radius);
}

.timer.running {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ==========================================
   Waiting Screen
   ========================================== */

.waiting-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.waiting-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 32px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.waiting-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.waiting-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ==========================================
   Modal
   ========================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

/* ==========================================
   Badge
   ========================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 50px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.badge-primary {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
}

/* ==========================================
   Utilities
   ========================================== */

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-6 {
    margin-bottom: 24px;
}

.mb-8 {
    margin-bottom: 32px;
}

.mt-4 {
    margin-top: 16px;
}

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 8px;
}

.gap-4 {
    gap: 16px;
}

.gap-6 {
    gap: 24px;
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.whitespace-pre-wrap {
    white-space: pre-wrap;
}

.rounded {
    border-radius: var(--radius);
}

.text-sm {
    font-size: 0.875rem;
}

.p-4 {
    padding: 16px;
}

.bg-muted {
    background: var(--bg-input);
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==========================================
   Result Screen
   ========================================== */

.result-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 48px;
    text-align: center;
    border: 1px solid var(--border);
    max-width: 600px;
    margin: 0 auto;
}

.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 24px;
}

.result-icon.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.result-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin: 32px 0;
}

.result-stat {
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--radius);
}

.result-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-light);
}

.result-stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 768px) {
    .navbar-nav {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 32px 24px;
    }

    .transcription-container {
        padding: 20px;
    }
}