.timeline-container-wrapper {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
}
.timeline-bar {
    position: relative;
    width: 100%;
    background-color: #e0e0e0; /* Light grey for the base bar */
    border-radius: 5px;
    margin-top: 5px;
    overflow: hidden;
}
#originalVideoTimelineBar {
    height: 50px; /* Taller for interaction */
}
#editedSequenceTimelineBar {
    height: 60px; /* Taller for interaction and labels */
    display: flex; /* For horizontal layout of sequence blocks */
    align-items: stretch; /* Make blocks fill height */
}

.source-segment-block {
    position: absolute;
    height: 100%;
    background-color: rgba(76, 175, 80, 0.5); /* Semi-transparent Green */
    border: 1px solid rgba(56, 142, 60, 0.7);
    box-sizing: border-box;
    cursor: move; /* Default to move, handles will override */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #333;
    overflow: hidden;
    white-space: nowrap;
}
.source-segment-block.highlighted-source {
    background-color: rgba(255, 193, 7, 0.6); /* Semi-transparent Yellow for preview */
    border-color: rgba(255, 160, 0, 0.8);
    z-index: 10;
}
.source-segment-block.manually-active-source {
    background-color: rgba(255, 152, 0, 0.7); /* Semi-transparent Orange for manual click */
    border-color: rgba(230, 81, 0, 0.9);
    z-index: 11; /* Higher than preview highlight */
}
.resize-handle {
    position: absolute;
    width: 10px; /* Wider for easier grabbing */
    height: 100%;
    top: 0;
    background-color: rgba(0,0,0,0.2);
    z-index: 15;
    cursor: ew-resize;
}
.resize-handle-left { left: 0; }
.resize-handle-right { right: 0; }


.sequence-block {
    /* width will be proportional to duration */
    height: 100%;
    background-color: #2196F3; /* Blue for sequence blocks */
    border: 1px solid #1976D2;
    margin-right: 2px; /* Spacing between blocks */
    box-sizing: border-box;
    display: flex;
    flex-direction: column; /* Stack text and index */
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    cursor: grab;
    overflow: hidden;
    padding: 2px;
    text-align: center;
    position: relative; /* For absolute positioning of playhead marker */
}
.sequence-block.playing-in-sequence {
    outline: 3px solid red;
    outline-offset: -3px;
    /* background-color: #F44336; Red when playing */
}
.sequence-block.manually-active-sequence {
    outline: 3px solid #FF9800; /* Orange for manual click */
    outline-offset: -3px;
}
.sequence-block.selected {
    opacity: 0.75;
    outline: 3px solid #60a5fa; /* Tailwind blue-400 for selection */
    outline-offset: -3px;
}
.sequence-block.dragging {
    opacity: 0.6;
    cursor: grabbing;
}
.sequence-block-index {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 2px;
}
.sequence-block-time {
    font-size: 9px;
}
#toastNotification {
    position: fixed;    /* Position relative to the viewport */
    top: calc(1.5rem + 50px); /* Moved down by an additional 50px */
    right: 1.5rem;       /* Position from the right of the container (e.g., matching p-6 padding) */
    width: auto;         /* Allow width to be determined by content, up to max-width */
    max-width: calc(100vw - 3rem); /* Max width ensuring 1.5rem margin on left and right of viewport */
    min-width: 160px;    /* Reduced min-width to prevent overflow on very small screens */
    box-sizing: border-box;
    background-color: #2d3748; /* gray-800 */
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 0.375rem; /* rounded-md */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    opacity: 0; /* 初始透明，使其不可见 */
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    z-index: 100; /* Ensure it's above most content */
    transform: translateY(-100%); /* 初始位置在屏幕上方，使其不可见 */
}
#toastNotification.show { /* 这个类用于触发显示动画 */
    opacity: 1; /* 完全可见 */
    transform: translateY(0); /* 移动到其在屏幕上的最终位置 */
}

/* Action Button Group - Bottom Right */
.action-button-group {
    position: fixed;
    bottom: 1rem; /* 16px */
    right: 1rem; /* 16px */
    display: flex;
    flex-direction: column;
    gap: 0.6rem; /* Slightly increased gap */
    z-index: 50; /* Ensure it's above most content but below modals/toast */
}

