/**
 * THV Module Styles
 * Talking Head Videos Editor - HTML-based (no Canvas)
 */

/* ==================================
   Editor Container
   ================================== */
#thv-editor-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ==================================
   Preview Area (Scene Carousel)
   ================================== */
#thv-preview-area {
    position: relative;
    width: 100%;
    background: var(--nk-lighter);
    border-radius: 8px;
    overflow: hidden;
}

#thv-preview-viewport {
    position: relative;
    width: 100%;
    min-height: 200px;
    max-height: 500px;
    background: var(--nk-lighter);
    overflow: hidden;
}

#thv-preview-viewport.orientation-vertical {
    max-height: 600px;
}

#thv-preview-viewport.orientation-square {
    max-height: 550px;
}

/* Scene Preview Container */
#thv-preview-scenes {
    position: relative;
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px 15px 40px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
}

/* All orientations: same padding approach for centering */
#thv-preview-viewport.orientation-vertical #thv-preview-scenes {
    gap: 15px;
    padding: 20px 50% 40px;
    justify-content: flex-start;
}

#thv-preview-viewport.orientation-horizontal #thv-preview-scenes,
#thv-preview-viewport.orientation-square #thv-preview-scenes {
    gap: 15px;
    padding: 20px 50% 40px;
    justify-content: flex-start;
}

/* Scene Preview Wrapper (contains toolbar + scene) */
.thv-preview-scene-wrapper {
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Scene Preview Card */
.thv-preview-scene {
    position: relative;
    background: var(--nk-white);
    border: 3px solid var(--nk-border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

/* Vertical: Larger scenes for better visibility */
#thv-preview-viewport.orientation-vertical .thv-preview-scene-wrapper .thv-preview-scene {
    width: 280px;
    aspect-ratio: 9/16;
    max-height: 550px;
}

/* Horizontal: Carousel with scale effect */
#thv-preview-viewport.orientation-horizontal .thv-preview-scene-wrapper {
    transform: scale(0.9);
    opacity: 0.6;
    transition: all 0.3s ease;
}

#thv-preview-viewport.orientation-horizontal .thv-preview-scene-wrapper .thv-preview-scene {
    width: 600px;
    aspect-ratio: 16/9;
    max-height: 480px;
}

/* Square: Carousel with scale effect */
#thv-preview-viewport.orientation-square .thv-preview-scene-wrapper {
    transform: scale(0.9);
    opacity: 0.6;
    transition: all 0.3s ease;
}

#thv-preview-viewport.orientation-square .thv-preview-scene-wrapper .thv-preview-scene {
    width: 400px;
    aspect-ratio: 1/1;
    max-height: 430px;
}

/* Active scene for horizontal/square - scale wrapper */
#thv-preview-viewport.orientation-horizontal .thv-preview-scene-wrapper:has(.thv-preview-scene.active),
#thv-preview-viewport.orientation-square .thv-preview-scene-wrapper:has(.thv-preview-scene.active) {
    transform: scale(1);
    opacity: 1;
    z-index: 10;
}

/* Active scene border and shadow */
#thv-preview-viewport.orientation-horizontal .thv-preview-scene.active,
#thv-preview-viewport.orientation-square .thv-preview-scene.active {
    border-color: var(--nk-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Active scene for vertical */
#thv-preview-viewport.orientation-vertical .thv-preview-scene.active {
    border-color: var(--nk-primary);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* Scene Preview Content */
.thv-preview-scene-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nk-lighter);
    position: relative;
    overflow: hidden;
}

/* Scene Layers Container */
.thv-scene-layers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Scene Layer - Base */
.thv-scene-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Layer Z-Index Order */
.thv-layer-0 {
    z-index: 0;
}

.thv-layer-1 {
    z-index: 1;
}

.thv-layer-2 {
    z-index: 2;
}

.thv-layer-3 {
    z-index: 3;
}

.thv-layer-4 {
    z-index: 4;
}

.thv-layer-5 {
    z-index: 5;
}

.thv-layer-6 {
    z-index: 6;
}

.thv-layer-7 {
    z-index: 7;
}

.thv-layer-8 {
    z-index: 8;
}

.thv-layer-9 {
    z-index: 9;
}

/* Video Layer (Background - always layer 0) */
.thv-layer-video {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Avatar Layer (always layer 1) */
.thv-layer-avatar {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    box-sizing: border-box; /* Include border in size calculations */
}

/* Layer Edit Controls - positioned dynamically via JS */
.thv-layer-controls {
    position: absolute;
    z-index: 1000;
    display: none; /* Hidden by default, shown via JS */
    flex-direction: row;
    gap: 4px;
    padding: 8px;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.thv-layer-control-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--nk-border-color);
    border-radius: 4px;
    cursor: pointer;
    color: var(--nk-text-base);
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    position: relative;
    z-index: 101;
}

