/* Custom Styles - Ergänzung zu Tailwind */

:root {
    --timeline-height: 80px;
    --ruler-height: 30px;
    --thumbnail-height: 60px;
}

/* Animations */
@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Upload Area */
.upload-dropzone {
    border: 2px dashed #4b5563;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
    padding: 3rem;
    border-radius: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-dropzone:hover {
    border-color: #9333ea;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
}

.upload-dropzone.dragging {
    border-color: #9333ea;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
    transform: scale(1.02);
}

.upload-animation i {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Video Gallery Cards */
.video-card {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: slide-up 0.4s ease-out;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: #4b5563;
}

.video-thumbnail {
    position: relative;
    padding-bottom: 56.25%;
    background: #000;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Timeline Styles */
.timeline-wrapper {
    user-select: none;
}

/* Time Ruler */
.time-ruler {
    height: var(--ruler-height);
    position: relative;
    border-bottom: 1px solid #374151;
    font-size: 11px;
    color: #9ca3af;
}

.time-marker {
    position: absolute;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 4px;
}

.time-marker::before {
    content: '';
    position: absolute;
    bottom: 0;
    width: 1px;
    height: 8px;
    background: #4b5563;
}

.time-marker.major::before {
    height: 12px;
    background: #6b7280;
}

/* Main Timeline */
.timeline-main {
    height: var(--timeline-height);
    position: relative;
    background: #111827;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
}

.timeline-background {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 9px,
        #1f2937 9px,
        #1f2937 10px
    );
}

.timeline-track {
    position: relative;
    height: 100%;
}

/* Playhead */
.timeline-playhead {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: #ef4444;
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.timeline-playhead::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -6px;
    width: 14px;
    height: 14px;
    background: #ef4444;
    border-radius: 50%;
}

/* Cut Segments */
.cut-segment {
    position: absolute;
    height: 100%;
    border-radius: 0.25rem;
    transition: opacity 0.2s ease;
    cursor: move;
}

.cut-segment:hover {
    opacity: 0.8;
}

.cut-segment.selected {
    box-shadow: 0 0 0 2px #fff;
}

/* Cut Handles */
.cut-handle {
    position: absolute;
    width: 12px;
    height: 100%;
    cursor: ew-resize;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cut-handle::before {
    content: '';
    width: 2px;
    height: 40%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1px;
    transition: all 0.2s ease;
}

.cut-handle:hover::before {
    height: 60%;
    background: #fff;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.cut-handle.left {
    left: 0;
}

.cut-handle.right {
    right: 0;
}

/* Frame Thumbnails */
.timeline-frames-container {
    height: var(--thumbnail-height);
    overflow: hidden;
    border-radius: 0.5rem;
}

.timeline-frames {
    display: flex;
    height: 100%;
    position: relative;
}

.frame-thumb {
    flex-shrink: 0;
    height: 100%;
    border-right: 1px solid #1f2937;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.frame-thumb:hover {
    transform: scaleY(1.1);
}

/* Cut List Items */
.cut-list-item {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    items-align: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.cut-list-item:hover {
    border-color: #4b5563;
    background: #1f2937;
}

.cut-color-indicator {
    width: 4px;
    height: 100%;
    border-radius: 2px;
    position: absolute;
    left: 0;
    top: 0;
}

/* Progress Indicators */
.upload-progress-item {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    padding: 1rem;
    animation: slide-up 0.3s ease-out;
}

.progress-bar-container {
    height: 6px;
    background: #374151;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #9333ea 0%, #ec4899 100%);
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(100px); }
}

/* Export Modal */
#exportModal.show, #settingsModal.show, #compressModal.show, #compressProgressModal.show, #playerModal.show {
    display: flex;
    animation: fade-in 0.3s ease-out;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #374151;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #9333ea;
}

input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.5);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: #374151;
    height: 6px;
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #9333ea;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    margin-top: -5px;
    cursor: pointer;
    transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #a855f7;
}

input[type="range"]::-moz-range-track {
    background: #374151;
    height: 6px;
    border-radius: 3px;
}

input[type="range"]::-moz-range-thumb {
    background: #9333ea;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    background: #a855f7;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .timeline-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .timeline-main {
        min-width: 600px;
    }
}