/* Video Editor Style Sheet - SocialWave Premium Tools */
:root {
    --neon-pink: #ff0050;
    --neon-pink-glow: rgba(255, 0, 80, 0.35);
}

.video-editor-container {
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Header Section */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(16px);
}

.editor-header h2 {
    font-family: var(--font-title);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.text-cyan {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan-glow);
}

.text-purple {
    color: var(--neon-purple);
    text-shadow: 0 0 10px var(--neon-purple-glow);
}

.badge-beta {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 0.5rem;
    text-shadow: none;
}

.subtitle-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Action Buttons */
.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #00f2fe, #4facfe);
    color: #000;
    font-weight: 600;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
    opacity: 0.9;
}

.btn-danger {
    background: rgba(255, 0, 60, 0.15);
    border: 1px solid rgba(255, 0, 60, 0.3);
    color: #ff3b30;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(255, 0, 60, 0.3) !important;
    border-color: rgba(255, 0, 60, 0.5) !important;
}

/* Workspace Layout */
.editor-workspace {
    display: flex;
    gap: 1.5rem;
    min-height: 520px;
}

.workspace-left {
    width: 440px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(16px);
    overflow: hidden;
}

.workspace-right {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(16px);
    padding: 1.5rem;
    justify-content: center;
}

/* Tabs Styling */
.editor-tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.tab-link {
    flex-grow: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 0.9rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.tab-link i {
    font-size: 1.1rem;
}

.tab-link:hover:not(:disabled) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.tab-link.active {
    color: var(--neon-cyan);
    border-bottom-color: var(--neon-cyan);
    background: rgba(0, 242, 254, 0.03);
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.tab-link:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Tab Content Areas */
.tab-content {
    display: none;
    padding: 1.25rem;
    flex-grow: 1;
    overflow-y: auto;
    max-height: 480px;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.01);
    padding: 1.75rem 1rem;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--neon-cyan);
    background: rgba(0, 242, 254, 0.03);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.1) inset;
}

.upload-icon {
    font-size: 2.2rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.upload-zone:hover .upload-icon {
    color: var(--neon-cyan);
}

.upload-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.upload-subtext {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.btn-browse {
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.3);
    color: var(--neon-cyan);
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-browse:hover {
    background: var(--neon-cyan);
    color: #000;
}

/* Asset Section & Grid */
.asset-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-left: 3px solid var(--neon-cyan);
    padding-left: 0.5rem;
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    min-height: 120px;
}

.empty-assets-placeholder {
    grid-column: span 2;
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.empty-assets-placeholder i {
    font-size: 2rem;
    opacity: 0.4;
}

/* Media Cards */
.media-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    position: relative;
    cursor: grab;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.media-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.media-card .card-thumb {
    width: 100%;
    height: 75px;
    border-radius: 4px;
    background: #000;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.media-card .card-thumb img, .media-card .card-thumb video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.media-card .card-thumb i.type-icon {
    font-size: 1.5rem;
    color: var(--text-secondary);
    position: absolute;
    opacity: 0.6;
}

.media-card .card-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.media-card .card-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-card .card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.media-card .card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 4px;
    padding: 0.1rem 0.3rem;
    font-size: 0.6rem;
    font-weight: 600;
}

.badge-video { color: var(--neon-cyan); }
.badge-audio { color: #d4a373; }
.badge-image { color: var(--neon-purple); }

.media-card .card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 0.25rem;
}

.media-card .card-action-btn {
    background: rgba(0, 0, 0, 0.75);
    border: none;
    color: var(--text-primary);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.65rem;
    transition: all 0.2s ease;
}

.media-card .card-action-btn:hover {
    background: #ff003c;
    color: white;
}

.media-card .btn-add-timeline {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: var(--neon-cyan);
    color: #000;
    border: none;
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    opacity: 0;
}

.media-card:hover .btn-add-timeline {
    opacity: 1;
}

/* Settings Panels Elements */
.control-group {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.25rem;
}

.btn-row {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.crop-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.45rem;
    font-size: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.preset-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.preset-btn.active {
    background: rgba(0, 242, 254, 0.08);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    font-weight: 500;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.slider-label {
    width: 90px;
    color: var(--text-secondary);
}

.editor-slider {
    flex-grow: 1;
    height: 4px;
    border-radius: 2px;
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    -webkit-appearance: none;
    cursor: pointer;
}

.editor-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: 0 0 5px var(--neon-cyan);
    transition: transform 0.1s;
}

.editor-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.slider-val {
    width: 45px;
    text-align: right;
    font-weight: 500;
    color: var(--neon-cyan);
}

.editor-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.editor-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.1);
}