.thv-layer-control-btn:hover {
    background: var(--nk-primary);
    color: var(--nk-white);
    transform: scale(1.1);
}

.thv-layer-control-btn em {
    pointer-events: none;
}

/* Layer Move Handle */
.thv-layer-move-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--nk-primary);
    border-radius: 50%;
    cursor: move;
    z-index: 99;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    pointer-events: auto;
}

/* Show move handle on layer hover */
.thv-layer-avatar:hover .thv-layer-move-handle,
.thv-layer-element:hover .thv-layer-move-handle {
    display: flex;
}

.thv-layer-move-handle:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.thv-layer-move-handle em {
    font-size: 20px;
    color: var(--nk-primary);
    pointer-events: none;
}

/* Layer being dragged */
.thv-layer-avatar.ui-draggable-dragging,
.thv-layer-element.ui-draggable-dragging {
    opacity: 0.8;
    z-index: 1001;
}

/* Layer resize handles - hidden by default, shown on hover */
.thv-layer-avatar.ui-resizable .ui-resizable-handle,
.thv-layer-element.ui-resizable .ui-resizable-handle {
    background: var(--nk-primary);
    border: 2px solid var(--nk-white);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

/* Show resize handles on layer hover */
.thv-layer-avatar.ui-resizable:hover .ui-resizable-handle,
.thv-layer-element.ui-resizable:hover .ui-resizable-handle,
.thv-layer-avatar.ui-resizable-resizing .ui-resizable-handle,
.thv-layer-element.ui-resizable-resizing .ui-resizable-handle {
    opacity: 1;
}

/* Avatar with mask applied */
.thv-layer-avatar.has-mask {
    overflow: hidden;
}

/* Avatar editing mode */
.thv-layer-avatar.editing-mode {
    outline: 2px dashed var(--nk-primary);
    outline-offset: 4px;
}

/* Element Layers (layer 2+) */
.thv-layer-element {
    pointer-events: auto;
    cursor: pointer;
    box-sizing: border-box; /* Include border in size calculations */
}

.thv-layer-element.thv-layer-type-text {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-align: center;
    word-wrap: break-word;
}

.thv-layer-element.thv-layer-type-image {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* Scene Preview Placeholder */
.thv-preview-scene-placeholder {
    text-align: center;
    color: var(--nk-text-light);
}

.thv-preview-scene-placeholder em {
    font-size: 2.5rem;
    opacity: 0.3;
}

.thv-preview-scene-placeholder p {
    margin-top: 8px;
    font-size: 12px;
}

/* Scene Toolbar (above scene) */
.thv-preview-scene-toolbar {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
    height: 32px;
}

.thv-preview-scene-wrapper:hover .thv-preview-scene-toolbar,
.thv-preview-scene.active ~ .thv-preview-scene-toolbar,
.thv-preview-scene-wrapper:has(.thv-preview-scene.active) .thv-preview-scene-toolbar {
    opacity: 1;
}

.thv-preview-scene-toolbar .thv-btn-icon {
    background: var(--nk-white);
    border: 1px solid var(--nk-border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Scene Index Label */
.thv-preview-scene-index {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Scene Duration Label */
.thv-preview-scene-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 10px;
    border-radius: 4px;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ==================================
   Timeline Container
   ================================== */
#thv-timeline {
    position: relative;
    background: var(--nk-base-color);
    border-radius: 8px;
    padding: 15px;
    min-height: 250px;
}

#thv-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--nk-border-color);
}

#thv-timeline-header h6 {
    margin: 0;
    font-weight: 600;
}

/* Global Tracks */
#thv-global-tracks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--nk-lighter);
    border-radius: 6px;
}

.thv-global-track {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--nk-white);
    border-radius: 4px;
    border: 1px solid var(--nk-border-color);
}

.thv-global-track-label {
    min-width: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--nk-text-base);
}

.thv-global-track-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.thv-global-track-file {
    flex: 1;
    font-size: 12px;
    color: var(--nk-text-light);
}

.thv-global-track-file.has-file {
    color: var(--nk-primary);
    font-weight: 500;
}

.thv-global-track-actions {
    display: flex;
    gap: 4px;
}

/* Scenes Timeline */
#thv-scenes-timeline {
    position: relative;
    min-height: 100px;
}

#thv-scenes-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

#thv-scenes-header h6 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

/* Timeline Thumbnails Container */
#thv-scenes-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 0;
    scroll-behavior: smooth;
}

