/* Hazard Video Editor Layout */
.video-editor-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1400px) {
    .video-editor-layout {
        grid-template-columns: 1fr 380px;
    }
}

@media (max-width: 1200px) {
    .video-editor-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .clip-editor-sidebar {
        order: -1;
    }
}

/* Main Video Editor Area */
.video-editor-main {
    min-width: 0; /* Allow shrinking */
}

/* Hazard Video Editor Styles */
.video-editor-container {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* Video Display Area */
.video-display-area {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 24px;
    position: relative;
    border-bottom: 1px solid #e5e7eb;
}

.video-display-wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-editor-player {
    width: 100%;
    height: 100%;
    background: #000;
    display: block;
    object-fit: contain;
}

.video-overlay-info {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.video-info-badge {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.video-editor-controls {
    background: #1a1a1a;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #2a2a2a;
}

.video-editor-controls button {
    background: #3a3a3a;
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.video-editor-controls button:hover {
    background: #4a4a4a;
}

.video-editor-controls button:active {
    background: #5a5a5a;
}

.video-editor-controls button.play-pause {
    background: #2563eb;
    padding: 10px 20px;
}

.video-editor-controls button.play-pause:hover {
    background: #1d4ed8;
}

/* Timeline Styles */
.timeline-container {
    background: #000;
    padding: 20px 16px;
    border-top: 1px solid #2a2a2a;
    position: relative;
}

.timeline-track {
    position: relative;
    height: 80px;
    background: #000;
    cursor: pointer;
    margin-bottom: 0;
    overflow: visible;
    padding-top: 60px; /* Space for dotted lines above clips */
}

.timeline-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(37, 99, 235, 0.3);
    width: 0%;
    pointer-events: none;
    transition: width 0.1s linear;
}

.timeline-clips {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.timeline-clip {
    position: absolute;
    top: 20px;
    height: 40px;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    border: 2px solid #2563eb;
    border-radius: 8px;
    cursor: move;
    pointer-events: all;
    transition: box-shadow 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4), 0 0 0 0 rgba(37, 99, 235, 0);
    z-index: 10;
    user-select: none;
}

.timeline-clip.dragging {
    cursor: grabbing !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.6), 0 0 0 2px rgba(37, 99, 235, 0.5);
    transform: scaleY(1.15);
    z-index: 30;
}

.timeline-clip.resizing {
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.6), 0 0 0 2px rgba(37, 99, 235, 0.5);
    z-index: 30;
}

/* Remove the old center marker - we'll use start/end markers instead */
.timeline-clip::before {
    display: none;
}

.timeline-clip:hover {
    transform: scaleY(1.1);
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.timeline-clip.selected {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
    z-index: 20;
}

.timeline-clip .clip-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    pointer-events: none;
    z-index: 3;
    position: relative;
}

.timeline-clip .clip-label {
    color: white;
    font-weight: bold;
    font-size: 13px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 1), 0 0 10px rgba(0, 0, 0, 0.8), -1px -1px 2px rgba(0, 0, 0, 0.8), 1px 1px 2px rgba(0, 0, 0, 0.8);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.2;
    letter-spacing: 0.5px;
    display: block;
}

.timeline-clip .clip-duration {
    color: rgba(255, 255, 255, 1);
    font-size: 11px;
    opacity: 1;
    font-weight: 600;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 1), 0 0 8px rgba(0, 0, 0, 0.8), -1px -1px 2px rgba(0, 0, 0, 0.8), 1px 1px 2px rgba(0, 0, 0, 0.8);
    display: block;
}

/* Resize Handles */
.clip-resize-handle {
    position: absolute;
    top: 0;
    width: 8px;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    cursor: ew-resize;
    z-index: 15;
    transition: background 0.2s, width 0.2s;
    border-radius: 4px;
}

.clip-resize-handle:hover {
    background: rgba(251, 191, 36, 0.8);
    width: 10px;
}

.clip-resize-handle.clip-resize-left {
    left: 0;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    cursor: w-resize;
}

.clip-resize-handle.clip-resize-right {
    right: 0;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    cursor: e-resize;
}

.clip-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 60%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1px;
}

.timeline-playhead {
    position: absolute;
    top: 0;
    left: 0%;
    width: 2px;
    height: 100%;
    background: #fbbf24;
    pointer-events: none;
    z-index: 30;
    box-shadow: 0 0 4px rgba(251, 191, 36, 0.8);
}

.timeline-playhead::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    width: 14px;
    height: 14px;
    background: #fbbf24;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.9);
    border: 2px solid #000;
}

.timeline-time-display {
    color: #fff;
    font-size: 14px;
    text-align: center;
    font-family: 'Courier New', monospace;
    margin-top: 12px;
}

.timeline-time-display .current-time {
    color: #fbbf24;
    font-weight: bold;
}

.timeline-progress {
    display: none; /* Hide progress bar as per design */
}

/* Clips Editor Sidebar */
.clip-editor-sidebar {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.clip-editor-sidebar::-webkit-scrollbar {
    width: 6px;
}

.clip-editor-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.clip-editor-sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.clip-editor-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Clip Editor Panel */
.clip-editor-panel {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.clip-editor-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    z-index: 10;
    padding-top: 0;
}

.clip-editor-header .header-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.clip-editor-header .header-title-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.clip-editor-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.clip-editor-header h3 i {
    color: #3b82f6;
    font-size: 22px;
}

.clips-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    min-width: 50px;
    text-align: center;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 13px;
}

