/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* App Layout */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.setup-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.setup-link:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Main Content Layout */
.main-content {
    display: flex;
    flex: 1;
    height: calc(100vh - 80px);
}

/* Audio Panel */
.audio-panel {
    width: 500px;
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.audio-panel h3 {
    margin-bottom: 1rem;
    color: #555;
    font-size: 1.25rem;
}

.audio-panel h4 {
    margin-bottom: 0.75rem;
    color: #666;
    font-size: 1rem;
    font-weight: 600;
}

/* Upload Section */
.upload-section {
    padding: 1rem;
    border: 2px dashed #ddd;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.upload-section:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.file-input {
    display: none;
}

.upload-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.upload-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.upload-status {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #666;
}

/* Audio Player */
.player-section {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.audio-player {
    width: 100%;
    margin-bottom: 1.5rem;
    height: 54px;
}

.audio-player::-webkit-media-controls-timeline {
    padding: 0 8px;
}

.playback-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: #666;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.playback-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.skip-controls {
    display: flex;
    gap: 0.25rem;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 0.25rem;
    border: 1px solid #e9ecef;
}

.control-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.skip-btn {
    background: white;
    border-color: #dee2e6;
    font-weight: 500;
    min-width: 65px;
    font-size: 0.75rem;
}

.skip-btn:hover {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.speed-control select {
    padding: 0.25rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Speaker Management in Audio Panel */
.speaker-management {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.speaker-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.speaker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.speaker-item:hover {
    background-color: #f8f9fa;
    border-color: #667eea;
}

.speaker-item.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.speaker-info {
    cursor: pointer;
    flex: 1;
}

.speaker-name {
    font-weight: 500;
}

.speaker-stats {
    font-size: 0.8rem;
    opacity: 0.8;
}

.speaker-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.speaker-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.delete-speaker-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.delete-speaker-btn:hover {
    opacity: 1;
    background: #c82333;
    transform: scale(1.1);
}

.edit-speaker-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: #007acc;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.edit-speaker-btn:hover {
    opacity: 1;
    background: #005a9e;
    transform: scale(1.1);
}

.editable-speaker-name:hover {
    background-color: rgba(0, 122, 204, 0.1);
    border-radius: 3px;
    padding: 2px 4px;
    margin: -2px -4px;
}

.speaker-name-input {
    font-family: inherit !important;
    color: inherit !important;
    background: white !important;
    border: 1px solid #007acc !important;
    outline: none !important;
}

/* Transcript Container */
.transcript-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
}

.transcript-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transcript-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.transcript-header h2 {
    color: #333;
    font-size: 1.25rem;
    margin: 0;
}

.transcript-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.transcript-controls {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* Undo/Redo Controls */
.undo-redo-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.undo-btn, .redo-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #495057;
    min-width: 70px;
}

.undo-btn:hover {
    background: #28a745;
    color: white;
    border-color: #28a745;
    transform: translateY(-1px);
}

.redo-btn:hover {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
    transform: translateY(-1px);
}

.undo-btn:disabled, .redo-btn:disabled {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #e9ecef;
    cursor: not-allowed;
    transform: none;
}

/* Speaker Filter */
.speaker-filter {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.speaker-filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 150px;
}

.speaker-filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.speaker-filter-select:hover {
    border-color: #667eea;
}

/* Compact Search Widget */
.search-widget {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.search-input-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.search-input-compact {
    width: 200px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.search-input-compact:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
    width: 250px;
}

.search-nav-compact {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.search-count-compact {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
    min-width: 60px;
    text-align: right;
}

.search-btn-compact {
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s ease;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn-compact:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.search-btn-compact:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.search-btn-compact:disabled:hover {
    background: white;
    color: inherit;
    border-color: #dee2e6;
}

.search-btn-compact.clear-btn {
    background: #f8f9fa;
    color: #6c757d;
}

.search-btn-compact.clear-btn:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.transcript-content {
    flex: 1;
    padding: 1rem 2rem;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Transcript Segments */
.segment {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    position: relative;
}

.segment:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.segment.selected {
    box-shadow: 0 0 0 2px #667eea;
}

.segment.playing {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0.05) 100%);
    border-left-width: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
    50% { box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2); }
    100% { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
}

.segment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    cursor: pointer;
}

.segment-left-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.segment-checkbox {
    transform: scale(1.2);
    cursor: pointer;
}

.segment-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.speaker-dropdown {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    border: 1px solid #ddd;
    background-color: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.speaker-dropdown.compact {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    min-width: 100px;
    border-radius: 16px;
}

.speaker-dropdown:hover {
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.speaker-dropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.timestamp-range {
    font-size: 0.8rem;
    color: #666;
    font-family: 'Courier New', monospace;
    display: flex;
    align-items: center;
    gap: 2px;
}

.editable-timestamp {
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.editable-timestamp:hover {
    background-color: #f0f8ff;
    border-color: #007acc;
    color: #007acc;
}

.timestamp-separator {
    color: #999;
    font-weight: normal;
}

.timestamp-input {
    font-family: 'Courier New', monospace !important;
    font-size: 0.8rem !important;
    text-align: center;
    min-width: 80px;
    box-sizing: border-box;
}

.segment-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.segment:hover .segment-actions {
    opacity: 1;
}

.segment-actions .delete-btn {
    opacity: 0.6;
}

.segment:hover .segment-actions .delete-btn {
    opacity: 1;
}

.segment-text {
    font-size: 1rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 1.7rem;
    outline: none;
    cursor: text;
    border-radius: 4px;
    padding: 0.25rem;
    transition: background-color 0.2s ease;
}

.segment-text:focus {
    background-color: #f8f9ff;
    box-shadow: inset 0 0 0 1px #667eea;
}

/* Inline Merge Button */
.inline-merge-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.segment:hover .inline-merge-btn {
    opacity: 1;
}

.inline-merge-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: scale(1.1);
}

.inline-merge-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.inline-merge-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: #dee2e6;
    color: inherit;
    transform: none;
}

/* Search Highlighting */
.search-highlight {
    background-color: #fff3cd;
    border: 1px solid #ffd60a;
    border-radius: 3px;
    padding: 0.1rem 0.2rem;
    margin: 0 0.1rem;
    font-weight: 500;
}

.search-highlight.current {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

/* Speaker Colors */
.segment[data-speaker="SPEAKER_00"] { border-left-color: #667eea; }
.segment[data-speaker="SPEAKER_01"] { border-left-color: #f093fb; }
.segment[data-speaker="SPEAKER_02"] { border-left-color: #4facfe; }
.segment[data-speaker="SPEAKER_03"] { border-left-color: #43e97b; }
.segment[data-speaker="SPEAKER_04"] { border-left-color: #fa709a; }
.segment[data-speaker="SPEAKER_05"] { border-left-color: #ffecd2; }
.segment[data-speaker="UNKNOWN"] { 
    border-left-color: #ffc107; 
    background-color: rgba(255, 193, 7, 0.05);
}

/* Contextual Toolbar */
.contextual-toolbar {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    z-index: 1000;
}

.contextual-toolbar.hidden {
    opacity: 0;
    pointer-events: none;
}

.toolbar-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: #667eea;
    color: white;
}

.toolbar-btn.delete-btn {
    background: #fff;
    color: #dc3545;
    border: 1px solid #f5c6cb;
    padding: 0.3rem 0.5rem;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 4px;
    min-width: auto;
}

.toolbar-btn.delete-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Buttons */
.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 1px solid #667eea;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: all 0.2s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    min-width: 400px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.speaker-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.speaker-option {
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.speaker-option:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.speaker-option.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.modal-actions input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: translateX(100%);
    animation: slideIn 0.3s ease forwards;
    min-width: 300px;
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.toast.warning {
    background: #ffc107;
    color: #333;
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .audio-panel {
        width: 100%;
        height: auto;
        max-height: 350px;
        gap: 1rem;
    }
    
    .app-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .segment {
        padding: 1rem;
    }
    
    .inline-merge-btn {
        width: 36px;
        height: 36px;
        opacity: 0.8;
        font-size: 18px;
    }
    
    .segment:hover .inline-merge-btn {
        opacity: 1;
    }
    
    .transcript-content {
        padding: 1rem;
    }
    
    .transcript-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .transcript-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .speaker-filter-select {
        min-width: 100%;
    }
    
    .search-widget {
        align-items: stretch;
    }
    
    .search-input-compact {
        width: 100%;
    }
    
    .search-input-compact:focus {
        width: 100%;
    }
    
    .search-nav-compact {
        justify-content: space-between;
    }
    
    .playback-controls {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .skip-controls {
        justify-content: center;
    }
    
    .control-btn {
        flex: 1;
        min-width: 0;
    }
}

/* Medium screens - adjust for wider audio panel */
@media (max-width: 1200px) and (min-width: 769px) {
    .audio-panel {
        width: 450px;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .audio-panel {
        width: 400px;
    }
}

/* Segment Tools Panel */
.segment-tools {
    position: fixed;
    top: 80px;
    right: 0;
    width: 280px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.segment-tools.expanded {
    transform: translateX(0);
}

.tools-header {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tools-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.toggle-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background: #5a67d8;
    transform: scale(1.05);
}

.tools-content {
    padding: 1rem;
}

.tool-section {
    margin-bottom: 1.5rem;
}

.tool-section h4 {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tool-buttons, .split-options, .merge-options, .batch-operations {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

.tool-btn.danger {
    color: #dc3545;
    border-color: #dc3545;
}

.tool-btn.danger:hover {
    background: #dc3545;
    color: white;
}

.batch-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

/* Selected segments styling */
.segment.selected-bulk {
    border-left: 4px solid #28a745;
    background: #f8fff9;
}

.segment.selected-bulk .segment-header {
    background: #e8f8ea;
}

/* Multi-selection counter */
.selection-counter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 25px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    z-index: 1001;
    animation: slideUp 0.3s ease;
}

.selection-counter.hidden {
    display: none;
}

/* Modal form styles */
.modal-form {
    margin: 1rem 0;
}

.modal-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.modal-form input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-help {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.speaker-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

.speaker-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.speaker-checkbox:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.speaker-checkbox input[type="checkbox"] {
    margin: 0;
}

.speaker-checkbox .speaker-info {
    flex: 1;
}

.speaker-checkbox .speaker-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.speaker-checkbox .speaker-stats {
    font-size: 0.8rem;
    color: #666;
}

.speaker-checkbox .speaker-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Animations */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes progressAnimation {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Progress Bar for API Transcription */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.animating {
    animation: progressAnimation 3s ease-in-out infinite;
    background: linear-gradient(
        90deg,
        #667eea 0%,
        #764ba2 25%,
        #667eea 50%,
        #764ba2 75%,
        #667eea 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

.upload-status code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    color: #e83e8c;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}