/* Scene Thumbnail in Timeline */
.thv-timeline-thumb {
    position: relative;
    flex-shrink: 0;
    width: 120px;
    aspect-ratio: 16/9;
    background: var(--nk-white);
    border: 2px solid var(--nk-border-color);
    border-radius: 6px;
    cursor: move;
    transition: all 0.2s;
    overflow: hidden;
}

.thv-timeline-thumb.vertical {
    width: 80px;
    aspect-ratio: 9/16;
}

.thv-timeline-thumb.square {
    width: 100px;
    aspect-ratio: 1/1;
}

.thv-timeline-thumb:hover {
    border-color: var(--nk-primary);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.thv-timeline-thumb.active {
    border-color: var(--nk-primary);
    border-width: 3px;
    box-shadow: 0 2px 12px rgba(var(--nk-primary-rgb), 0.3);
}

.thv-timeline-thumb-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nk-lighter);
    color: var(--nk-text-light);
    position: relative;
    overflow: hidden;
}

.thv-timeline-thumb-index {
    position: absolute;
    top: 5px;
    left: 5px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 3px;
}

.thv-timeline-thumb-duration {
    position: absolute;
    bottom: 5px;
    right: 5px;
    padding: 2px 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 9px;
    border-radius: 3px;
}

/* jQuery UI Sortable States */
.thv-timeline-thumb.ui-sortable-helper {
    opacity: 0.8;
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    cursor: grabbing;
}

.thv-timeline-thumb.ui-sortable-placeholder {
    border: 2px dashed var(--nk-primary);
    background: rgba(var(--nk-primary-rgb), 0.1);
    opacity: 0.5;
}

#thv-scenes-list.ui-sortable-helper {
    cursor: grabbing;
}

/* Native HTML5 Drag and Drop States */
.thv-timeline-thumb[draggable="true"] {
    user-select: none;
}

.thv-timeline-thumb.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.thv-timeline-thumb.drag-over {
    border-color: var(--nk-primary);
    background: rgba(var(--nk-primary-rgb), 0.1);
    transform: scale(1.05);
}

/* Scene Card */
.thv-scene-card {
    position: relative;
    background: var(--nk-white);
    border: 2px solid var(--nk-border-color);
    border-radius: 6px;
    padding: 12px;
    cursor: move;
    transition: all 0.2s;
}

.thv-scene-card:hover {
    border-color: var(--nk-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.thv-scene-card.active {
    border-color: var(--nk-primary);
    background: rgba(var(--nk-primary-rgb), 0.05);
}

.thv-scene-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.thv-scene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.thv-scene-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--nk-text-base);
}

.thv-scene-duration {
    font-size: 12px;
    color: var(--nk-text-light);
    font-weight: 500;
}

.thv-scene-actions {
    display: flex;
    gap: 4px;
}

.thv-scene-tracks {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.thv-scene-track {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--nk-lighter);
    border-radius: 4px;
    font-size: 12px;
}

.thv-scene-track-icon {
    font-size: 14px;
    color: var(--nk-text-light);
}

.thv-scene-track-label {
    min-width: 70px;
    font-weight: 500;
    color: var(--nk-text-base);
}

.thv-scene-track-value {
    flex: 1;
    color: var(--nk-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thv-scene-track-value.has-value {
    color: var(--nk-primary);
}

/* Elements on Scene */
.thv-scene-elements {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--nk-border-color);
}

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

.thv-scene-elements-header h6 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--nk-text-base);
}

.thv-scene-elements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.thv-element-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--nk-primary-light);
    color: var(--nk-primary);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.thv-element-tag:hover {
    background: var(--nk-primary);
    color: var(--nk-white);
}

.thv-element-tag.type-video {
    background: rgba(98, 54, 255, 0.1);
    color: #6236ff;
}

.thv-element-tag.type-avatar {
    background: rgba(48, 184, 140, 0.1);
    color: #30b88c;
}

.thv-element-tag.type-audio {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.thv-element-tag.type-image {
    background: rgba(255, 158, 28, 0.1);
    color: #ff9e1c;
}

.thv-element-tag.type-text {
    background: rgba(32, 201, 151, 0.1);
    color: #20c997;
}

/* ==================================
   Scene Editor (Right Panel)
   ================================== */
#thv-scene-editor {
    position: relative;
}

#thv-scene-editor-header {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--nk-border-color);
}

#thv-scene-editor-header h6 {
    margin: 0;
    font-weight: 600;
}

#thv-scene-editor-content .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--nk-text-light);
}

#thv-scene-editor-content .empty-state em {
    font-size: 2.5rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 10px;
}

/* Form Groups in Editor */
#thv-scene-editor .form-group {
    margin-bottom: 15px;
}

#thv-scene-editor .form-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

#thv-scene-editor .form-control,
#thv-scene-editor .form-select {
    font-size: 13px;
}