.header-info i {
    color: #3b82f6;
}

.clip-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    padding-right: 4px;
}

.clip-list::-webkit-scrollbar {
    width: 6px;
}

.clip-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.clip-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.clip-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.clip-item {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    min-height: auto;
}

.clip-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #e5e7eb;
    transition: background 0.3s;
}

.clip-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.clip-item.selected {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), 0 4px 12px rgba(37, 99, 235, 0.2);
    transform: translateY(-2px);
}

.clip-item.selected::before {
    background: #2563eb;
}

.clip-item.filled {
    border-color: #10b981;
}

.clip-item.filled::before {
    background: #10b981;
}

.clip-item.empty {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.clip-item.empty::before {
    background: #fbbf24;
}

.clip-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.clip-item-number {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #111827;
}

.clip-item-number .badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    transition: all 0.3s;
}

.clip-item-number .badge.filled {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.clip-item.selected .clip-item-number .badge {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4);
    transform: scale(1.1);
}

.clip-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
}

.clip-status-badge.filled {
    background: #d1fae5;
    color: #065f46;
}

.clip-status-badge.empty {
    background: #fef3c7;
    color: #92400e;
}

.clip-item-actions {
    display: flex;
    gap: 4px;
}

.clip-item-actions button {
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 12px;
}

.clip-item-actions button:hover {
    background: #e5e7eb;
    color: #111827;
}

.clip-item-actions button.danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

.clip-time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.clip-time-input {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.clip-time-input label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

.clip-time-input input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.clip-time-input input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Adjust Actions */
.clip-adjust-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    visibility: visible;
    opacity: 1;
}

.adjust-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.adjust-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    min-width: 30px;
}

.adjust-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
}

.adjust-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: scale(1.1);
}

.adjust-btn.plus {
    color: #059669;
}

.adjust-btn.plus:hover {
    background: #d1fae5;
    border-color: #059669;
}

.adjust-btn.minus {
    color: #dc2626;
}

.adjust-btn.minus:hover {
    background: #fee2e2;
    border-color: #dc2626;
}

.clip-time-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 8px;
    visibility: visible;
    opacity: 1;
}

.clip-time-actions button {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 36px;
}

.clip-time-actions button.from-time {
    background: #dbeafe;
    color: #1e40af;
}

.clip-time-actions button.from-time:hover {
    background: #bfdbfe;
}

.clip-time-actions button.to-time {
    background: #d1fae5;
    color: #065f46;
}

.clip-time-actions button.to-time:hover {
    background: #a7f3d0;
}

.clip-duration {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
    color: #6b7280;
}

.clip-duration strong {
    color: #111827;
}

/* Empty state */
.clip-empty-state {
    text-align: center;
    padding: 24px;
    color: #6b7280;
    font-size: 14px;
}

.clip-empty-state i {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* Clip Parts Container - for single clip with parts */

.clip-parts-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.clip-part {
    position: absolute;
    height: 100%;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.4);
    transition: opacity 0.2s;
    opacity: 1 !important;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.1);
}

.clip-part:last-child {
    border-right: none;
}

.clip-part .part-label {
    display: none; /* Hide part labels inside parts - we show clip name and duration instead */
}

/* Clip boundary markers - start and end lines */
.clip-boundary-marker {
    position: absolute;
    top: -60px;
    width: 2px;
    height: 60px;
    background: #2563eb;
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 0 4px rgba(37, 99, 235, 0.6);
}

.clip-start-marker {
    left: 0;
}

.clip-end-marker {
    right: 0;
    left: auto;
}

/* Enhanced timeline for all clips with parts */
.timeline-clip-with-parts,
.timeline-clip.single-clip-fixed {
    background: transparent;
    border-color: #2563eb;
    cursor: move !important;
    border: 2px solid #2563eb;
}

/* Allow drag but prevent resize for all clips */
.timeline-clip.single-clip-fixed {
    pointer-events: auto;
}

.timeline-clip.single-clip-fixed:hover,
.timeline-clip-with-parts:hover {
    transform: scaleY(1.05);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5), 0 0 0 2px rgba(37, 99, 235, 0.3);
}

/* Hide resize handles for all clips */
.timeline-clip.single-clip-fixed .clip-resize-handle,
.timeline-clip-with-parts .clip-resize-handle {
    display: none !important;
}

.timeline-clip-with-parts .clip-content,
.timeline-clip[data-clips-count="1"] .clip-content {
    z-index: 3;
    position: relative;
    background: transparent;
    padding: 4px 8px;
    border-radius: 4px;
    backdrop-filter: none;
    box-shadow: none;
    border: none;
}

/* Part markers removed - we only show start and end markers now */
.part-marker {
    display: none;
}

/* Placeholder clip styles - for clips with 0 values */
.timeline-clip-placeholder {
    opacity: 0.5 !important;
    border: 2px dashed #6b7280 !important;
    background: rgba(107, 114, 128, 0.2) !important;
    cursor: pointer;
}

.timeline-clip-placeholder:hover {
    opacity: 0.7 !important;
    border-color: #4b5563 !important;
    background: rgba(107, 114, 128, 0.3) !important;
}

.timeline-clip-placeholder .clip-label {
    color: #6b7280 !important;
    font-style: italic;
}

/*----------------------------------------------------------------------------------------*/