.editor-select {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.editor-select option {
    background-color: #120d1e;
    color: var(--text-primary);
}

.editor-color-picker {
    width: 32px;
    height: 24px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
}

.stickers-emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.emoji-item {
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
    user-select: none;
}

.emoji-item:hover {
    transform: scale(1.3);
}

.draw-modes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.draw-mode-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem;
    font-size: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.draw-mode-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.draw-mode-btn.active {
    background: rgba(255, 0, 60, 0.08);
    border-color: var(--youtube-red);
    color: var(--youtube-red);
    font-weight: 500;
}

/* Canvas Compositing Panel */
.preview-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.preview-title-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 0.5rem;
}

.preview-badge {
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.blink {
    animation: blinker 1.5s linear infinite;
}

@keyframes blinker {
    50% { opacity: 0; }
}

.resolution-badge {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 0.05rem 0.4rem;
    font-family: monospace;
}

.canvas-wrapper {
    width: 100%;
    max-width: 720px;
    aspect-ratio: 16/9;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#compositionCanvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

/* Selection / Crop Overlay Box overlay style */
.crop-overlay-box {
    position: absolute;
    border: 2px dashed var(--neon-cyan);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); /* Dim area outside crop */
    cursor: move;
}

.crop-handle {
    width: 8px;
    height: 8px;
    background: #fff;
    border: 1px solid #000;
    position: absolute;
}

.crop-handle.nw { top: -4px; left: -4px; cursor: nw-resize; }
.crop-handle.ne { top: -4px; right: -4px; cursor: ne-resize; }
.crop-handle.sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.crop-handle.se { bottom: -4px; right: -4px; cursor: se-resize; }

.canvas-text-overlay-helper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Custom Player Controls */
.player-controls {
    width: 100%;
    max-width: 720px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--neon-cyan);
    border: none;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.play-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}

.play-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.player-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.player-icon-btn:hover:not(:disabled) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.player-icon-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.time-display {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0 0.5rem;
}

.current-time {
    color: var(--text-primary);
    font-weight: 600;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.volume-slider {
    width: 70px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    border-radius: 2px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-primary);
}

/* Timeline Layout */
.editor-timeline-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.timeline-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
}

.timeline-title {
    font-family: var(--font-title);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-item strong {
    font-family: monospace;
}

.zoom-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.zoom-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.zoom-level-text {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-secondary);
    padding: 0 0.5rem;
}

/* Timeline Tracks & Playhead scrolling area */
.timeline-ruler-wrapper {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    background: #0d0b13;
    padding-bottom: 5px;
    /* Hide scrollbars but keep functionality */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.timeline-ruler {
    height: 28px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    width: 3000px; /* Will be set dynamically by JavaScript */
    background: rgba(0, 0, 0, 0.2);
    user-select: none;
}

.timeline-marker {
    position: absolute;
    bottom: 0;
    font-family: monospace;
    font-size: 0.65rem;
    color: var(--text-secondary);
    transform: translateX(-50%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    height: 10px;
    padding-left: 3px;
    display: flex;
    align-items: flex-end;
}

.timeline-marker.major {
    height: 16px;
    border-left-color: rgba(255, 255, 255, 0.25);
    padding-bottom: 2px;
}

.timeline-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ff003c;
    box-shadow: 0 0 5px rgba(255, 0, 60, 0.5);
    z-index: 10;
    pointer-events: none;
    transform: translateX(0px); /* Managed by timeline pixels per second */
}

.playhead-handle {
    width: 12px;
    height: 12px;
    background: #ff003c;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg) translate(0px, -6px);
    position: absolute;
    top: 0;
    left: -5px;
    box-shadow: 0 0 5px rgba(255, 0, 60, 0.6);
}

.timeline-tracks-container {
    display: flex;
    flex-direction: column;
    width: 3000px; /* Synchronized with ruler */
    position: relative;
}

.timeline-track {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    height: 70px;
    position: relative;
}

.track-header {
    width: 140px;
    flex-shrink: 0;
    background: #110e17;
    border-right: 1px solid var(--border-color);
    position: sticky;
    left: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.track-header i {
    font-size: 1.1rem;
    color: var(--neon-cyan);
}

.timeline-track[data-track-type="audio"] .track-header i {
    color: #d4a373;
}

.timeline-track[data-track-type="text"] .track-header i {
    color: var(--neon-purple);
}

.track-clips-area {
    flex-grow: 1;
    position: relative;
    height: 100%;
    background: rgba(255, 255, 255, 0.005);
}

.track-clips-area.drag-over {
    background: rgba(0, 242, 254, 0.03);
}

.track-placeholder-message {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

/* Timeline Clips Styling */
.timeline-clip {
    position: absolute;
    top: 6px;
    height: 56px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.25), rgba(79, 172, 254, 0.25));
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 0.5rem;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.timeline-clip.active {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.3), 0 4px 10px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.35), rgba(79, 172, 254, 0.35));
}

