/* TTS/STT Dataset Builder - Modern UI */

/* ============== CSS Variables ============== */
:root {
    /* Color palette - Slate & Emerald */
    --color-bg-primary: #0f172a;
    --color-bg-secondary: #1e293b;
    --color-bg-tertiary: #334155;
    --color-bg-card: #1e293b;
    --color-accent: #10b981;
    --color-accent-light: #34d399;
    --color-accent-dark: #059669;
    --color-text-primary: #f1f5f9;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;
    --color-success: #22c55e;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;
    
    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-bg: #0f172a;
    
    /* Typography */
    --font-display: 'Crimson Pro', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.3);
}

/* ============== Base Styles ============== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ============== App Layout with Sidebar ============== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ============== Sidebar ============== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text-primary);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
}

.sidebar-brand svg {
    color: var(--color-accent);
}

.sidebar-section {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.sidebar-select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    cursor: pointer;
}

.sidebar-select:focus {
    outline: none;
    border-color: var(--color-accent);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md) 0;
    overflow-y: auto;
}

.nav-section {
    padding: var(--space-sm) var(--space-lg);
}

.nav-section-title {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
    padding-left: var(--space-sm);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    margin: 2px 0;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
}

.nav-item.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-accent);
}

.nav-item.active .nav-icon {
    color: var(--color-accent);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    position: sticky;
    bottom: 0;
}

/* ============== Main Content ============== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--space-xl);
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-secondary) 100%);
}

/* ============== Page Header ============== */
.page-header {
    margin-bottom: var(--space-xl);
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.page-header p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ============== Typography ============== */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-accent-light);
}

/* ============== Cards ============== */
.card {
    background: var(--color-bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--color-text-primary);
}

/* ============== Buttons ============== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
}

.btn-outline:hover {
    background: rgba(16, 185, 129, 0.1);
}

.btn-danger {
    background: var(--color-error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8rem;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
}

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

/* ============== Forms ============== */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.form-control {
    width: 100%;
    padding: var(--space-md);
    background: var(--color-bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.form-control::placeholder {
    color: var(--color-text-muted);
}

select.form-control {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-accent);
    cursor: pointer;
}

/* ============== File Explorer ============== */
.file-explorer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.file-panel {
    background: var(--color-bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.file-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--color-bg-tertiary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.file-panel-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    font-size: 0.9rem;
}

.file-panel-title svg {
    width: 20px;
    height: 20px;
    color: var(--color-accent);
}

.file-list {
    max-height: 400px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.file-item:last-child {
    border-bottom: none;
}

.file-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    min-width: 0;
}

.file-icon {
    width: 32px;
    height: 32px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon svg {
    width: 16px;
    height: 16px;
    color: var(--color-accent);
}

.file-name {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.file-actions {
    display: flex;
    gap: var(--space-xs);
}

.file-empty {
    padding: var(--space-2xl);
    text-align: center;
    color: var(--color-text-muted);
}

.file-checkbox {
    margin-right: var(--space-sm);
}

/* ============== Upload Zone ============== */
.upload-zone {
    border: 2px dashed rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(16, 185, 129, 0.02);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--color-accent);
    background: rgba(16, 185, 129, 0.08);
}

.upload-zone svg {
    width: 48px;
    height: 48px;
    color: var(--color-accent);
    margin-bottom: var(--space-md);
}

.upload-zone h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
}

.upload-zone p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* ============== Tables ============== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

th {
    background: var(--color-bg-tertiary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
}

tr:hover {
    background: rgba(16, 185, 129, 0.03);
}

/* Text cells - expandable */
.text-cell {
    position: relative;
}

.text-content {
    transition: all 0.2s ease;
}

.text-content.collapsed {
    max-width: 300px;
    max-height: 2.4em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-content.expanded {
    max-width: none;
    max-height: none;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--color-bg-tertiary);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    position: relative;
    z-index: 10;
}

.text-cell:hover .text-content.collapsed::after {
    content: '(click to expand)';
    color: var(--color-accent);
    font-size: 0.75rem;
    margin-left: var(--space-sm);
}

/* Full text display in tables */
.table-full-text td {
    white-space: normal;
    word-break: break-word;
}

.text-wrap {
    white-space: normal !important;
    word-break: break-word;
    max-width: none !important;
}

/* Range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--color-bg-tertiary);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    border: 2px solid var(--color-bg-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    border: 2px solid var(--color-bg-primary);
}

input[type="range"]:hover::-webkit-slider-thumb {
    transform: scale(1.1);
}

input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

/* ============== Modal ============== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    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 content - supports both .modal and .modal-content as child */
.modal-overlay > .modal,
.modal-overlay > .modal-content,
.modal.active > .modal-content {
    background: var(--color-bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active > .modal,
.modal-overlay.active > .modal-content,
.modal.active > .modal-content {
    transform: translateY(0);
}

/* Standalone modal (used for download dialogs etc.) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: var(--space-sm);
}

.modal-close:hover {
    color: var(--color-text-primary);
}

/* ============== Alerts ============== */
.alert-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 1001;
    max-width: 400px;
}

.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    box-shadow: var(--shadow-lg);
}

.alert-success {
    background: rgba(34, 197, 94, 0.9);
    color: white;
}

.alert-error {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.9);
    color: white;
}

.alert-info {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

/* ============== Badges ============== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--color-warning);
}

.badge-processing {
    background: rgba(59, 130, 246, 0.2);
    color: var(--color-info);
}

.badge-completed {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-success);
}

.badge-failed {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-error);
}

.badge-tts {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.badge-stt {
    background: rgba(59, 130, 246, 0.2);
    color: var(--color-info);
}

/* ============== Progress ============== */
.progress {
    height: 8px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-success) 100%);
    border-radius: var(--radius-sm);
    transition: width 0.3s ease;
}

/* ============== Stats Grid ============== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--color-bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
    font-family: var(--font-display);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: var(--space-xs);
}

/* ============== Voice Recorder ============== */
.recorder-container {
    text-align: center;
    padding: var(--space-2xl);
}

.sentence-display {
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    font-size: 1.3rem;
    line-height: 1.8;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.record-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--color-error);
    border: 4px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.record-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
}

.record-btn.recording {
    animation: pulse-record 1s ease-in-out infinite;
}

@keyframes pulse-record {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(239, 68, 68, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 0 40px rgba(239, 68, 68, 0.7); }
}

.record-btn svg {
    width: 40px;
    height: 40px;
    color: white;
}

.recorder-controls {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.recorder-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

/* ============== Waveform ============== */
.waveform-container {
    height: 80px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    margin: var(--space-lg) 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ============== Auth Pages ============== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-secondary) 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
}

.auth-header p {
    color: var(--color-text-muted);
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.auth-logo svg {
    color: var(--color-accent);
    width: 56px;
    height: 56px;
}

/* ============== Grid Layouts ============== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ============== Utilities ============== */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { justify-content: center; align-items: center; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.w-full { width: 100%; }
.hidden { display: none !important; }

code {
    font-family: var(--font-mono);
    background: var(--color-bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.85em;
}

small, .text-small {
    font-size: 0.8rem;
}

/* ============== Animations ============== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-bg-tertiary);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* ============== Responsive ============== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .file-explorer {
        grid-template-columns: 1fr;
    }
}
