:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #7c8ff5;
    --secondary-color: #764ba2;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-hover: linear-gradient(135deg, #5568d3 0%, #653a8a 100%);
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    
    --success: #48bb78;
    --error: #f56565;
    --warning: #ed8936;
    --info: #4299e1;
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Main Content */
.main-content {
    padding: 40px 0 80px;
}

/* Card */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Upload Section */
.upload-section {
    overflow: visible;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 60px 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
}

.upload-area svg {
    color: var(--text-tertiary);
    margin-bottom: 16px;
    flex-shrink: 0;
}

.upload-area h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    word-wrap: break-word;
    max-width: 100%;
}

.upload-area p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 4px 0;
    word-wrap: break-word;
    max-width: 100%;
}

.upload-info {
    margin-top: 12px;
    font-size: 12px !important;
    color: var(--text-tertiary) !important;
    word-wrap: break-word;
    max-width: 100%;
}

/* File Info */
.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.file-details {
    display: flex;
    align-items: center;
    gap: 16px;
}

.file-details svg {
    color: var(--primary-color);
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.file-size {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Form Controls */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-control {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control:disabled {
    background: var(--bg-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-group small {
    font-size: 12px;
    color: var(--text-tertiary);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Range Input */
.form-range {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
}

.form-range::-webkit-slider-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    border: none;
    transition: var(--transition);
}

.form-range::-moz-range-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* Toggle Switch */
.feature-toggles {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: var(--transition);
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background: var(--gradient);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.toggle-content {
    flex: 1;
}

.toggle-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.toggle-description {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-text, .btn-icon {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: var(--gradient-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

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

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

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.btn-text {
    background: transparent;
    color: var(--primary-color);
    padding: 8px 16px;
}

.btn-text:hover {
    background: rgba(102, 126, 234, 0.1);
}

.btn-icon {
    padding: 8px;
    background: transparent;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--error);
}

.btn-large {
    padding: 16px 48px;
    font-size: 16px;
}

/* Advanced Settings */
.advanced-settings {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tabs */
.settings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

/* Action Section */
.action-section {
    display: flex;
    justify-content: center;
    margin: 32px 0;
}

/* Progress Section */
.progress-section {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.progress-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    width: 0%;
    transition: width 0.3s ease-out;
}

.progress-text {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

/* Results Section */
.result-actions {
    display: flex;
    gap: 12px;
}

/* Speaker Manager */
.speaker-manager {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.speaker-manager h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.speaker-help-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.speaker-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.speaker-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.speaker-item:hover {
    background: var(--bg-tertiary);
}

.speaker-item label {
    min-width: 120px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.speaker-rename-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.speaker-rename-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#applySpeakerChanges {
    width: auto;
    padding: 10px 24px;
}

/* Debug Panel */
.debug-panel {
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.debug-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.debug-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.debug-toggle > span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.debug-toggle .chevron {
    transition: transform 0.3s ease;
}

.debug-toggle.active .chevron {
    transform: rotate(180deg);
}

.debug-content {
    background: #1e1e1e;
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
}

.debug-section {
    margin-bottom: 20px;
}

.debug-section:last-child {
    margin-bottom: 0;
}

.debug-section h4 {
    color: #61dafb;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    font-family: 'Monaco', 'Courier New', monospace;
}

.debug-output {
    background: #0d1117;
    color: #c9d1d9;
    padding: 12px;
    border-radius: 6px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    border: 1px solid #30363d;
}

.debug-output::-webkit-scrollbar {
    height: 8px;
}

.debug-output::-webkit-scrollbar-track {
    background: #0d1117;
}

.debug-output::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

.debug-output::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

.result-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 24px;
    max-height: 600px;
    overflow-y: auto;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.result-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.transcript-segment {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.transcript-segment:last-child {
    border-bottom: none;
}

/* Active segment highlighting when audio is playing */
.transcript-segment.active-segment {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    border-left: 4px solid var(--primary-color);
    padding-left: 16px;
    margin-left: -20px;
    padding-right: 16px;
    margin-right: -20px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: scale(1.01);
}

.segment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.segment-speaker {
    font-weight: 600;
    color: var(--primary-color);
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(102, 126, 234, 0.08);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.segment-speaker:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.segment-speaker:active {
    transform: translateY(0);
}

.segment-speaker-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.btn-speaker-edit {
    background: rgba(102, 126, 234, 0.1);
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--primary-color);
    opacity: 0;
    pointer-events: none;
}

.segment-speaker-container:hover .btn-speaker-edit {
    opacity: 1;
    pointer-events: auto;
}

.btn-speaker-edit:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.btn-speaker-edit:active {
    transform: scale(0.95);
}

.speaker-name {
    font-weight: 700;
    position: relative;
}

.speaker-name::after {
    content: '✏️';
    font-size: 10px;
    margin-left: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.segment-speaker:hover .speaker-name::after {
    opacity: 1;
}

.segment-time {
    font-family: 'Monaco', monospace;
}

.segment-text {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.8;
}

/* Audio Player */
.audio-player-container {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

/* Custom Audio Player */
.custom-audio-player {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    padding: 16px 20px;
    border-radius: var(--radius-md);
}

.audio-btn {
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: white;
    flex-shrink: 0;
}

.audio-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.audio-btn:active {
    transform: scale(0.95);
}

.audio-time {
    font-family: 'Monaco', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 45px;
    text-align: center;
    flex-shrink: 0;
}

.audio-seek-container {
    flex: 1;
    position: relative;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
}

.audio-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #dc2626;
    border-radius: 10px;
    width: 0%;
    transition: width 0.1s linear;
    pointer-events: none;
}

.audio-seek {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 8px;
    margin: 0;
    cursor: pointer;
    opacity: 0;
    z-index: 2;
}

.audio-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #dc2626;
    border-radius: 50%;
    cursor: pointer;
    opacity: 1;
}

.audio-seek::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #dc2626;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.audio-seek:hover::-webkit-slider-thumb {
    background: #b91c1c;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.5);
}

.audio-seek:hover::-moz-range-thumb {
    background: #b91c1c;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.5);
}

.audio-volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.audio-volume-container .audio-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    color: var(--text-secondary);
}

.audio-volume-container .audio-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.audio-volume {
    width: 80px;
    height: 4px;
    border-radius: 10px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.audio-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.audio-volume::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* Hide native audio player */
#audioPlayer {
    display: none;
}

/* Editable Segments */
.segments-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.editable-segment {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.editable-segment:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

/* Active segment highlight (when audio is playing) */
.editable-segment.active-segment {
    border-color: #dc2626;
    background: linear-gradient(to right, rgba(220, 38, 38, 0.05) 0%, transparent 100%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
    transform: scale(1.01);
}

.editable-segment.active-segment::before {
    content: '▶';
    position: absolute;
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
    color: #dc2626;
    font-size: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translateY(-50%) scale(1.1);
    }
}

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

.segment-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.segment-number {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
}

.segment-speaker {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 13px;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
}

.segment-time {
    font-family: 'Monaco', monospace;
    font-size: 11px;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.segment-time:hover {
    background: var(--primary-light);
    color: white;
}

.btn-icon-small {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-small:hover {
    background: var(--bg-tertiary);
    color: var(--error);
}

.segment-content {
    width: 100%;
}

.segment-editor {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    resize: vertical;
    min-height: 50px;
    transition: var(--transition);
}

.segment-editor:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Editable Content */
.editable-content {
    width: 100%;
}

.transcript-editor {
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    background: var(--bg-secondary);
    resize: vertical;
    min-height: 400px;
    transition: var(--transition);
}

.transcript-editor:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Speaker Management Panel */
.speaker-panel {
    background: linear-gradient(135deg, #f8f9ff 0%, #fef5ff 100%);
    border: 2px solid #e0e7ff;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.speaker-panel-header {
    margin-bottom: 20px;
}

.speaker-panel-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.speaker-panel-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.speaker-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.speaker-item {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.speaker-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.speaker-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

/* Speaker colors */
.speaker-color-1 .speaker-icon { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.speaker-color-2 .speaker-icon { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.speaker-color-3 .speaker-icon { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.speaker-color-4 .speaker-icon { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.speaker-color-5 .speaker-icon { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.speaker-color-6 .speaker-icon { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }

.speaker-info {
    flex: 1;
    min-width: 0;
}

.speaker-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.speaker-label strong {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.speaker-label small {
    color: var(--text-tertiary);
    font-size: 11px;
    font-family: 'Monaco', monospace;
}

.speaker-rename-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.speaker-rename-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.speaker-rename-input::placeholder {
    color: var(--text-tertiary);
    font-size: 12px;
}

/* Animation for deletion */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .nav {
        display: none;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .upload-area h3 {
        font-size: 18px;
        line-height: 1.4;
    }
    
    .upload-area p {
        font-size: 13px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 20px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .result-actions {
        flex-direction: column;
        width: 100%;
    }
}

/* Speaker Rename Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 32px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition);
    line-height: 1;
}

.btn-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    margin: 0 0 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-body p strong {
    color: var(--primary-color);
    font-weight: 600;
}

.modal-question {
    font-weight: 600;
    color: var(--text-primary) !important;
    margin-top: 24px !important;
    margin-bottom: 16px !important;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-actions .btn {
    justify-content: center;
    font-weight: 500;
}

.btn-text {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    text-align: center;
}

.btn-text:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}    .result-actions button {
        width: 100%;
    }
    
    .settings-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        white-space: nowrap;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Selection */
::selection {
    background: rgba(102, 126, 234, 0.2);
    color: var(--text-primary);
}