.timeline-clip[data-clip-type="video"], .timeline-clip[data-clip-type="image"] {
    background-color: #1a1528;
    background-repeat: repeat-x;
    background-size: auto 100%;
}
.timeline-clip[data-clip-type="video"].active, .timeline-clip[data-clip-type="image"].active {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}

.timeline-clip[data-clip-type="audio"] {
    background-color: #11221a;
    background-repeat: no-repeat;
}
.timeline-clip[data-clip-type="audio"].active {
    border-color: #00ff66;
    box-shadow: 0 0 12px rgba(0, 255, 102, 0.4);
}

.timeline-clip[data-clip-type="text"] {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.25), rgba(114, 9, 183, 0.25));
}
.timeline-clip[data-clip-type="text"].active {
    border-color: var(--neon-purple);
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.35), rgba(114, 9, 183, 0.35));
    box-shadow: 0 0 10px var(--neon-purple-glow);
}

.clip-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 15px;
    position: relative;
    z-index: 2;
}

.clip-duration {
    font-size: 0.6rem;
    color: var(--text-secondary);
    font-family: monospace;
    margin-top: 0.15rem;
    position: relative;
    z-index: 2;
}

.clip-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.65rem;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-clip:hover .clip-delete-btn {
    opacity: 1;
}

.clip-delete-btn:hover {
    color: #ff003c;
}

/* Trim Resize Handles on clip borders */
.clip-handle-trim {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 6px;
    background: rgba(255, 255, 255, 0.2);
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
}

.clip-handle-trim::after {
    content: "";
    width: 2px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 1px;
}

