:root {
    --bg-main: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --accent-primary: #38bdf8;
    --accent-primary-hover: #0284c7;
    --accent-success: #10b981;
    --accent-success-hover: #059669;
    
    --border-color: #334155;
    
    --font-family: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--accent-primary);
}

.progress-section {
    margin-bottom: 24px;
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
}

.progress-stats {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.progress-bar-container {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.navigation-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: var(--text-muted);
}

select, input, textarea {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px;
    border-radius: 6px;
    font-family: var(--font-family);
    outline: none;
}

select:focus, input:focus, textarea:focus {
    border-color: var(--accent-primary);
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-family: var(--font-family);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-primary-hover);
}

.btn-success {
    background: var(--accent-success);
    color: #fff;
}
.btn-success:hover:not(:disabled) {
    background: var(--accent-success-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.w-full { width: 100%; }

.sidebar-footer {
    margin-top: auto;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: var(--bg-sidebar);
}

.topbar h3 {
    font-size: 1.2rem;
    font-weight: 500;
}

.segments-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* Segment Card */
.segment-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.segment-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.segment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.segment-badge {
    background: var(--accent-primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.segment-original-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
}

.editor-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.editor-col {
    flex: 1;
}

textarea.rsml-editor {
    height: 120px;
    resize: vertical;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
}

.rsml-preview {
    height: 120px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    overflow-y: auto;
    font-family: var(--font-family);
    line-height: 1.6;
}

/* Audio Player */
.audio-player {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0,0,0,0.2);
    padding: 10px 15px;
    border-radius: 8px;
}
.audio-player button {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 1.5rem;
    cursor: pointer;
}
.audio-player input[type="range"] {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    appearance: none;
    border-radius: 2px;
    padding: 0;
    border: none;
}
.audio-player input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
}
.time-display {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 80px;
    text-align: right;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal.active { display: flex; }
.modal-content {
    background: var(--bg-sidebar);
    width: 500px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-body {
    padding: 20px;
}
kbd {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}
.shortcut-item {
    margin-bottom: 10px;
}
.shortcut-item span {
    margin-left: 10px;
    color: var(--text-muted);
}
.rsml-tags-guide p {
    margin-bottom: 8px;
    color: var(--text-muted);
}
.rsml-tags-guide code {
    background: rgba(0,0,0,0.3);
    padding: 2px 5px;
    border-radius: 4px;
    color: var(--accent-primary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: -100px;
    right: 30px;
    background: var(--accent-success);
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: bottom 0.3s ease;
    z-index: 2000;
}
.toast.show {
    bottom: 30px;
}

/* RSML Rendering Styles */
.rsml-tag-noise { color: #f43f5e; font-weight: 500; }
.rsml-tag-entity { color: #a855f7; font-weight: 500; }
.rsml-tag-codemix { color: #eab308; font-weight: 500; }
.rsml-tag-mispronunciation { color: #f97316; font-weight: 500; }
