/**
 * @license
 * Mandala Studio Styles
 * Copyright (c) 2024-2026 Jolly Grid, LLC. All Rights Reserved.
 * 
 * PROPRIETARY AND CONFIDENTIAL - Unauthorized use prohibited.
 * For licensing: contact@jollygrid.com
 */
/**
 * Director Mode UI Styles
 * After Effects-inspired video editing interface
 */

/* Director Mode Container */
.director-mode-ui {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(30, 30, 30, 0.98) 0%, rgba(20, 20, 20, 1) 100%);
    border-top: 1px solid rgba(108, 92, 231, 0.5);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.director-mode-ui.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* Header */
.director-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.director-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.director-title i {
    color: #6c5ce7;
    font-size: 20px;
}

.director-actions {
    display: flex;
    gap: 10px;
}

.director-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.director-btn i {
    font-size: 14px;
}

.director-btn.preview-btn {
    background: linear-gradient(135deg, #6c5ce7 0%, #a855f7 100%);
    color: #fff;
}

.director-btn.preview-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.director-btn.render-btn {
    background: linear-gradient(135deg, #00c853 0%, #00e676 100%);
    color: #fff;
}

.director-btn.render-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.4);
}

.director-btn.close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 14px;
}

.director-btn.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Body Layout */
.director-body {
    display: grid;
    grid-template-columns: 180px 180px 1fr 180px 180px;
    gap: 15px;
    padding: 15px 20px;
    max-height: 280px;
    overflow: hidden;
}

@media (max-width: 1400px) {
    .director-body {
        grid-template-columns: 160px 160px 1fr 160px;
    }

    .render-panel {
        display: none;
    }
}

@media (max-width: 1200px) {
    .director-body {
        grid-template-columns: 150px 1fr 150px;
    }

    .render-panel,
    .presets-panel {
        display: none;
    }
}

@media (max-width: 900px) {
    .director-body {
        grid-template-columns: 1fr;
        max-height: 400px;
        overflow-y: auto;
    }
}

/* Panel Styling */
.presets-panel,
.timeline-panel,
.camera-panel,
.render-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.presets-header,
.camera-header,
.render-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.presets-header i,
.camera-header i,
.render-header i {
    color: #6c5ce7;
}

/* Presets Grid */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 5px;
}

.presets-grid::-webkit-scrollbar {
    width: 4px;
}

.presets-grid::-webkit-scrollbar-thumb {
    background: rgba(108, 92, 231, 0.5);
    border-radius: 2px;
}

.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    background: rgba(108, 92, 231, 0.2);
    border-color: rgba(108, 92, 231, 0.5);
    transform: scale(1.02);
}

.preset-btn.applied {
    background: rgba(108, 92, 231, 0.4);
    border-color: #6c5ce7;
}

.preset-icon {
    font-size: 18px;
}

.preset-name {
    font-size: 10px;
    color: #aaa;
    text-align: center;
    line-height: 1.2;
}

/* Timeline Panel */
.timeline-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timeline-header {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.timeline-time {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.timeline-duration {
    color: #666;
    font-size: 14px;
}

/* Timeline Track */
.timeline-track {
    position: relative;
    height: 60px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    overflow: hidden;
}

/* Timeline Background Pattern */
.timeline-track::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg,
            transparent,
            transparent 9.9%,
            rgba(255, 255, 255, 0.05) 10%,
            rgba(255, 255, 255, 0.05) 10.1%);
}

/* Playhead */
.timeline-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    background: #ff5555;
    box-shadow: 0 0 10px rgba(255, 85, 85, 0.5);
    z-index: 10;
    pointer-events: none;
}

.timeline-playhead::before {
    content: '';
    position: absolute;
    top: 0;
    left: -5px;
    width: 12px;
    height: 12px;
    background: #ff5555;
    border-radius: 0 0 6px 6px;
    clip-path: polygon(50% 100%, 0 0, 100% 0);
}

/* Keyframe Markers */
.timeline-keyframes {
    position: absolute;
    inset: 0;
    z-index: 5;
}

.keyframe-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #6c5ce7 0%, #a855f7 100%);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.4);
}

.keyframe-marker:hover {
    transform: translate(-50%, -50%) rotate(45deg) scale(1.2);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.6);
}

.keyframe-marker.selected {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.6);
}

/* Timeline Controls */
.timeline-controls {
    display: flex;
    gap: 8px;
}

.timeline-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeline-btn:hover {
    background: rgba(108, 92, 231, 0.2);
    border-color: rgba(108, 92, 231, 0.5);
    color: #fff;
}

