/* ==========================================
   VIDEO RECORDER & EDITOR STYLES
   ========================================== */

/* Recorder Modal */
.recorder-modal,
.editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

/* Recorder Container */
.recorder-container,
.editor-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Recorder Header */
.recorder-header,
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.recorder-header h3,
.editor-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

/* Camera Preview */
.camera-preview-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
}

#camera-preview,
#editor-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Recording Timer */
.recording-timer {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 59, 48, 0.9);
    border-radius: 20px;
    font-weight: 600;
    color: #fff;
    z-index: 10;
}

.timer-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Recording Progress */
.recording-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF3B30, #FF9500);
    width: 0;
    transition: width 0.05s linear;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
}

.filter-item {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.filter-item.active {
    border-color: #007AFF;
    background: rgba(0, 122, 255, 0.1);
}

.filter-preview {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
}

/* Recorder Controls */
.recorder-controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 2rem 1rem;
    background: rgba(0, 0, 0, 0.8);
}

.btn-record {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-record:active {
    transform: scale(0.95);
}

.rec ord-icon {
    width: 60px;
    height: 60px;
    background: #FF3B30;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-record.recording .record-icon {
    border-radius: 8px;
    width: 30px;
    height: 30px;
}

/* Upload Options */
.upload-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 2rem 1rem;
    max-width: 600px;
    margin: 2rem auto;
}

.upload-option-btn {
    padding: 2rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.upload-option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
}

.upload-option-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

.upload-option-btn.primary:hover {
    transform: translateY(-4px) scale(1.02);
}

.option-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.upload-option-btn h3 {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.upload-option-btn p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Editor Preview */
.editor-preview {
    flex: 1;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 60vh;
}

/* Editor Tabs */
.editor-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.editor-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.editor-tab.active {
    background: rgba(0, 122, 255, 0.2);
    color: #007AFF;
}

/* Editor Content */
.editor-content {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Timeline */
.timeline-container {
    padding: 1rem 0;
}

.timeline {
    position: relative;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.timeline-track {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
}

.timeline-selection {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(0, 122, 255, 0.3);
    border-left: 3px solid #007AFF;
    border-right: 3px solid #007AFF;
}

.timeline-handle {
    position: absolute;
    top: 0;
    width: 20px;
    height: 100%;
    background: #007AFF;
    cursor: ew-resize;
}

.timeline-handle.left {
    left: -10px;
    border-radius: 4px 0 0 4px;
}

.timeline-handle.right {
    right: -10px;
    border-radius: 0 4px 4px 0;
}

.timeline-playhead {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: #FF3B30;
    pointer-events: none;
}

.timeline-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.timeline-duration {
    font-weight: 600;
    color: #007AFF;
}

/* Speed Controls */
.speed-options {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.speed-btn {
    padding: 1rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.speed-btn.active {
    background: #007AFF;
    border-color: #007AFF;
}

.speed-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Filters Grid */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

.filter-option {
    aspect-ratio: 1;
    border: 3px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-option.active {
    border-color: #007AFF;
}

.filter-preview-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-weight: 600;
    font-size: 0.85rem;
    color: #fff;
}

/* CSS Filters */
.filter-grayscale {
    filter: grayscale(100%);
}

.filter-sepia {
    filter: sepia(80%);
}

.filter-saturate {
    filter: saturate(200%);
}

.filter-contrast {
    filter: contrast(150%);
}

.filter-blur {
    filter: blur(2px);
}

.filter-invert {
    filter: invert(100%);
}

.filter-vintage {
    filter: sepia(40%) contrast(120%) brightness(90%);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .upload-options {
        grid-template-columns: 1fr;
    }

    .recorder-controls,
    .editor-tabs,
    .filters-bar {
        padding: 1rem;
    }

    .btn-record {
        width: 70px;
        height: 70px;
    }

    .record-icon {
        width: 50px;
        height: 50px;
    }

    .btn-record.recording .record-icon {
        width: 25px;
        height: 25px;
    }
}