.clip-handle-trim.left {
    left: 0;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.clip-handle-trim.right {
    right: 0;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.timeline-clip.active .clip-handle-trim {
    background: var(--neon-cyan);
}

.timeline-clip.active[data-clip-type="audio"] .clip-handle-trim {
    background: #d4a373;
}

.timeline-clip.active[data-clip-type="text"] .clip-handle-trim {
    background: var(--neon-purple);
}

/* Export Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 8, 16, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-modal {
    background: rgba(18, 13, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 242, 254, 0.1);
    padding: 2.25rem;
    border-radius: 16px;
    width: 90%;
    max-width: 460px;
    text-align: center;
}

.modal-title {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.modal-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    box-shadow: 0 0 10px var(--neon-cyan-glow);
    transition: width 0.1s linear;
}

.progress-percentage-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--neon-cyan);
    margin-bottom: 0.5rem;
}

.export-details {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.w-100 { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.me-1 { margin-right: 0.25rem; }
.ms-auto { margin-left: auto; }

/* Touch interaction gestures control - prevents native scroll during active drags */
.timeline-clip, .clip-handle-trim, .timeline-ruler, .timeline-tracks-container, #compositionCanvas {
    touch-action: none;
}

/* Hide scrollbars for swipable mobile tab bar */
.editor-tabs {
    scrollbar-width: none;
}
.editor-tabs::-webkit-scrollbar {
    display: none;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
    .editor-workspace {
        flex-direction: column;
        min-height: auto;
    }
    .workspace-left {
        width: 100%;
        flex-shrink: 1;
        order: 2; /* Settings panels go below preview on mobile */
    }
    .workspace-right {
        width: 100%;
        padding: 1rem;
        order: 1; /* Preview canvas goes on top for mobile editing */
    }
    .tab-content {
        max-height: none; /* Expand naturally on mobile, avoiding double scrollbars */
    }
    .canvas-wrapper {
        max-width: 100%;
    }
    .player-controls {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .track-header {
        width: 60px !important;
    }
    .track-header span {
        display: none !important;
    }
    .track-header i {
        font-size: 1.3rem !important;
        margin-right: 0 !important;
    }
    .clip-handle-trim {
        width: 14px !important;
    }
    .editor-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }
    .header-left h2 {
        justify-content: center;
    }
    .header-right {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    .header-right .action-btn {
        flex-grow: 1;
        justify-content: center;
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
    .timeline-toolbar {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    .toolbar-left, .toolbar-center, .toolbar-right {
        justify-content: center;
        text-align: center;
        display: flex;
        width: 100%;
    }
    .toolbar-center {
        margin: 0.25rem 0;
    }
}

@media (max-width: 576px) {
    .video-editor-container {
        padding: 0 0.5rem;
        margin: 0.5rem auto;
        gap: 0.75rem;
    }
    .editor-header h2 {
        font-size: 1.2rem;
    }
    .subtitle-text {
        display: none; /* Save space on small screen headers */
    }
    .workspace-left, .workspace-right, .editor-timeline-panel {
        border-radius: 8px;
    }
    .tab-link {
        min-width: 80px; /* Swipable mobile horizontal tab bar */
        flex-shrink: 0;
        padding: 0.6rem 0.3rem;
        font-size: 0.75rem;
    }
    .player-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    .volume-container {
        width: 100%;
        justify-content: center;
        margin-top: 0.25rem;
    }
    .time-display {
        font-size: 0.75rem;
        padding: 0;
    }
    .timeline-stats {
        gap: 0.75rem;
        font-size: 0.7rem;
        justify-content: center;
    }
}

/* Keyframe Control UI Styles */
.kf-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 4px;
    width: 28px;
    height: 24px;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.kf-toggle-btn:hover {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 5px rgba(0, 242, 254, 0.2);
}

.kf-toggle-btn.kf-active {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    background: rgba(0, 242, 254, 0.1);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
    text-shadow: 0 0 4px var(--neon-cyan);
}

/* Timeline Keyframe Diamond Indicator Overlay */
.timeline-clip .kf-marker-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--neon-cyan);
    border: 1px solid #000;
    transform: translate(-50%, -50%) rotate(45deg);
    top: 50%;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 0 5px var(--neon-cyan);
}

/* Keyframe list element style */
.kf-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
}

.kf-list-item button {
    background: transparent;
    border: none;
    color: #ff3b30;
    cursor: pointer;
    font-size: 0.75rem;
}

/* Timeline Transition Pink Bar Overlay */
.timeline-clip .clip-animation-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255, 0, 80, 0.45), rgba(255, 0, 80, 0.1));
    border-right: 2px dashed rgba(255, 0, 80, 0.7);
    z-index: 5;
    pointer-events: none;
}

/* Resize handle on the transition overlay */
.timeline-clip .anim-resize-handle {
    position: absolute;
    right: -4px;
    top: 0;
    bottom: 0;
    width: 10px;
    cursor: ew-resize;
    z-index: 6;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-clip .anim-resize-handle::after {
    content: "";
    width: 2px;
    height: 18px;
    background: #ff0050;
    border-radius: 1px;
    box-shadow: 0 0 6px #ff0050;
}

/* Animation Selection Grid Panel */
.animation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-height: 380px;
    overflow-y: auto;
    padding: 0.25rem;
}

.animation-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.animation-card:hover {
    border-color: var(--neon-pink);
    background: rgba(255, 0, 80, 0.05);
    box-shadow: 0 0 8px rgba(255, 0, 80, 0.2);
}

.animation-card.active {
    border-color: var(--neon-pink);
    background: rgba(255, 0, 80, 0.12);
    box-shadow: 0 0 10px rgba(255, 0, 80, 0.35);
}

