/* Verba — Ultra-modern UI */

/* =================== THEMES =================== */

/* Obsidian Glass — glassmorphism dark */
:root,
[data-theme="obsidian"] {
    --bg: #0c0c14;
    --bg-subtle: #12121c;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.07);
    --surface-solid: #16162a;
    --text: #e4e4e7;
    --text-secondary: #71717a;
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-gradient: linear-gradient(135deg, #6366f1, #a78bfa);
    --primary-glow: rgba(99, 102, 241, 0.25);
    --success: #34d399;
    --error: #f87171;
    --warning: #fbbf24;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --shadow-lg: rgba(0, 0, 0, 0.3);
    --input-bg: rgba(255, 255, 255, 0.04);
    --login-bg: radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(167, 139, 250, 0.08) 0%, transparent 50%),
                #0c0c14;
    --modal-overlay: rgba(0, 0, 0, 0.6);
    --scrollbar-thumb: rgba(255, 255, 255, 0.1);
}

/* Neon Noir — cyber dark */
[data-theme="neon"] {
    --bg: #09090b;
    --bg-subtle: #0f0f12;
    --surface: #18181b;
    --surface-hover: #202024;
    --surface-solid: #18181b;
    --text: #fafafa;
    --text-secondary: #a1a1aa;
    --primary: #22d3ee;
    --primary-light: #67e8f9;
    --primary-gradient: linear-gradient(135deg, #22d3ee, #a78bfa);
    --primary-glow: rgba(34, 211, 238, 0.3);
    --success: #4ade80;
    --error: #f87171;
    --warning: #fbbf24;
    --border: #27272a;
    --border-hover: #3f3f46;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
    --input-bg: #111113;
    --login-bg: radial-gradient(ellipse at 50% 0%, rgba(34, 211, 238, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 100%, rgba(167, 139, 250, 0.04) 0%, transparent 50%),
                #09090b;
    --modal-overlay: rgba(0, 0, 0, 0.7);
    --scrollbar-thumb: #3f3f46;
}

/* Velvet Ember — warm luxury dark */
[data-theme="ember"] {
    --bg: #0a0a0a;
    --bg-subtle: #111111;
    --surface: #151515;
    --surface-hover: #1c1c1c;
    --surface-solid: #151515;
    --text: #e5e5e5;
    --text-secondary: #737373;
    --primary: #f59e0b;
    --primary-light: #fbbf24;
    --primary-gradient: linear-gradient(135deg, #f59e0b, #ef4444);
    --primary-glow: rgba(245, 158, 11, 0.2);
    --success: #34d399;
    --error: #f87171;
    --warning: #fbbf24;
    --border: #1f1f1f;
    --border-hover: #2e2e2e;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.4);
    --input-bg: #0f0f0f;
    --login-bg: radial-gradient(ellipse at 40% 30%, rgba(245, 158, 11, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 60% 70%, rgba(239, 68, 68, 0.04) 0%, transparent 50%),
                #0a0a0a;
    --modal-overlay: rgba(0, 0, 0, 0.65);
    --scrollbar-thumb: #2e2e2e;
}

/* =================== RESET =================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

/* =================== BUTTONS =================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 0 32px var(--primary-glow);
    filter: brightness(1.1);
}

.btn-danger {
    color: var(--error);
    border-color: rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.1);
    border-color: var(--error);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-ghost {
    border: none;
    background: none;
    font-size: 18px;
    padding: 4px 8px;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius);
}

/* =================== LOGIN PAGE =================== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--login-bg);
    position: relative;
    overflow: hidden;
}

.login-container {
    background: var(--surface);
    padding: 40px;
    border-radius: calc(var(--radius) + 4px);
    border: 1px solid var(--border);
    box-shadow: 0 8px 40px var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.login-logo {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    background: var(--input-bg);
    color: var(--text);
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.error-message {
    color: var(--error);
    font-size: 13px;
    text-align: center;
}

/* =================== HEADER =================== */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 8px var(--shadow-color);
}

.header-logo {
    font-size: 22px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Theme switcher */

.theme-switcher {
    display: flex;
    gap: 6px;
    align-items: center;
}

.theme-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    outline: none;
}

.theme-dot:hover {
    transform: scale(1.2);
}

.theme-dot.active {
    border-color: var(--text);
    transform: scale(1.15);
}

.theme-dot[data-theme="obsidian"] {
    background: linear-gradient(135deg, #6366f1, #a78bfa);
}

.theme-dot[data-theme="neon"] {
    background: linear-gradient(135deg, #22d3ee, #a78bfa);
}

.theme-dot[data-theme="ember"] {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

/* =================== MAIN =================== */

.main {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 16px;
}

/* =================== UPLOAD =================== */

.upload-section {
    margin-bottom: 40px;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--surface);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--surface-hover);
    box-shadow: 0 0 24px var(--primary-glow);
}

.drop-zone-icon {
    font-size: 40px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    transition: transform 0.2s ease;
}

.drop-zone:hover .drop-zone-icon {
    transform: scale(1.1);
}

.drop-zone-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.drop-zone-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

.selected-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.upload-options {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.checkbox-label:hover {
    color: var(--text);
}

.select-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.select-group select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    background: var(--input-bg);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s;
}

.select-group select:focus {
    border-color: var(--primary);
}

/* =================== PROGRESS =================== */

.progress {
    margin-top: 16px;
    position: relative;
    height: 32px;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    background-size: 200% 100%;
    transition: width 0.3s ease;
    border-radius: var(--radius-sm);
    animation: shimmer 2s infinite linear;
}

.progress-fill.error {
    background: var(--error);
    animation: none;
}

.progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =================== TRANSCRIPTION LIST =================== */

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.transcriptions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.transcription-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s ease;
}

.transcription-item.clickable {
    cursor: pointer;
}

.transcription-item.clickable:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    box-shadow: 0 2px 12px var(--shadow-color);
}

.item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.item-date {
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

.status-done {
    color: var(--success);
    font-size: 12px;
    font-weight: 600;
}

.status-error {
    color: var(--error);
    font-size: 12px;
    font-weight: 600;
}

.status-processing {
    color: var(--warning);
    font-size: 12px;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 32px;
    font-size: 14px;
}

/* =================== MODAL =================== */

.modal {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
    animation: fadeIn 0.15s ease;
}

.modal-content {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px var(--shadow-lg);
    animation: modalSlideIn 0.2s ease-out;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 10px;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-meta {
    display: flex;
    gap: 16px;
    padding: 0 24px 14px;
    font-size: 13px;
    color: var(--text-secondary);
}

.modal-tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px 14px;
}

.tab {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.tab.active {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 20px;
    min-height: 200px;
}

.result-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.7;
}

.timestamp-segment {
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.6;
}

.timestamp {
    display: inline-block;
    background: var(--primary-glow);
    color: var(--primary-light);
    font-size: 11px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 8px;
}

.timestamp-segment strong {
    color: var(--primary-light);
    margin-right: 4px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

/* =================== ANIMATIONS =================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* =================== THEME OVERRIDES =================== */

/* Obsidian: glassmorphism */
[data-theme="obsidian"] .login-container,
[data-theme="obsidian"] .header,
[data-theme="obsidian"] .drop-zone,
[data-theme="obsidian"] .transcription-item,
[data-theme="obsidian"] .selected-file,
[data-theme="obsidian"] .modal-content {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/* Neon: glow on focus/hover */
[data-theme="neon"] .form-group input:focus {
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15), 0 0 16px rgba(34, 211, 238, 0.1);
}

[data-theme="neon"] .btn-primary {
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.3);
}

[data-theme="neon"] .btn-primary:hover:not(:disabled) {
    box-shadow: 0 0 36px rgba(34, 211, 238, 0.4);
}

/* Ember: gradient borders */
[data-theme="ember"] .login-container {
    border: 1px solid transparent;
    background:
        linear-gradient(#151515, #151515) padding-box,
        linear-gradient(135deg, rgba(245, 158, 11, 0.4), rgba(239, 68, 68, 0.2)) border-box;
}

[data-theme="ember"] .modal-content {
    border: 1px solid transparent;
    background:
        linear-gradient(#151515, #151515) padding-box,
        linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(239, 68, 68, 0.15)) border-box;
}

/* =================== RESPONSIVE =================== */

@media (max-width: 480px) {
    .header {
        padding: 12px 16px;
    }

    .main {
        padding: 20px 12px;
    }

    .drop-zone {
        padding: 32px 16px;
    }

    .upload-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-actions {
        flex-wrap: wrap;
    }

    .theme-switcher {
        gap: 4px;
    }

    .theme-dot {
        width: 14px;
        height: 14px;
    }
}