.timeline-btn i {
    font-size: 10px;
}

/* Camera Controls */
.camera-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.camera-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.camera-control label {
    color: #888;
    font-size: 11px;
    font-weight: 500;
}

.camera-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    touch-action: none;
    /* Prevent scroll interference on touch devices */
}

.camera-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #6c5ce7 0%, #a855f7 100%);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.camera-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.camera-control span {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
}

.camera-control select {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

.camera-control select:focus {
    border-color: rgba(108, 92, 231, 0.5);
}

/* Render Settings */
.render-settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.render-setting {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.render-setting label {
    color: #888;
    font-size: 11px;
    font-weight: 500;
}

.render-setting select {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

.render-setting select:focus {
    border-color: rgba(108, 92, 231, 0.5);
}

.render-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.render-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6c5ce7;
    cursor: pointer;
}

.render-checkbox span {
    color: #ccc;
    font-size: 11px;
}

/* Render Progress Overlay */
.render-progress {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.render-progress.hidden {
    display: none;
}

.progress-content {
    text-align: center;
    color: #fff;
}

.progress-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid rgba(108, 92, 231, 0.3);
    border-top-color: #6c5ce7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.progress-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.progress-bar {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6c5ce7 0%, #00c853 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-percent {
    font-size: 24px;
    font-weight: 700;
    color: #6c5ce7;
}

/* =========================================================================
   TIMELAPSE BAR - Prominent horizontal bar for recording workflow
   ========================================================================= */

.timelapse-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    background: linear-gradient(180deg, rgba(231, 76, 60, 0.1) 0%, rgba(231, 76, 60, 0.05) 100%);
    border-bottom: 1px solid rgba(231, 76, 60, 0.3);
}

.timelapse-bar.recording {
    background: linear-gradient(180deg, rgba(231, 76, 60, 0.2) 0%, rgba(231, 76, 60, 0.1) 100%);
    animation: pulse-bar 2s ease-in-out infinite;
}

@keyframes pulse-bar {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

.timelapse-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timelapse-info i {
    color: #e74c3c;
    font-size: 18px;
}

.timelapse-label {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.timelapse-status {
    color: #aaa;
    font-size: 13px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.timelapse-status.recording {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.2);
    animation: pulse-recording 1.5s ease-in-out infinite;
}

@keyframes pulse-recording {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.timelapse-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.timelapse-stats.hidden {
    display: none;
}

.timelapse-stats .stat {
    color: #ccc;
    font-size: 13px;
}

.timelapse-stats .stat strong {
    color: #fff;
    font-weight: 600;
}

.timelapse-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.timelapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timelapse-btn.record-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
}

.timelapse-btn.record-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.5);
}

.timelapse-btn.record-btn i {
    animation: none;
}

.timelapse-btn.record-btn.recording i {
    animation: blink-record 1s ease-in-out infinite;
}

@keyframes blink-record {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.timelapse-btn.stop-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.timelapse-btn.stop-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
}

.timelapse-btn.create-btn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: #fff;
}

.timelapse-btn.create-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.5);
}

.timelapse-btn.clear-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
}

.timelapse-btn.clear-btn:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

.timelapse-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.timelapse-speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timelapse-speed-control.hidden {
    display: none;
}

.timelapse-speed-control label {
    font-size: 12px;
    color: #888;
}

.timelapse-speed-control select {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.timelapse-speed-control select:focus {
    outline: none;
    border-color: #6c5ce7;
}

.timelapse-speed-control select option {
    background: #2d2d2d;
    color: #fff;
}

/* Camera Style Panel */
.camera-style-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 12px;
}

.camera-style-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.camera-style-header i {
    color: #6c5ce7;
}

.camera-style-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.camera-style-selector select {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.camera-style-selector select:focus {
    border-color: rgba(108, 92, 231, 0.6);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.camera-style-selector select option {
    background: #2d2d2d;
    color: #fff;
    padding: 8px;
}

.camera-style-description {
    color: #888;
    font-size: 11px;
    line-height: 1.5;
    margin: 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    min-height: 36px;
}

.apply-style-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #6c5ce7 0%, #a855f7 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apply-style-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.apply-style-btn:active {
    transform: translateY(0);
}

.apply-style-btn i {
    font-size: 14px;
}

.camera-style-hint {
    font-weight: 400;
    font-size: 10px;
    color: #666;
    margin-left: 4px;
}

.presets-hint {
    font-weight: 400;
    font-size: 10px;
    color: #666;
    margin-left: 4px;
}