.anim-preview-box {
    width: 44px;
    height: 36px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.anim-indicator {
    width: 14px;
    height: 14px;
    background: var(--neon-pink);
    border-radius: 3px;
    box-shadow: 0 0 5px var(--neon-pink);
}

.anim-name {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 100%;
}

/* 15 CSS Keyframe Previews triggered on card hover */

/* 1. Classic Fade In */
.animation-card[data-anim="fade"]:hover .anim-indicator {
    animation: preview-fade 1.2s infinite ease-in-out;
}
@keyframes preview-fade {
    0% { opacity: 0.1; }
    50% { opacity: 1; }
    100% { opacity: 0.1; }
}

/* 2. Bounce Pop */
.animation-card[data-anim="bounce-pop"]:hover .anim-indicator {
    animation: preview-bounce-pop 1.2s infinite ease-in-out;
}
@keyframes preview-bounce-pop {
    0%, 100% { transform: scale(0.2); opacity: 0.2; }
    50% { transform: scale(1.3); opacity: 1; }
    70% { transform: scale(1.0); opacity: 1; }
}

/* 3. Spin Zoom */
.animation-card[data-anim="spin-zoom"]:hover .anim-indicator {
    animation: preview-spin-zoom 1.4s infinite ease-in-out;
}
@keyframes preview-spin-zoom {
    0% { transform: scale(0.1) rotate(0deg); opacity: 0.1; }
    70% { transform: scale(1.1) rotate(360deg); opacity: 1; }
    100% { transform: scale(1.0) rotate(360deg); opacity: 1; }
}

/* 4. Cinematic Slide Left */
.animation-card[data-anim="slide-left"]:hover .anim-indicator {
    animation: preview-slide-left 1.3s infinite ease-in-out;
}
@keyframes preview-slide-left {
    0% { transform: translateX(25px); opacity: 0.1; }
    60%, 100% { transform: translateX(0); opacity: 1; }
}

/* 5. Cinematic Slide Right */
.animation-card[data-anim="slide-right"]:hover .anim-indicator {
    animation: preview-slide-right 1.3s infinite ease-in-out;
}
@keyframes preview-slide-right {
    0% { transform: translateX(-25px); opacity: 0.1; }
    60%, 100% { transform: translateX(0); opacity: 1; }
}

/* 6. Cinematic Slide Up */
.animation-card[data-anim="slide-up"]:hover .anim-indicator {
    animation: preview-slide-up 1.3s infinite ease-in-out;
}
@keyframes preview-slide-up {
    0% { transform: translateY(20px); opacity: 0.1; }
    60%, 100% { transform: translateY(0); opacity: 1; }
}

/* 7. Cinematic Slide Down */
.animation-card[data-anim="slide-down"]:hover .anim-indicator {
    animation: preview-slide-down 1.3s infinite ease-in-out;
}
@keyframes preview-slide-down {
    0% { transform: translateY(-20px); opacity: 0.1; }
    60%, 100% { transform: translateY(0); opacity: 1; }
}

/* 8. Glitch Flash */
.animation-card[data-anim="glitch-flash"]:hover .anim-indicator {
    animation: preview-glitch-flash 1.0s infinite steps(2);
}
@keyframes preview-glitch-flash {
    0%, 100% { transform: translate(0); background: #ff0050; opacity: 1; }
    20% { transform: translate(3px, -2px); background: #00f2fe; opacity: 0.8; }
    40% { transform: translate(-3px, 2px); background: #9d4edd; opacity: 0.9; }
}

/* 9. Wobble Wiggle (IN) - moved to LOOP section below line 1922 */

/* 10. Swing Drop */
.animation-card[data-anim="swing-drop"]:hover .anim-indicator {
    transform-origin: top center;
    animation: preview-swing-drop 1.4s infinite ease-in-out;
}
@keyframes preview-swing-drop {
    0% { transform: translateY(-15px) rotate(-60deg); opacity: 0.1; }
    50% { transform: translateY(0) rotate(15deg); opacity: 1; }
    75% { transform: translateY(0) rotate(-10deg); }
    100% { transform: translateY(0) rotate(0); }
}

/* 11. Card Flip H */
.animation-card[data-anim="flip-h"]:hover .anim-indicator {
    animation: preview-flip-h 1.3s infinite ease-in-out;
}
@keyframes preview-flip-h {
    0% { transform: scaleX(0); opacity: 0.2; }
    60%, 100% { transform: scaleX(1); opacity: 1; }
}

/* 12. Card Flip V */
.animation-card[data-anim="flip-v"]:hover .anim-indicator {
    animation: preview-flip-v 1.3s infinite ease-in-out;
}
@keyframes preview-flip-v {
    0% { transform: scaleY(0); opacity: 0.2; }
    60%, 100% { transform: scaleY(1); opacity: 1; }
}

/* 13. Zoom Pop Spring */
.animation-card[data-anim="zoom-pop"]:hover .anim-indicator {
    animation: preview-zoom-pop 1.3s infinite cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes preview-zoom-pop {
    0% { transform: scale(0.2); opacity: 0.1; }
    65% { transform: scale(1.25); opacity: 1; }
    100% { transform: scale(1.0); opacity: 1; }
}

/* 14. Heartbeat Pulse (IN) - moved to LOOP section below line 1931 */

/* 15. Elastic Overshoot */
.animation-card[data-anim="elastic-in"]:hover .anim-indicator {
    animation: preview-elastic-in 1.5s infinite ease-in-out;
}
@keyframes preview-elastic-in {
    0% { transform: scale(0.1); opacity: 0.1; }
    40% { transform: scale(1.35); opacity: 1; }
    55% { transform: scale(0.85); }
    70% { transform: scale(1.1); }
    85%, 100% { transform: scale(1.0); opacity: 1; }
}

/* Timeline Filmstrip Overlay styles */
.timeline-clip .filmstrip-container {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.timeline-clip .filmstrip-frame {
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Segmented Anim Switcher Tabs --- */
.anim-segment-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 1rem;
    gap: 4px;
}

.segment-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-title);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.segment-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

.segment-btn.active {
    color: #fff;
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    box-shadow: 0 2px 10px var(--neon-pink-glow);
}

/* --- Timeline Animation Timing Overlay Bars --- */
.clip-animation-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
    display: flex;
    align-items: center;
}

.clip-animation-bar.in {
    left: 0;
    background: linear-gradient(90deg, rgba(255, 0, 80, 0.4) 0%, rgba(255, 0, 80, 0) 100%);
    border-left: 2px solid var(--neon-pink);
}

.clip-animation-bar.out {
    right: 0;
    background: linear-gradient(270deg, rgba(0, 242, 254, 0.4) 0%, rgba(0, 242, 254, 0) 100%);
    border-right: 2px solid var(--neon-cyan);
}

.anim-resize-handle {
    position: absolute;
    width: 6px;
    top: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.35);
    cursor: ew-resize;
    pointer-events: auto;
    transition: background 0.15s;
    z-index: 5;
}

.anim-resize-handle:hover {
    background: #fff;
}

.clip-animation-bar.in .anim-resize-handle {
    right: 0;
}

.clip-animation-bar.out .anim-resize-handle {
    left: 0;
}

/* --- OUT Preview Animations Hover Keys --- */
.animation-card[data-anim="fade-out"]:hover .anim-indicator {
    animation: preview-fade-out 1.2s infinite ease-in-out;
}
@keyframes preview-fade-out {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.animation-card[data-anim="zoom-out"]:hover .anim-indicator {
    animation: preview-zoom-out 1.2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes preview-zoom-out {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.1); opacity: 0; }
}

.animation-card[data-anim="slide-up-out"]:hover .anim-indicator {
    animation: preview-slide-up-out 1.2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes preview-slide-up-out {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-30px); opacity: 0; }
}

.animation-card[data-anim="slide-down-out"]:hover .anim-indicator {
    animation: preview-slide-down-out 1.2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes preview-slide-down-out {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(30px); opacity: 0; }
}

.animation-card[data-anim="slide-left-out"]:hover .anim-indicator {
    animation: preview-slide-left-out 1.2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes preview-slide-left-out {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(-30px); opacity: 0; }
}

.animation-card[data-anim="slide-right-out"]:hover .anim-indicator {
    animation: preview-slide-right-out 1.2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes preview-slide-right-out {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(30px); opacity: 0; }
}

.animation-card[data-anim="glitch-exit"]:hover .anim-indicator {
    animation: preview-glitch-exit 1.2s infinite steps(2);
}
@keyframes preview-glitch-exit {
    0% { transform: translate(0) skew(0deg); opacity: 1; }
    20% { transform: translate(-2px, 1px) skew(-5deg); opacity: 0.8; }
    40% { transform: translate(2px, -1px) skew(5deg); opacity: 0.4; }
    60% { transform: translate(-1px, 2px); opacity: 0.1; }
    80%, 100% { transform: scale(0.1); opacity: 0; }
}

.animation-card[data-anim="shrink-pop"]:hover .anim-indicator {
    animation: preview-shrink-pop 1.2s infinite ease-in-out;
}
@keyframes preview-shrink-pop {
    0% { transform: scale(1); opacity: 1; }
    20% { transform: scale(1.2); }
    100% { transform: scale(0); opacity: 0; }
}

.animation-card[data-anim="flip-out"]:hover .anim-indicator {
    animation: preview-flip-out 1.2s infinite ease-in-out;
}
@keyframes preview-flip-out {
    0% { transform: rotateY(0deg); opacity: 1; }
    100% { transform: rotateY(90deg); opacity: 0; }
}

.animation-card[data-anim="bounce-out"]:hover .anim-indicator {
    animation: preview-bounce-out 1.2s infinite ease-in-out;
}
@keyframes preview-bounce-out {
    0% { transform: translateY(0); }
    20% { transform: translateY(-5px); }
    100% { transform: translateY(35px); opacity: 0; }
}

.animation-card[data-anim="fold-out"]:hover .anim-indicator {
    animation: preview-fold-out 1.2s infinite ease-in-out;
}
@keyframes preview-fold-out {
    0% { transform: scaleY(1); opacity: 1; }
    100% { transform: scaleY(0); opacity: 0; }
}

/* --- LOOP Preview Animations Hover Keys --- */
.animation-card[data-anim="wobble"]:hover .anim-indicator {
    animation: preview-wobble-loop 1.5s infinite ease-in-out;
}
@keyframes preview-wobble-loop {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

.animation-card[data-anim="heartbeat"]:hover .anim-indicator {
    animation: preview-pulse-loop 1.2s infinite ease-in-out;
}
@keyframes preview-pulse-loop {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.25); }
    60% { transform: scale(1.1); }
}

.animation-card[data-anim="spin-loop"]:hover .anim-indicator {
    animation: preview-spin-loop 2s infinite linear;
}
@keyframes preview-spin-loop {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animation-card[data-anim="shake"]:hover .anim-indicator {
    animation: preview-shake-loop 0.5s infinite linear;
}
@keyframes preview-shake-loop {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.animation-card[data-anim="swing"]:hover .anim-indicator {
    transform-origin: top center;
    animation: preview-swing-loop 1.5s infinite ease-in-out;
}
@keyframes preview-swing-loop {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

.animation-card[data-anim="flip-loop"]:hover .anim-indicator {
    animation: preview-flip-loop 1.8s infinite ease-in-out;
}
@keyframes preview-flip-loop {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.animation-card[data-anim="pulsate"]:hover .anim-indicator {
    animation: preview-pulsate-loop 1.5s infinite ease-in-out;
}
@keyframes preview-pulsate-loop {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* --- Text Specific Preview Animations Hover Keys --- */
.text-preview {
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 5px rgba(0, 242, 254, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* 1. Typewriter */
.animation-card[data-anim="typewriter"]:hover .text-preview {
    animation: preview-typewriter 1.5s infinite steps(4);
    width: auto;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--neon-pink);
}
@keyframes preview-typewriter {
    0%, 10% { width: 0ch; }
    50%, 80% { width: 3ch; }
    90%, 100% { width: 0ch; }
}

/* 2. Blur In */
.animation-card[data-anim="blur-in"]:hover .text-preview {
    animation: preview-blur-in 1.4s infinite ease-in-out;
}
@keyframes preview-blur-in {
    0% { filter: blur(8px); opacity: 0; transform: scale(0.8); }
    50%, 100% { filter: blur(0); opacity: 1; transform: scale(1); }
}

/* 3. Letter Slide */
.animation-card[data-anim="letter-slide"]:hover .text-preview {
    animation: preview-letter-slide 1.4s infinite cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes preview-letter-slide {
    0% { transform: translateY(20px); opacity: 0; }
    50%, 100% { transform: translateY(0); opacity: 1; }
}

/* 4. Elastic Stretch */
.animation-card[data-anim="elastic-spring"]:hover .text-preview {
    animation: preview-elastic-spring 1.4s infinite ease-in-out;
}
@keyframes preview-elastic-spring {
    0%, 100% { transform: scaleX(1); }
    25% { transform: scaleX(1.6) scaleY(0.8); }
    50% { transform: scaleX(0.8) scaleY(1.2); }
}

/* 5. Blur Out */
.animation-card[data-anim="blur-out"]:hover .text-preview {
    animation: preview-blur-out 1.4s infinite ease-in-out;
}
@keyframes preview-blur-out {
    0% { filter: blur(0); opacity: 1; transform: scale(1); }
    50%, 100% { filter: blur(8px); opacity: 0; transform: scale(1.2); }
}

/* 6. Neon Flicker */
.animation-card[data-anim="neon-flicker"]:hover .text-preview {
    animation: preview-neon-flicker 0.8s infinite steps(2);
}
@keyframes preview-neon-flicker {
    0%, 100% { text-shadow: 0 0 12px var(--neon-cyan), 0 0 20px var(--neon-cyan); color: #fff; }
    50% { text-shadow: none; color: rgba(255,255,255,0.15); }
}

/* 7. Wave Bounce */
.animation-card[data-anim="wave-bounce"]:hover .text-preview {
    animation: preview-wave-bounce 1.2s infinite ease-in-out;
}
@keyframes preview-wave-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 8. Rainbow Glow */
.animation-card[data-anim="rainbow-glow"]:hover .text-preview {
    animation: preview-rainbow-glow 3s infinite linear;
}
@keyframes preview-rainbow-glow {
    0% { color: #ff0050; text-shadow: 0 0 5px #ff0050; }
    33% { color: #00f2fe; text-shadow: 0 0 5px #00f2fe; }
    66% { color: #9d4edd; text-shadow: 0 0 5px #9d4edd; }
    100% { color: #ff0050; text-shadow: 0 0 5px #ff0050; }
}

/* 9. Word Pop */
.animation-card[data-anim="word-pop"]:hover .text-preview {
    animation: preview-word-pop 1.0s infinite cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes preview-word-pop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); color: var(--neon-pink); text-shadow: 0 0 8px var(--neon-pink); }
}

/* 10. Glitch Shake */
.animation-card[data-anim="glitch-shake"]:hover .text-preview {
    animation: preview-glitch-shake 0.4s infinite linear;
}
@keyframes preview-glitch-shake {
    0%, 100% { transform: translate(0); filter: hue-rotate(0deg); }
    20% { transform: translate(-2px, 1px); filter: hue-rotate(90deg); }
    40% { transform: translate(2px, -1px); filter: hue-rotate(180deg); }
    60% { transform: translate(-1px, -2px); }
    80% { transform: translate(1px, 2px); }
}

/* 11. Karaoke */
.animation-card[data-anim="karaoke"]:hover .text-preview {
    background: linear-gradient(to right, var(--neon-pink) 50%, #fff 50%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: preview-karaoke 1.5s infinite linear;
}
@keyframes preview-karaoke {
    0% { background-position: 100% 0; }
    100% { background-position: 0% 0; }
}

/* --- Transition Settings Hover Animations --- */
.animation-card[data-anim="cross-dissolve"]:hover .anim-indicator {
    animation: preview-dissolve 1.5s infinite ease-in-out;
}
@keyframes preview-dissolve {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.15; transform: scale(0.9); }
}

.animation-card[data-anim="push-slide"]:hover .anim-indicator {
    animation: preview-push-slide 1.5s infinite cubic-bezier(0.77, 0, 0.175, 1);
}
@keyframes preview-push-slide {
    0% { transform: translateX(0); }
    50% { transform: translateX(100%); }
    50.01% { transform: translateX(-100%); }
    100% { transform: translateX(0); }
}

.animation-card[data-anim="zoom-fade"]:hover .anim-indicator {
    animation: preview-zoom-fade 1.5s infinite ease-in-out;
}
@keyframes preview-zoom-fade {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.8); opacity: 0; }
    50.01% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.animation-card[data-anim="fade-black"]:hover .anim-indicator {
    animation: preview-fade-black 1.5s infinite ease-in-out;
}
@keyframes preview-fade-black {
    0%, 100% { background: var(--neon-pink); filter: brightness(1); }
    50% { background: #000; filter: brightness(0); }
}

.animation-card[data-anim="wipe-right"]:hover .anim-indicator {
    animation: preview-wipe-right 1.5s infinite linear;
}
@keyframes preview-wipe-right {
    0% { clip-path: inset(0 100% 0 0); }
    100% { clip-path: inset(0 0 0 0); }
}

/* Timeline Transition Plus Button */
.transition-btn {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--neon-cyan);
    border: 2px solid #000;
    color: #000;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.7);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.transition-btn:hover {
    transform: translate(-50%, -50%) scale(1.3);
    background: #fff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
}

.transition-btn i {
    pointer-events: none;
}

/* Dynamic Track Header Action Buttons */

.track-action-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 2px;
    color: rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.track-action-btn.plus-btn {
    color: var(--neon-cyan);
}

.track-action-btn.plus-btn:hover {
    color: #fff;
    transform: scale(1.15);
    filter: drop-shadow(0 0 4px rgba(0, 242, 254, 0.8));
}

.track-action-btn.delete-btn {
    color: var(--neon-pink);
}

.track-action-btn.delete-btn:hover {
    color: #fff;
    transform: scale(1.15);
    filter: drop-shadow(0 0 4px rgba(255, 0, 80, 0.8));
}

/* Mobile Responsive Adjustments (< 600px) */
@media (max-width: 600px) {
    .editor-workspace {
        flex-direction: column;
    }
    .workspace-left {
        width: 100%;
    }
    .editor-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    .header-right {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Touch Device Target Precision Optimization */
@media (pointer: coarse) {
    .clip-handle-trim {
        width: 16px !important;
    }
}