/* Common styling for the new icon buttons */
.action-button {
    width: 44px; /* Fixed size for circular button */
    height: 44px; /* Fixed size */
    display: flex; /* Use flexbox to center icon */
    align-items: center;
    justify-content: center;
    border-radius: 50%; /* Make it circular */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); /* shadow-md */
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out, box-shadow 0.2s ease-in-out;
}
.action-button:hover {
    transform: scale(1.1); /* Slightly larger scale on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* More prominent shadow on hover */
}
.action-button:active {
    transform: scale(0.95); /* Press effect */
}
/* Disabled state styling */
.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background-color: #9ca3af !important; /* gray-400 for disabled state, !important to override tailwind/inline potentially */
}
/* Ensure SVG inside button is sized correctly */
.action-button svg { width: 24px; height: 24px; } /* Adjusted from w-6 h-6 */

.drop-zone-active { border-color: #2563eb; }

#videoPlayer {
    width: 100%;
    background-color: #000; /* Background for letterboxing */
}
#videoPlayer.fit-contain {
    object-fit: contain;
    max-height: 400px; 
}
#videoPlayer.fit-cover {
    object-fit: cover;
    height: 400px; /* Fixed height for cover to ensure consistency */
}

/* Timeline zoom controls */
.timeline-zoom-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.zoom-btn {
    width: 24px;
    height: 24px;
    background-color: #e0e0e0;
    border: 1px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.zoom-btn:hover {
    background-color: #d0d0d0;
}

/* Timeline scroll container */
.timeline-scroll-container {
    overflow-x: auto;
    position: relative;
    width: 100%;
    margin-top: 5px;
}

/* For zoomed timeline */
#originalVideoTimelineBar.zoomed {
    min-width: 100%;
    transition: width 0.3s ease;
}

/* Cursor styles for panning */
.timeline-scroll-container.panning {
    cursor: grabbing;
}

#originalVideoTimelineBar.panning {
    cursor: grabbing;
}

/* Tab styling */
.tab-button {
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-button.active {
    border-bottom: 2px solid #4f46e5;
    color: #4f46e5;
    font-weight: 600;
}

.tab-content {
    display: block;
}

.tab-content.hidden {
    display: none;
}

/* Collapsible sections for text editor */
.collapsible-section {
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.collapsible-header {
    background-color: #f9fafb;
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapsible-content.expanded {
    max-height: 1000px;
}

/* Processing status animation */
@keyframes progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.progress-animated {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 30%, #93c5fd 50%, #3b82f6 70%);
  background-size: 200% 100%;
  animation: progressBarMove 1.2s linear infinite;
}

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

/* Media file info styling */
#mediaFileInfo {
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 0.375rem;
    padding: 0.5rem;
}

/* Processing status styling */
#processingStatus {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Textarea with content styling */
textarea:not(:placeholder-shown) {
    border-color: #4f46e5;
}

/* Responsive adjustments for small screens */
@media (max-width: 640px) {
    .tab-button {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .action-button-group {
        bottom: 0.5rem;
        right: 0.5rem;
    }
    
    .action-button {
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* Styling for the cycle JSON version button */
#cycleJsonVersionBtn {
    position: relative;
}

#cycleJsonVersionBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Styling for the SRT editor */
#srtEditor {
    font-family: monospace;
    white-space: pre-wrap;
}

/* Styling for JSON output */
#reorderedJsonOutput {
    font-family: monospace;
    white-space: pre-wrap;
}

/* Prompt Editor Modal Styles */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

.hidden {
    display: none;
}

/* Prompt Tab Buttons */
.prompt-tab-button {
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.prompt-tab-button.active {
    border-bottom: 2px solid #4f46e5;
    color: #4f46e5;
}

/* System Role Display */
#systemRoleDisplay {
    white-space: pre-wrap;
    font-family: monospace;
}

/* Prompt Template Editor */
#promptTemplateEditor {
    font-family: monospace;
    resize: vertical;
    min-height: 200px;
}