/* File Upload Areas */
.thv-file-upload {
    position: relative;
    padding: 20px;
    border: 2px dashed var(--nk-border-color);
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.thv-file-upload:hover {
    border-color: var(--nk-primary);
    background: rgba(var(--nk-primary-rgb), 0.05);
}

.thv-file-upload.has-file {
    border-style: solid;
    border-color: var(--nk-primary);
    background: rgba(var(--nk-primary-rgb), 0.05);
}

.thv-file-upload-icon {
    font-size: 2rem;
    color: var(--nk-text-light);
    margin-bottom: 8px;
}

.thv-file-upload-preview {
    width: 100%;
    height: 120px;
    margin-bottom: 10px;
    border-radius: 4px;
    background-color: var(--nk-lighter);
}

.thv-file-upload-text {
    font-size: 13px;
    color: var(--nk-text-base);
    font-weight: 500;
}

.thv-file-upload-hint {
    font-size: 11px;
    color: var(--nk-text-light);
    margin-top: 4px;
}

.thv-file-upload-filename {
    font-size: 12px;
    color: var(--nk-primary);
    font-weight: 500;
    margin-top: 8px;
    word-break: break-all;
}

/* ==================================
   Buttons & Actions
   ================================== */
.thv-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--nk-text-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.thv-btn-icon:hover {
    background: var(--nk-lighter);
    color: var(--nk-text-base);
}

.thv-btn-icon.danger:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.thv-btn-icon.primary:hover {
    background: rgba(var(--nk-primary-rgb), 0.1);
    color: var(--nk-primary);
}

/* ==================================
   Start Panel (Upload Options)
   ================================== */
#thv-start-panel .btn {
    text-align: left;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

#thv-start-panel .btn em {
    font-size: 1.5rem;
}

#thv-start-panel small {
    display: block;
    margin-top: 0.25rem;
    margin-left: 2.5rem;
}

/* ==================================
   Loading States
   ================================== */
.thv-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.thv-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ==================================
   Drag & Drop States
   ================================== */
.thv-drag-over {
    background: rgba(var(--nk-primary-rgb), 0.1);
    border-color: var(--nk-primary);
}

.thv-drop-placeholder {
    height: 4px;
    background: var(--nk-primary);
    border-radius: 2px;
    margin: 8px 0;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ==================================
   Layer Settings Dropdown
   ================================== */
#thv-layer-settings-dropdown {
    animation: fadeInDown 0.2s;
}

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

/* Layer Settings Form Controls */
.thv-editor-form-group {
    margin-bottom: 15px;
}

.thv-editor-form-group:last-child {
    margin-bottom: 0;
}

.thv-editor-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--nk-text-base);
}

.thv-editor-form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--nk-border-color);
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
}

.thv-editor-form-control:focus {
    outline: none;
    border-color: var(--nk-primary);
    box-shadow: 0 0 0 3px rgba(var(--nk-primary-rgb), 0.1);
}

.thv-editor-form-row {
    display: flex;
    gap: 15px;
}

.thv-editor-form-col {
    flex: 1;
}

/* Mask Type Selector (for avatar and other maskable elements) */
.thv-mask-type-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.thv-mask-type-option {
    padding: 15px;
    border: 2px solid var(--nk-border-color);
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--nk-white);
}

.thv-mask-type-option:hover {
    border-color: var(--nk-primary);
    background: rgba(var(--nk-primary-rgb), 0.05);
}

.thv-mask-type-option.active {
    border-color: var(--nk-primary);
    background: rgba(var(--nk-primary-rgb), 0.1);
}

.thv-mask-type-option em {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
    color: var(--nk-text-light);
}

.thv-mask-type-option.active em {
    color: var(--nk-primary);
}

.thv-mask-type-option span {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--nk-text-base);
}

/* Color Picker */
.thv-color-picker-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.thv-color-picker-preview {
    width: 40px;
    height: 40px;
    border: 2px solid var(--nk-border-color);
    border-radius: 4px;
    cursor: pointer;
}

.thv-color-picker-input {
    flex: 1;
}

/* Range Slider */
.thv-range-slider {
    display: flex;
    align-items: center;
    gap: 15px;
}

.thv-range-slider input[type="range"] {
    flex: 1;
}

.thv-range-value {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    color: var(--nk-text-base);
}

/* ==================================
   Responsive
   ================================== */
@media (max-width: 991px) {
    #thv-timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .thv-global-track {
        flex-direction: column;
        align-items: flex-start;
    }

    .thv-global-track-label {
        min-width: auto;
    }

    .thv-scene-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .thv-layer-editor-content {
        width: 95%;
        max-height: 95vh;
    }

    .thv-mask-type-selector {
        grid-template-columns: 1fr;
    }
}
