/* NovaCup Premium Stylesheet */

@font-face {
    font-family: 'Otsutome Font';
    src: url('OtsutomeFont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'おつとめフォント';
    src: url('OtsutomeFont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Variables and Design System */
:root {
    --bg-base: hsl(225, 20%, 6%);
    --bg-surface: hsl(225, 16%, 10%);
    --bg-surface-elevated: hsl(225, 14%, 15%);
    --bg-surface-highlight: hsl(225, 14%, 20%);
    
    --border-color: hsl(225, 12%, 18%);
    --border-color-light: hsl(225, 12%, 25%);
    
    --color-primary: hsl(265, 85%, 64%);
    --color-primary-hover: hsl(265, 85%, 58%);
    --color-primary-glow: hsla(265, 85%, 64%, 0.3);
    
    --color-secondary: hsl(190, 100%, 46%);
    --color-secondary-hover: hsl(190, 100%, 40%);
    --color-secondary-glow: hsla(190, 100%, 46%, 0.3);
    
    --color-accent: hsl(325, 95%, 60%);
    --color-accent-hover: hsl(325, 95%, 54%);
    
    --color-success: hsl(145, 80%, 45%);
    --color-danger: hsl(355, 80%, 55%);
    --color-danger-hover: hsl(355, 80%, 48%);
    
    --text-main: hsl(210, 20%, 95%);
    --text-muted: hsl(210, 10%, 65%);
    --text-dark: hsl(210, 10%, 45%);
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --header-height: 56px;
    --timeline-height: 280px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
    --border-radius-sm: 6px;
}

/* Reset & Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    user-select: none;
}

input, button, select, textarea {
    font-family: inherit;
    color: inherit;
}

.hidden {
    display: none !important;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color-light);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-dark);
}

/* Layout Framework */
.app-container {
    display: grid;
    grid-template-rows: var(--header-height) 1fr var(--timeline-height);
    height: 100vh;
    width: 100vw;
}

/* Header */
.app-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 10;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-icon {
    color: var(--color-primary);
    filter: drop-shadow(0 0 6px var(--color-primary-glow));
}

.logo span span {
    color: var(--color-secondary);
}

.project-title-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

#project-name {
    background: transparent;
    border: 1px solid transparent;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    width: 160px;
    transition: var(--transition-fast);
}

#project-name:hover {
    border-color: var(--border-color-light);
    background: var(--bg-surface-elevated);
}

#project-name:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--bg-surface-elevated);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.badge {
    background: var(--bg-surface-highlight);
    color: var(--color-secondary);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    border: 1px solid hsla(190, 100%, 46%, 0.2);
}

/* User Widget Header */
.user-profile-widget {
    display: flex;
    align-items: center;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color-light);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.user-badge.hidden {
    display: none !important;
}

.avatar-icon {
    width: 16px;
    height: 16px;
    color: var(--color-primary);
}

#btn-logout {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-danger);
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 50%;
    transition: var(--transition-fast);
}

#btn-logout:hover {
    background: hsla(355, 80%, 55%, 0.15);
}

#btn-logout i {
    width: 12px;
    height: 12px;
}

/* Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 8px 16px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), hsl(280, 85%, 55%));
    box-shadow: 0 4px 12px var(--color-primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--color-primary-glow);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color-light);
}

.btn-secondary:hover {
    background: var(--bg-surface-highlight);
    border-color: var(--text-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--color-primary-glow);
}

.btn-danger {
    background: var(--color-danger);
    box-shadow: 0 4px 12px hsla(355, 80%, 55%, 0.2);
}

.btn-danger:hover {
    background: var(--color-danger-hover);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 4px;
}

.btn-full {
    width: 100%;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-close-modal:hover {
    color: var(--text-main);
    transform: rotate(90deg);
}

/* Main Workspace Layout */
.app-workspace {
    display: grid;
    grid-template-columns: auto 1fr 300px;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-base);
}

/* Panels */
.panel {
    background-color: var(--bg-surface);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-left {
    display: flex;
    flex-direction: row !important;
    width: 320px;
    height: 100%;
    border-right: 1px solid var(--border-color);
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.panel-left.collapsed {
    width: 70px;
}

/* Sidebar Nav styling */
#panel-media .sidebar-nav {
    width: 70px !important;
    background: var(--bg-surface) !important;
    border-right: 1px solid var(--border-color) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 12px 0 !important;
    gap: 8px !important;
    height: 100% !important;
    flex-shrink: 0 !important;
    z-index: 10 !important;
    box-sizing: border-box !important;
}

/* Sidebar nav item styling */
#panel-media .sidebar-nav .nav-item {
    width: 58px !important;
    height: 58px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    color: var(--text-muted) !important;
    transition: all var(--transition-fast) !important;
    border-radius: var(--border-radius-sm) !important;
    font-size: 9px !important;
    font-weight: 600 !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
}

#panel-media .sidebar-nav .nav-item i {
    width: 18px !important;
    height: 18px !important;
    display: inline-block !important;
    stroke-width: 2 !important;
}

#panel-media .sidebar-nav .nav-item:hover {
    color: var(--text-main) !important;
    background: var(--bg-surface-elevated) !important;
}

#panel-media .sidebar-nav .nav-item.active {
    color: var(--color-primary) !important;
    background: rgba(122, 77, 239, 0.1) !important;
}

/* Sidebar collapse button placed at the bottom */
#panel-media .sidebar-nav .collapse-btn {
    margin-top: auto !important;
    color: var(--text-muted) !important;
}

#panel-media .sidebar-nav .collapse-btn i {
    transition: transform 0.2s ease !important;
}

/* Sidebar Drawer containing content panels */
.sidebar-drawer {
    flex: 1;
    background: var(--bg-base);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 250px;
    flex-shrink: 0;
}

.panel-left.collapsed .sidebar-drawer {
    display: none !important;
}

.panel-right {
    border-left: 1px solid var(--border-color);
}

.panel-center {
    background-color: var(--bg-base);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Tab Control Left Panel */
.panel-tabs {
    display: flex;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 14px 10px;
    font-weight: 600;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.tab-btn i {
    width: 16px;
    height: 16px;
}

.tab-btn:hover {
    color: var(--text-main);
    background: var(--bg-surface-elevated);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: var(--bg-surface-elevated);
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tab-content.hidden {
    display: none !important;
}

.panel-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Upload Media Zone */
.upload-zone {
    border: 2px dashed var(--border-color-light);
    border-radius: var(--border-radius);
    padding: 24px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: hsla(225, 16%, 10%, 0.5);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--color-primary);
    background: var(--color-primary-glow);
    box-shadow: 0 0 15px var(--color-primary-glow);
}

.upload-icon {
    width: 36px;
    height: 36px;
    color: var(--text-muted);
    transition: transform var(--transition-normal);
}

.upload-zone:hover .upload-icon {
    color: var(--color-primary);
    transform: translateY(-4px);
}

/* --- CapCut Subtitle Cards --- */
.subtitle-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all 0.2s ease-out;
}

.subtitle-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.subtitle-card .card-icon {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    transition: color 0.2s;
    flex-shrink: 0;
}

.subtitle-card:hover .card-icon {
    color: var(--text-light);
}

.subtitle-card#btn-auto-subtitles .card-icon {
    color: var(--color-primary);
}

.subtitle-card#btn-auto-lyrics .card-icon {
    color: var(--color-secondary);
}

.subtitle-card .card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.subtitle-card .card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.subtitle-card .gem-icon {
    width: 12px;
    height: 12px;
    color: #a855f7;
}

.subtitle-card .card-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.upload-title {
    font-size: 13px;
    font-weight: 600;
}

.upload-sub {
    font-size: 10px;
    color: var(--text-muted);
}

/* Assets List */
.assets-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.asset-item {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 6px;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-fast);
    overflow: hidden;
}

.asset-item:hover {
    border-color: var(--color-primary);
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.asset-preview-container {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 4px;
    background: var(--bg-base);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    position: relative;
}

.asset-preview-container img, .asset-preview-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asset-preview-container i {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
}

.asset-type-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-main);
    font-size: 8px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 3px;
}

.asset-name {
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.asset-duration {
    font-size: 9px;
    color: var(--text-muted);
}

.btn-add-asset-to-timeline {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(-5px);
    transition: all var(--transition-fast);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.asset-item:hover .btn-add-asset-to-timeline {
    opacity: 1;
    transform: translateY(0);
}

.btn-add-asset-to-timeline:hover {
    background: var(--color-primary-hover);
    transform: scale(1.1);
}

/* Preset Cards (Text panel) */
.text-presets-grid, .backgrounds-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.preset-card, .bg-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    gap: 6px;
}

.preset-card:hover, .bg-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.preset-preview {
    font-size: 18px;
    color: var(--text-main);
    text-align: center;
}

.preset-name {
    font-size: 10px;
    color: var(--text-muted);
}

.bg-card {
    position: relative;
    overflow: hidden;
}

.bg-card span {
    z-index: 2;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.bg-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.2);
    z-index: 1;
}

/* Subtitle Import Styles */
.subtitle-upload-box {
    border: 1px dashed var(--border-color-light);
    background: var(--bg-surface-elevated);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.subtitle-upload-box:hover {
    border-color: var(--color-secondary);
}

.sub-icon {
    width: 28px;
    height: 28px;
    color: var(--color-secondary);
}

.subtitles-list-container {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 150px;
}

.subtitles-list {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.empty-list-text {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
}

.subtitle-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color-light);
    border-radius: 4px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.subtitle-item:hover {
    border-color: var(--color-secondary);
    background: var(--bg-surface-highlight);
}

.sub-item-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    flex: 1;
}

.sub-item-text {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-item-time {
    font-family: monospace;
    font-size: 9px;
    color: var(--text-muted);
}

.btn-delete-sub {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 4px;
}

.btn-delete-sub:hover {
    color: var(--color-danger);
    background: rgba(255,255,255,0.05);
}

.btn-delete-sub i {
    width: 12px;
    height: 12px;
}

/* Center Player Area */
.player-container {
    width: 100%;
    max-width: 1000px;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.canvas-wrapper {
    background: #141416;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
    position: relative;
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    box-sizing: border-box;
}

.canvas-aspect-ratio {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

#video-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    cursor: default;
}

/* Playback Control Bar */
.player-controls {
    background: var(--bg-surface);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.time-display {
    font-family: monospace;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
    width: 120px;
}

.time-separator {
    color: var(--text-dark);
}

#total-duration {
    color: var(--text-muted);
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.control-btn i {
    width: 16px;
    height: 16px;
}

.control-btn:hover {
    color: var(--text-main);
    background: var(--bg-surface-elevated);
}

.play-btn {
    background: var(--color-primary);
    color: #fff;
    width: 42px;
    height: 42px;
    box-shadow: 0 4px 10px var(--color-primary-glow);
}

.play-btn:hover {
    background: var(--color-primary-hover);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 6px 14px var(--color-primary-glow);
}

.play-btn:active {
    transform: scale(0.95);
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 120px;
}

#volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-surface-elevated);
    height: 4px;
    border-radius: 2px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 0 4px var(--color-secondary-glow);
}

#volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--color-secondary-hover);
}

/* Right Panel Properties Inspector */
.panel-header-inside {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header-inside h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
}

.prop-state {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.prop-state.hidden {
    display: none !important;
}

#prop-empty-state {
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    color: var(--text-dark);
}

#prop-empty-state p {
    font-size: 12px;
    line-height: 1.5;
}

.prop-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.border-top {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.prop-group h4 {
    font-size: 13px;
    font-weight: 600;
}

.prop-subtitle {
    font-size: 10px;
    color: var(--text-muted);
    word-break: break-all;
}

.prop-group label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.range-with-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-with-value input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-surface-elevated);
    height: 4px;
    border-radius: 2px;
    outline: none;
}

.range-with-value input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 0 4px var(--color-primary-glow);
}

.range-with-value span {
    font-family: monospace;
    font-size: 11px;
    width: 32px;
    text-align: right;
}

.prop-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.prop-group input[type="number"], .prop-group select, .prop-group textarea {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius-sm);
    padding: 6px 10px;
    font-size: 12px;
    outline: none;
    transition: var(--transition-fast);
}

.prop-group input[type="number"]:focus, .prop-group select:focus, .prop-group textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.prop-group input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: none;
    width: 100%;
    height: 28px;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
}

.prop-group input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius-sm);
}

/* Timeline Layout */
.app-timeline {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-rows: 40px 1fr;
    overflow: hidden;
    position: relative;
    z-index: 5;
}

/* Timeline Toolbar */
.timeline-toolbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 4px 0;
    flex: 1;
    min-width: 0;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.toolbar-left::-webkit-scrollbar {
    display: none;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Media queries for responsive timeline toolbar */
@media (max-width: 2000px) {
    .toolbar-left .btn-tool span {
        display: none;
    }
    .toolbar-left .btn-tool {
        padding: 6px 8px;
        gap: 0;
    }
}

@media (max-width: 1750px) {
    .toolbar-right .btn-tool span {
        display: none;
    }
    .toolbar-right .btn-tool {
        padding: 6px 8px;
        gap: 0;
    }
    .zoom-controls {
        gap: 4px;
    }
}

.btn-tool:disabled {
    opacity: 0.25 !important;
    cursor: not-allowed !important;
    background: transparent !important;
    color: var(--text-muted, #8a8c9e) !important;
}

.btn-tool {
    background: transparent;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--border-radius-sm, 6px);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #8a8c9e);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

.btn-tool i {
    width: 14.5px;
    height: 14.5px;
}

.btn-tool:hover:not(:disabled) {
    color: var(--text-white, #ffffff);
    background: rgba(255, 255, 255, 0.05);
}

.btn-tool:active:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

#zoom-value {
    font-size: 10px;
    font-family: monospace;
    color: var(--text-muted);
}

/* Timeline Lanes and Ruler */
.timeline-body-wrapper {
    display: grid;
    grid-template-columns: 200px 1fr;
    overflow: hidden;
    height: 100%;
}

.track-headers {
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: grid;
    grid-template-rows: 30px repeat(4, 48px);
}

.track-header-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
}

.track-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.track-header-title i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.track-header-title span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-actions-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-track-add {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.btn-track-add:hover {
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    transform: scale(1.1);
}

.btn-track-add i {
    width: 12px;
    height: 12px;
}

.btn-track-mute {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.btn-track-mute:hover {
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    transform: scale(1.1);
}

.btn-track-mute.muted {
    color: var(--theme-danger, #ef4444);
}

.btn-track-mute i {
    width: 12px;
    height: 12px;
}

.ruler-header {
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-color-light);
}

.track-header-cell[data-track-type="text"] i {
    color: var(--color-primary);
}

.track-header-cell[data-track-type="video"] i {
    color: var(--color-secondary);
}

.track-header-cell[data-track-type="audio"] i {
    color: var(--color-success);
}

/* Scrollable timeline contents */
.timeline-content-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    height: 100%;
    position: relative;
    background: var(--bg-base);
}

.timeline-scroll-content {
    min-height: 100%;
    position: relative;
    width: 2000px;
}

/* Time Ruler */
.timeline-ruler {
    height: 30px;
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-color-light);
    position: relative;
}

.ruler-tick {
    position: absolute;
    bottom: 0;
    height: 100%;
    width: 1px;
    background: var(--border-color);
}

.ruler-tick.major {
    background: var(--border-color-light);
    height: 15px;
}

.ruler-label {
    position: absolute;
    left: 4px;
    top: 4px;
    font-size: 9px;
    font-family: monospace;
    color: var(--text-muted);
}

/* Draggable Playhead */
.timeline-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 1px;
    z-index: 100;
    pointer-events: none;
}

.playhead-line {
    width: 2px;
    height: 100%;
    background-color: var(--color-accent);
    box-shadow: 0 0 8px var(--color-accent);
    margin-left: -1px;
}

.playhead-handle {
    position: absolute;
    top: 0;
    left: -7px;
    width: 14px;
    height: 18px;
    background: var(--color-accent);
    border-radius: 0 0 3px 3px;
    cursor: ew-resize;
    pointer-events: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    clip-path: polygon(0% 0%, 100% 0%, 100% 60%, 50% 100%, 0% 60%);
}

/* Track lanes */
.tracks-container {
    display: grid;
    grid-template-rows: repeat(4, 48px);
}

.track-lane {
    height: 48px;
    position: relative;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-base) 100%);
}

.track-lane::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 100%;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 100%;
    pointer-events: none;
}

/* Clips */
.timeline-clip {
    position: absolute;
    --gap: 2px;
    --available-height: 36px;
    --clip-height: calc((var(--available-height) - (var(--total-lanes, 1) - 1) * var(--gap)) / var(--total-lanes, 1));
    height: var(--clip-height);
    top: calc(6px + var(--lane-index, 0) * (var(--clip-height) + var(--gap)));
    transition: top 0.2s ease-out, height 0.2s ease-out;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius-sm);
    color: var(--text-main);
    display: flex;
    align-items: center;
    padding: 0 10px;
    cursor: grab;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.timeline-clip:active {
    cursor: grabbing;
}

.timeline-clip.selected {
    border-color: var(--selected-color, var(--color-primary)) !important;
    box-shadow: 0 0 10px var(--selected-glow-color, var(--color-primary-glow));
    background: var(--selected-bg, var(--bg-surface-highlight));
    z-index: 10;
}

.clip-name {
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 6px;
    flex: 1;
}

/* Clip Trim Handles */
.clip-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 6px;
    background: rgba(255, 255, 255, 0.15);
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clip-handle::after {
    content: '';
    width: 2px;
    height: 12px;
    background: rgba(255,255,255,0.4);
    border-radius: 1px;
}

.clip-handle:hover {
    background: rgba(255, 255, 255, 0.35);
}

.clip-handle-left {
    left: 0;
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

.clip-handle-right {
    right: 0;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

/* Track Lane Specific Styles */
#track-text .timeline-clip {
    --selected-color: var(--color-primary);
    --selected-glow-color: var(--color-primary-glow);
    border-left: 4px solid var(--color-primary);
}

#track-video .timeline-clip {
    --selected-color: var(--color-secondary);
    --selected-glow-color: var(--color-secondary-glow);
    border-left: 4px solid var(--color-secondary);
}

#track-audio .timeline-clip {
    --selected-color: var(--color-success);
    --selected-glow-color: hsla(145, 80%, 45%, 0.3);
    border-left: 4px solid var(--color-success);
}

/* Modal Backdrops */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition-normal);
}

.modal-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

.modal {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    overflow: hidden;
    animation: modal-enter var(--transition-normal);
}

@keyframes modal-enter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-weight: 600;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group select {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.form-group select:focus {
    border-color: var(--color-primary);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    box-sizing: border-box;
    background: #1e1e24;
    border: 1px solid var(--border-color-light);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 14px;
    color: #f0f0f5;
    outline: none;
    transition: var(--transition-fast);
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.form-group input::placeholder {
    color: #6b7280;
}

/* ---- AUTH MODAL SPECIFICS ---- */
.email-auth-modal .modal-body,
.phone-auth-modal .modal-body {
    padding: 24px;
    gap: 0;
}

.email-auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Password field wrapper - positions the eye toggle correctly */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper input {
    padding-right: 44px !important;
}

.btn-toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.btn-toggle-password:hover {
    color: var(--color-primary);
}

/* Links in auth modals */
.btn-link {
    background: none;
    border: none;
    color: #a78bfa;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 4px;
    text-decoration: none;
    transition: color 0.15s;
}

.btn-link:hover {
    color: #c4b5fd;
    text-decoration: underline;
}

/* Toggle row: "¿No tienes cuenta? Registrarse" */
.email-auth-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.email-auth-divider {
    display: none;
}

/* Error messages */
.auth-error-msg {
    background: rgba(234, 67, 53, 0.12);
    border: 1px solid rgba(234, 67, 53, 0.35);
    border-radius: 6px;
    color: #f87171;
    font-size: 12px;
    padding: 8px 12px;
    line-height: 1.5;
}

.auth-error-msg.hidden {
    display: none;
}

/* reCAPTCHA - dark container, hides white iframe background */
#recaptcha-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 14px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #1e1e24;
    min-height: 78px;
}

#recaptcha-container iframe {
    border-radius: 6px;
}


.export-info-text {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Project list styles */
.projects-actions {
    display: flex;
    gap: 10px;
}

.projects-list {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.project-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-fast);
}

.project-item:last-child {
    border-bottom: none;
}

.project-item:hover {
    background: var(--bg-surface-highlight);
}

.project-item-name {
    font-size: 12px;
    font-weight: 600;
}

.project-item-date {
    font-size: 9px;
    color: var(--text-muted);
}

.project-item-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(255,255,255,0.05);
}

.btn-icon.btn-danger:hover {
    color: var(--color-danger);
    background: hsla(355, 80%, 55%, 0.15);
}

.btn-icon i {
    width: 14px;
    height: 14px;
}

/* Export Progress States */
.export-progress {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
}

.progress-spinner {
    animation: rotate 2s linear infinite;
}

.spinner-icon {
    width: 48px;
    height: 48px;
    color: var(--color-primary);
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-surface-elevated);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    transition: width 0.1s linear;
}

#export-percentage {
    font-family: monospace;
    font-size: 14px;
    font-weight: 700;
}

/* Export Success State */
.export-success {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
}

.success-icon-wrapper {
    background: hsla(145, 80%, 45%, 0.1);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon {
    width: 36px;
    height: 36px;
    color: var(--color-success);
}

/* Modal Tab Content and Cards */
.modal-tab-content.hidden {
    display: none !important;
}

.effect-card, .anim-card, .filter-card {
    transition: all var(--transition-fast);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    border: 2px solid transparent !important;
}

.effect-card:hover, .anim-card:hover, .filter-card:hover {
    border-color: var(--color-primary-hover) !important;
    background: var(--bg-surface-elevated) !important;
    color: var(--text-main);
}

.effect-card.active, .anim-card.active, .filter-card.active {
    border-color: var(--color-primary) !important;
    background: var(--color-primary-glow) !important;
    color: var(--text-main) !important;
    box-shadow: 0 0 8px var(--color-primary-glow);
}

/* Timeline Transition Handle between adjacent clips */
.timeline-transition-handle {
    position: absolute;
    width: 24px;
    height: 24px;
    top: 12px;
    z-index: 20;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    transition: all var(--transition-fast);
}

.timeline-transition-handle:hover {
    border-color: var(--color-primary);
    color: var(--text-main);
    transform: scale(1.1);
    background: var(--bg-surface-highlight);
}

.timeline-transition-handle i {
    width: 12px;
    height: 12px;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-base);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.loading-logo .logo-icon {
    font-size: 32px;
    color: var(--color-primary);
    filter: drop-shadow(0 0 8px var(--color-primary-glow));
}

.loading-logo span span {
    color: var(--color-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: loading-spin 1s linear infinite;
    box-shadow: 0 0 10px var(--color-primary-glow);
}

@keyframes loading-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* Welcome / Split Login Screen */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    background-color: var(--bg-base);
    display: flex;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.welcome-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.welcome-split {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Left Side: Mockup & Features */
.welcome-left {
    flex: 1.2;
    background: linear-gradient(135deg, hsl(225, 20%, 3%), hsl(225, 15%, 7%));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-right: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.welcome-left::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, var(--color-primary-glow) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.welcome-left::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, var(--color-secondary-glow) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.welcome-preview-container {
    width: 90%;
    max-width: 580px;
    aspect-ratio: 16/9;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color-light);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 35px var(--color-primary-glow);
    z-index: 1;
    margin-bottom: 30px;
    background: #000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-preview-container:hover {
    transform: translateY(-6px) scale(1.01);
}

.welcome-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.welcome-carousel {
    max-width: 500px;
    text-align: center;
    z-index: 1;
}

.welcome-slide h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-main), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.welcome-slide p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Right Side: Login Panel */
.welcome-right {
    flex: 1;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}

.welcome-login-box {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
}

.welcome-logo {
    position: absolute;
    top: 32px;
    left: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1px;
    color: #0f1115;
}

.welcome-logo .logo-icon {
    width: 26px;
    height: 26px;
    color: var(--color-primary);
    filter: drop-shadow(0 0 4px var(--color-primary-glow));
}

.welcome-logo span span {
    color: var(--color-secondary);
}

.welcome-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    color: #0f1115;
    letter-spacing: -0.5px;
    text-align: center;
}

.welcome-subtitle {
    font-size: 13px;
    color: #5c5f66;
    margin-bottom: 30px;
    text-align: center;
}

.welcome-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

/* Custom CapCut buttons styles */
.btn-welcome-login {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.btn-welcome-login:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.btn-welcome-login:active {
    transform: translateY(1px);
}

.btn-welcome-login.personalized {
    background: #0f1115;
    border-color: #0f1115;
    box-shadow: 0 4px 12px rgba(15, 17, 21, 0.15);
}

.btn-welcome-login.personalized:hover {
    background: #1e293b;
    border-color: #1e293b;
    box-shadow: 0 6px 16px rgba(15, 17, 21, 0.25);
}

.btn-welcome-login.personalized .btn-text {
    color: #ffffff;
}

.btn-welcome-login.personalized .btn-icon-wrapper i,
.btn-welcome-login.personalized .btn-icon-wrapper svg {
    color: #ffffff;
}

.btn-icon-wrapper {
    position: absolute;
    left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.btn-icon-wrapper i,
.btn-icon-wrapper svg {
    width: 20px;
    height: 20px;
    color: #0f1115;
}

.btn-text {
    width: 100%;
    text-align: center;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: #0f1115;
}

.welcome-terms {
    font-size: 12px;
    color: #5c5f66;
    line-height: 1.6;
    text-align: center;
    margin-top: 10px;
}

.welcome-terms a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.welcome-terms a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

/* User forms */
.login-username-form-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideDownWelcome 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-username-form-container.hidden {
    display: none !important;
}

@keyframes slideDownWelcome {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.welcome-login-form input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: #0f1115;
    transition: border-color var(--transition-fast);
}

.welcome-login-form input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

/* Dashboard Layout */
.dashboard-screen {
    display: flex;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-base);
    color: var(--text-main);
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dashboard-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Sidebar */
.dashboard-sidebar {
    width: 240px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
}

.dash-create-btn {
    margin-top: 10px;
    padding: 12px;
    font-size: 14px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    box-shadow: 0 4px 15px var(--color-primary-glow);
}

.dashboard-nav {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dashboard-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.dashboard-nav .nav-item:hover {
    color: var(--text-main);
    background: var(--bg-surface-elevated);
}

.dashboard-nav .nav-item.active {
    color: var(--color-secondary);
    background: hsla(190, 100%, 46%, 0.1);
    border: 1px solid hsla(190, 100%, 46%, 0.2);
}

/* Main Area */
.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-header {
    height: 70px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.dash-welcome-text h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

.dash-welcome-text p {
    font-size: 11px;
    color: var(--text-muted);
}

.dashboard-scrollable-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.dash-section h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.dash-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.dash-feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.dash-feature-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.feat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.feat-icon-wrapper i {
    width: 24px;
    height: 24px;
    color: #fff;
}

.feat-icon-wrapper.video-edit {
    background: linear-gradient(135deg, var(--color-primary), hsl(280, 85%, 55%));
}

.feat-icon-wrapper.chroma {
    background: linear-gradient(135deg, var(--color-secondary), hsl(175, 100%, 40%));
}

.feat-icon-wrapper.image-editor {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
}

.feat-icon-wrapper.subtitles {
    background: linear-gradient(135deg, var(--color-accent), hsl(340, 95%, 55%));
}

.feat-info h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.feat-info p {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Templates Grid */
.dash-templates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dash-template-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.dash-template-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.temp-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.temp-icon-wrapper i {
    width: 24px;
    height: 24px;
    color: #fff;
}

.temp-info h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.temp-info p {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Recent Projects Grid */
.dash-projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.dash-project-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    display: flex;
    flex-direction: column;
}

.dash-project-card:hover {
    border-color: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.dash-project-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, var(--bg-surface-elevated), var(--border-color));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.dash-project-thumbnail i {
    width: 36px;
    height: 36px;
    color: var(--text-muted);
}

.dash-project-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 10px;
    font-family: monospace;
    padding: 2px 6px;
    border-radius: 4px;
}

.dash-project-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dash-project-name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: var(--text-muted);
}

.btn-dash-delete-project {
    background: transparent;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.btn-dash-delete-project:hover {
    color: var(--color-danger);
    background: hsla(355, 80%, 55%, 0.15);
}

.btn-dash-delete-project i {
    width: 14px;
    height: 14px;
}

.dash-empty-projects {
    grid-column: 1 / -1;
    background: var(--bg-surface-elevated);
    border: 1px dashed var(--border-color-light);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.dash-empty-projects i {
    width: 48px;
    height: 48px;
    color: var(--text-dark);
}

/* Utility classes */
.btn-full {
    width: 100%;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
}

.dash-user-widget {
    display: flex;
    align-items: center;
}

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header-row h3 {
    margin-bottom: 0 !important;
}

/* Sidebar Backdrop default hidden on desktop */
.sidebar-backdrop {
    display: none;
}

/* Aspect Ratio Styles - Pure CSS approach so controls never move */
.canvas-aspect-ratio {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    padding-top: 0 !important;
}

.canvas-aspect-ratio.aspect-16-9 {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.canvas-aspect-ratio.aspect-9-16 {
    width: auto;
    height: 100%;
    max-width: 100%;
    aspect-ratio: 9 / 16;
}

.canvas-aspect-ratio.aspect-1-1 {
    width: auto;
    height: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
}

.canvas-aspect-ratio.aspect-4-5 {
    width: auto;
    height: 100%;
    max-width: 100%;
    aspect-ratio: 4 / 5;
}

/* Mobile helper classes (Desktop default: hidden) */
.mobile-only, .mobile-only-inline {
    display: none !important;
}

/* Mobile & Desktop Device Adaptive Layouts */

/* 1. ASPECT RATIO STABLE VIEWS */
.canvas-aspect-ratio {
    position: relative !important;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    aspect-ratio: var(--aspect-ratio, 16/9) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: 0 !important;
}

#video-canvas {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    display: block !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7) !important;
    border-radius: 4px !important;
    background-color: #000 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* 2. DEVICE GENERAL RULES & RESPONSIVE TWEAKS */
body {
    -webkit-tap-highlight-color: transparent;
}

/* Touch targets on mobile/touch interfaces */
.device-mobile button, 
.device-mobile .btn, 
.device-mobile .control-btn, 
.device-mobile select, 
.device-mobile input {
    min-height: 40px;
}

/* Mobile-only visibility helper classes */
.mobile-only, .mobile-only-inline {
    display: none !important;
}
.device-mobile .mobile-only {
    display: block !important;
}
.device-mobile .mobile-only-inline {
    display: inline-flex !important;
}

/* 3. MOBILE DEVICE SPECIFIC LAYOUT */
.device-mobile.app-container,
.device-mobile .app-container {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    height: 100dvh !important;
    width: 100vw !important;
    overflow: hidden !important;
}

/* Header customization for mobile */
.device-mobile .app-header {
    height: 48px !important;
    padding: 0 12px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    background-color: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.device-mobile .app-header .header-left .logo,
.device-mobile .app-header .project-title-container,
.device-mobile .app-header .header-center,
.device-mobile .app-header .header-right #btn-load-demo,
.device-mobile .app-header .header-right #btn-projects-modal,
.device-mobile .app-header .header-right #btn-login-modal,
.device-mobile .app-header .header-right #user-profile-section {
    display: none !important;
}

.device-mobile .app-header .header-left {
    display: flex !important;
    align-items: center !important;
}

.device-mobile .app-header .header-right {
    margin-left: auto;
}

.device-mobile .app-header #btn-export-modal {
    padding: 6px 12px !important;
    min-height: 32px !important;
    font-size: 12px !important;
}

/* Workspace column layout */
.device-mobile .app-workspace {
    flex-direction: column !important;
    flex: 1 !important;
    display: flex !important;
    overflow: hidden !important;
}

/* Hide sidebars on workspace and convert drawer & properties to slide-up sheets */
.device-mobile .panel-left,
.device-mobile .panel-right {
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    overflow: visible !important;
    border: none !important;
    background: transparent !important;
    display: block !important;
}

.device-mobile .sidebar-nav {
    display: none !important;
}

.device-mobile .sidebar-drawer,
.device-mobile #panel-properties {
    position: fixed !important;
    bottom: -100% !important; /* Slide out bottom */
    left: 0 !important;
    width: 100vw !important;
    height: 380px !important;
    background-color: var(--bg-surface) !important;
    border-top: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    z-index: 1250 !important;
    box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.65) !important;
    transition: bottom var(--transition-normal) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.device-mobile .sidebar-drawer.open,
.device-mobile #panel-properties:not(.mobile-hidden) {
    bottom: 0 !important; /* Slide in bottom */
}

/* Mobile Drawer Header */
.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface-elevated);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: var(--text-main);
    flex-shrink: 0;
}

.btn-close-drawer {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.btn-close-drawer:hover {
    background: var(--bg-surface-highlight);
    color: var(--text-main);
}

.device-mobile .sidebar-drawer .tab-content {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 16px 20px 80px 20px !important; /* Bottom padding to prevent visual overlaps */
}

.device-mobile #panel-properties .panel-header-inside {
    padding: 12px 20px !important;
    background: var(--bg-surface-elevated) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.device-mobile #panel-properties .panel-body-inside {
    padding: 16px 20px 80px 20px !important;
    overflow-y: auto !important;
    flex: 1 !important;
}

/* Center player preview space allocation */
.device-mobile .panel-center {
    flex: 0 0 auto !important;
    height: 35vh !important;
    min-height: 250px !important;
    padding: 8px !important;
    background-color: #000 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
}

.device-mobile .player-container {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.device-mobile .canvas-wrapper {
    flex: 1 !important;
    min-height: 0 !important;
    background: #000 !important;
    border: none !important;
    box-shadow: none !important;
}

/* Mobile Player Controls */
.device-mobile .player-controls {
    padding: 8px 12px !important;
    border-radius: var(--border-radius-sm) !important;
    background: rgba(16, 16, 20, 0.85) !important;
    gap: 12px !important;
    margin-top: 4px !important;
    flex-shrink: 0 !important;
    width: 100% !important;
}

.device-mobile .player-controls .volume-container {
    display: none !important; /* Hide volume slider on mobile */
}

.device-mobile .player-controls .time-display {
    width: auto !important;
    font-size: 12px !important;
}

/* Timeline on mobile */
.device-mobile .app-timeline {
    flex: 1 !important;
    height: auto !important;
    min-height: 200px !important;
    flex-shrink: 0 !important;
    border-top: 1px solid var(--border-color) !important;
    background-color: var(--bg-surface) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.device-mobile .timeline-toolbar {
    display: flex !important;
    height: 48px !important;
    padding: 4px 12px !important;
    justify-content: center !important;
    gap: 16px !important;
    background: var(--bg-darker) !important;
    overflow-x: auto !important;
}

.device-mobile .timeline-body-wrapper {
    flex: 1 !important;
    display: flex !important;
    overflow: hidden !important;
}

.device-mobile .track-headers {
    width: 44px !important;
    flex-shrink: 0 !important;
    grid-template-rows: 24px repeat(4, 36px) !important;
}

.device-mobile .track-header-cell {
    width: 44px !important;
    padding: 2px !important;
    height: 36px !important;
    justify-content: center !important;
}

.device-mobile .track-header-cell.ruler-header {
    height: 24px !important;
}

.device-mobile .track-header-title i {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
}

.device-mobile .track-header-title span,
.device-mobile .btn-track-add,
.device-mobile .btn-track-mute,
.device-mobile .track-actions-wrapper {
    display: none !important;
}

.device-mobile .timeline-content-scroll {
    flex: 1 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

.device-mobile .timeline-ruler {
    height: 24px !important;
}

.device-mobile .tracks-container {
    grid-template-rows: repeat(4, 36px) !important;
}

.device-mobile .track-lane {
    height: 50px !important;
    margin-bottom: 4px !important;
}

.device-mobile .timeline-clip {
    --available-height: 40px !important;
    height: 40px !important;
    top: 5px !important;
}

/* Touch trim handles */
.device-mobile .clip-handle {
    width: 14px !important;
    background-color: var(--color-primary) !important;
    opacity: 0.9 !important;
}

.device-mobile .clip-handle::after {
    content: '' !important;
    width: 2px !important;
    height: 12px !important;
    background: #fff !important;
    border-radius: 1px !important;
}

.device-mobile .assets-list {
    grid-template-columns: 1fr !important; /* Stack assets list */
}

.device-mobile .welcome-split {
    flex-direction: column !important;
}

/* 4. MOBILE BOTTOM NAVIGATION SYSTEM */
.device-mobile .mobile-bottom-nav {
    display: flex !important;
    background-color: var(--bg-surface) !important;
    border-top: 1px solid var(--border-color) !important;
    height: 56px !important;
    width: 100vw !important;
    align-items: center !important;
    justify-content: space-around !important;
    flex-shrink: 0 !important;
    z-index: 1100 !important;
}

.device-mobile .mobile-clip-action-bar {
    display: flex !important;
    background-color: var(--bg-surface-elevated) !important;
    border-top: 1px solid var(--border-color) !important;
    height: 58px !important;
    width: 100vw !important;
    align-items: center !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    z-index: 1100 !important;
    padding: 0 12px !important;
    gap: 16px !important;
    -webkit-overflow-scrolling: touch;
}

.device-mobile .mobile-clip-action-bar::-webkit-scrollbar {
    display: none;
}

/* Modal Bottom Sheets on Mobile */
.device-mobile .modal-backdrop {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 2000 !important;
}

.device-mobile .modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    border: 1px solid var(--border-color) !important;
    border-bottom: none !important;
    margin: 0 !important;
    transform: none !important;
    animation: slide-up-sheet var(--transition-normal);
}

@keyframes slide-up-sheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.device-mobile .modal-header {
    padding: 14px 20px !important;
}

.device-mobile .modal-body {
    padding: 16px 20px !important;
}


/* Transition Categories styling */
.trans-categories {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 4px;
    margin-bottom: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color, #2a2b36);
    padding: 4px;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}
.trans-categories::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}
.trans-categories {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.trans-cat-btn {
    background: transparent;
    border: none;
    color: var(--text-muted, #8a8c9e);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: center;
}
.trans-cat-btn:hover {
    color: var(--text-white, #ffffff);
}
.trans-cat-btn.active {
    color: #00F3FF;
    background: transparent;
    border-bottom: 2px solid #00F3FF;
    border-radius: 0;
    box-shadow: none;
}
.trans-categories-wrapper::-webkit-scrollbar {
    display: none;
}

/* Sidebar Premium Grid and Cards for Transitions, Effects, Filters */
.sidebar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

#sidebar-transition-grid, #timeline-transition-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
}
#sidebar-transition-grid .sidebar-card, #timeline-transition-grid .sidebar-card {
    background: #1e1e22; 
    border-radius: 6px; 
    padding: 8px 4px;
    min-height: 48px;
    border: 1px solid transparent !important;
}
#sidebar-transition-grid .sidebar-card:hover, #timeline-transition-grid .sidebar-card:hover {
    background: #2a2a30;
    border-color: #333 !important;
}

.sidebar-card {
    background: var(--bg-surface-elevated);
    text-align: center;
    padding: 12px 6px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    border: 2px solid transparent !important;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    user-select: none;
}

.sidebar-card:hover {
    border-color: var(--color-primary-hover) !important;
    background: var(--bg-surface-elevated) !important;
    color: var(--text-main);
}

.sidebar-card.active {
    border-color: var(--color-primary) !important;
    background: var(--color-primary-glow) !important;
    color: var(--text-main) !important;
    box-shadow: 0 0 8px var(--color-primary-glow);
}

/* Adjust grid for mobile view */
@media (max-width: 768px) {
    .sidebar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Editor Categories Dropdown Menu */
.editor-menu-container {
    position: relative;
    display: inline-block;
}

.editor-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 170px;
    background: hsla(225, 14%, 10%, 0.95) !important;
    border: 1px solid var(--border-color-light) !important;
    border-radius: var(--border-radius-sm);
    padding: 6px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    animation: fadeInMenu 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.editor-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.editor-menu-item i {
    width: 14px;
    height: 14px;
    transition: transform var(--transition-fast);
}

.editor-menu-item:hover {
    background: var(--bg-surface-highlight);
    color: var(--color-primary) !important;
}

.editor-menu-item:hover i {
    transform: scale(1.15);
}

/* Audio Preset Cards */
.audio-preset-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    transition: all var(--transition-fast);
}

.audio-preset-card:hover {
    border-color: var(--color-secondary);
    background: var(--bg-surface-highlight);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.audio-preset-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
    flex: 1;
    text-align: left;
}

.audio-preset-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-preset-dur {
    font-size: 9px;
    color: var(--text-muted);
    font-family: monospace;
}

.audio-preset-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-play-preset, .btn-add-preset {
    background: transparent;
    border: 1px solid var(--border-color-light);
    color: var(--text-muted);
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    padding: 0;
}

.btn-play-preset i, .btn-add-preset i {
    width: 12px;
    height: 12px;
}

.btn-play-preset:hover {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
    background: var(--color-secondary-glow);
    transform: scale(1.1);
}

.btn-add-preset:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-glow);
    transform: scale(1.1);
}

.btn-play-preset.playing {
    border-color: var(--color-accent) !important;
    color: var(--color-accent) !important;
    background: rgba(233, 64, 87, 0.15) !important;
    animation: pulsePlay 1.2s infinite;
}

@keyframes pulsePlay {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* --- Top-Center Header Toolbar & Cursors --- */
.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.header-toolbar {
    display: flex;
    align-items: center;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius-sm);
    padding: 2px 6px;
    gap: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-tool-header {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.btn-tool-header:hover:not(:disabled) {
    color: var(--text-main);
    background-color: var(--bg-surface-highlight);
}

.btn-tool-header.active {
    color: var(--color-primary);
    background-color: rgba(122, 77, 239, 0.15);
}

.btn-tool-header:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.header-zoom-container {
    position: relative;
    display: flex;
    align-items: center;
    padding-right: 4px;
}

.zoom-dropdown {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    padding: 4px 24px 4px 8px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.zoom-chevron {
    position: absolute;
    right: 4px;
    pointer-events: none;
    width: 12px;
    height: 12px;
    color: var(--text-muted);
}

.header-separator {
    width: 1px;
    height: 16px;
    background-color: var(--border-color-light);
    margin: 0 4px;
}

/* Tool cursor modifiers */
.app-container.tool-hand #video-canvas {
    cursor: grab !important;
}
.app-container.tool-hand #video-canvas:active {
    cursor: grabbing !important;
}

.app-container.tool-hand .timeline-scroll-content {
    cursor: grab !important;
}
.app-container.tool-hand .timeline-scroll-content:active {
    cursor: grabbing !important;
}

/* Override variables inside scaled container */
.app-container.scaled {
    --timeline-height: 280px !important;
}
.app-container.scaled #btn-load-demo {
    display: inline-flex !important;
}
.app-container.scaled .project-title-container {
    display: flex !important;
}
.app-container.scaled .toolbar-right {
    display: block !important;
}

/* Option Font Styles in Select Dropdown */
#prop-font-family option[value="Outfit"] { font-family: 'Outfit', sans-serif; }
#prop-font-family option[value="Plus Jakarta Sans"] { font-family: 'Plus Jakarta Sans', sans-serif; }
#prop-font-family option[value="Montserrat"] { font-family: 'Montserrat', sans-serif; }
#prop-font-family option[value="Lobster"] { font-family: 'Lobster', cursive; }
#prop-font-family option[value="Permanent Marker"] { font-family: 'Permanent Marker', cursive; }
#prop-font-family option[value="Orbitron"] { font-family: 'Orbitron', sans-serif; }
#prop-font-family option[value="Pacifico"] { font-family: 'Pacifico', cursive; }
#prop-font-family option[value="Caveat"] { font-family: 'Caveat', cursive; }
#prop-font-family option[value="Righteous"] { font-family: 'Righteous', sans-serif; }
#prop-font-family option[value="Playfair Display"] { font-family: 'Playfair Display', serif; }
#prop-font-family option[value="Cinzel"] { font-family: 'Cinzel', serif; }
#prop-font-family option[value="Anton"] { font-family: 'Anton', sans-serif; }
#prop-font-family option[value="Fredoka One"] { font-family: 'Fredoka One', sans-serif; }
#prop-font-family option[value="Bungee"] { font-family: 'Bungee', sans-serif; }
#prop-font-family option[value="Special Elite"] { font-family: 'Special Elite', serif; }
#prop-font-family option[value="Sacramento"] { font-family: 'Sacramento', cursive; }
#prop-font-family option[value="Press Start 2P"] { font-family: 'Press Start 2P', monospace; }
#prop-font-family option[value="Creepster"] { font-family: 'Creepster', cursive; }
#prop-font-family option[value="Shadows Into Light"] { font-family: 'Shadows Into Light', cursive; }
#prop-font-family option[value="VT323"] { font-family: 'VT323', monospace; }
#prop-font-family option[value="Molle"] { font-family: 'Molle', cursive; }
#prop-font-family option[value="Otsutome Font"] { font-family: 'Otsutome Font', sans-serif; }
#prop-font-family option[value="Alex Brush"] { font-family: 'Alex Brush', cursive; }

/* ============================================================
   USER DROPDOWN MENU STYLES
   ============================================================ */
.user-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 260px;
    background: rgba(22, 23, 30, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color, #2a2b36);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    padding: 12px 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    animation: fadeInDropdown 0.2s ease-out;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    padding: 8px 16px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.dropdown-avatar-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #ccefe6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    border: 2px solid var(--border-color, #2a2b36);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dropdown-user-details {
    margin-bottom: 12px;
}

.dropdown-username {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main, #fff);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.dropdown-email {
    font-size: 11px;
    color: var(--text-muted, #888);
}

.btn-upgrade-gradient {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #3a8ef6 0%, #d845f8 100%) !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
    box-shadow: 0 4px 12px rgba(58, 142, 246, 0.3);
}

.btn-upgrade-gradient:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.dropdown-divider {
    border: 0;
    border-top: 1px solid var(--border-color, #2a2b36);
    margin: 6px 0;
}

.dropdown-items {
    display: flex;
    flex-direction: column;
}

.dropdown-item {
    background: transparent;
    border: none;
    padding: 10px 16px;
    color: var(--text-muted, #888);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
    width: 100%;
}

.dropdown-item i {
    width: 16px;
    height: 16px;
    color: var(--text-muted, #888);
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main, #fff);
}

.dropdown-item:hover i {
    color: var(--color-primary, #ff007f);
}

.dropdown-item.text-danger {
    color: var(--color-danger, #ff3b30);
}

.dropdown-item.text-danger i {
    color: var(--color-danger, #ff3b30);
}

.dropdown-item.text-danger:hover {
    background: rgba(255, 59, 48, 0.08);
}

.dropdown-item.text-danger:hover i {
    color: var(--color-danger, #ff3b30);
}

.avatar-circle-sm {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ccefe6;
    color: #3baf9f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 10px;
}

/* ============================================================
   PROFILE SECTION STYLES
   ============================================================ */
.profile-container {
    background: var(--bg-surface-elevated, #111216);
    width: 100%;
}

.profile-tab {
    transition: border-bottom-color 0.2s, color 0.2s;
}

.profile-tab:hover {
    color: var(--text-main, #fff) !important;
}

.profile-pill {
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.profile-pill:hover {
    border-color: var(--color-primary, #ff007f) !important;
    color: var(--color-primary, #ff007f) !important;
}

.profile-empty-state i {
    animation: floatEmptyIcon 3s ease-in-out infinite;
}

@keyframes floatEmptyIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Settings tab panel details */
.settings-tab-btn {
    transition: border-bottom-color 0.2s, color 0.2s;
}

.settings-tab-btn:hover {
    color: var(--text-main, #fff) !important;
}

.settings-tab-pane {
    animation: fadeInPane 0.2s ease-out;
}

@keyframes fadeInPane {
    from { opacity: 0; }
    to { opacity: 1; }
}

.settings-group form input:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 2px rgba(255, 0, 127, 0.15);
    outline: none;
}

body.light-theme {
    --bg-base: hsl(225, 20%, 95%);
    --bg-surface: hsl(225, 16%, 90%);
    --bg-surface-elevated: hsl(225, 14%, 85%);
    --bg-surface-highlight: hsl(225, 14%, 80%);
    --border-color: hsl(225, 12%, 80%);
    --border-color-light: hsl(225, 12%, 75%);
    --text-main: hsl(225, 20%, 15%);
    --text-muted: hsl(225, 10%, 40%);
}

/* ============================================================
   TEMPLATES PANEL STYLES
   ============================================================ */
.template-categories::-webkit-scrollbar {
    height: 6px;
}
.template-categories::-webkit-scrollbar-track {
    background: transparent;
}
.template-categories::-webkit-scrollbar-thumb {
    background: var(--border-color, #333);
    border-radius: 10px;
}
.template-categories::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary, #ff007f);
}
.category-pill {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 20px;
    background: var(--bg-surface-elevated, #1e1e1e);
    color: var(--text-muted, #aaa);
    border: 1px solid var(--border-color, #333);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease-in-out;
}
.category-pill:hover {
    background: var(--border-color, #333) !important;
    color: var(--text-main, #fff) !important;
}
.category-pill.active {
    background: var(--color-primary, #ff007f) !important;
    color: #fff !important;
    border-color: var(--color-primary, #ff007f) !important;
    font-weight: 600;
}

/* Template Search and Favorites */
.template-search-container input {
    transition: border-color var(--transition-fast) ease;
}
.template-search-container input:focus {
    border-color: var(--color-primary) !important;
}

.template-card-favorite-btn {
    opacity: 0.7;
}
.template-card-favorite-btn:hover {
    transform: scale(1.2);
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.85) !important;
}

/* Category pill counter badges */
.category-counter-badge {
    pointer-events: none;
    transition: all 0.2s ease;
}
.category-pill.active .category-counter-badge {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
}

.template-card {
    position: relative;
    border-radius: var(--border-radius-sm, 6px);
    border: 1px solid var(--border-color, #333);
    background: var(--bg-surface-elevated, #1e1e1e);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    aspect-ratio: 16/10;
    display: flex;
    flex-direction: column;
}
.template-card:hover {
    border-color: var(--color-primary, #ff007f);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.template-card-preview {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.template-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.template-card:hover .template-card-preview img {
    transform: scale(1.05);
}
.template-card-preview .play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0.8;
    transition: all 0.2s;
}
.template-card:hover .play-icon-overlay {
    opacity: 1;
    background: var(--color-primary, #ff007f);
}
.template-card-info {
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: rgba(0,0,0,0.3);
}
.template-card-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-main, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.template-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 8px;
    color: var(--text-muted, #aaa);
}
.template-card-action {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
}
.template-card:hover .template-card-action {
    opacity: 1;
}
.template-card-action:hover {
    background: var(--color-primary, #ff007f);
    transform: scale(1.1);
}
.template-card-loading {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 10px;
    color: #fff;
    z-index: 2;
}
.sidebar-logo {
    margin-bottom: 24px;
    text-align: center;
}

/* ==========================================================================
   Home Premium Watermark & Neon Glow Orbs
   ========================================================================== */
.dashboard-screen {
    position: relative;
}

.dashboard-screen::before {
    content: "";
    position: absolute;
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, hsla(265, 85%, 64%, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.dashboard-screen::after {
    content: "";
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, hsla(190, 100%, 46%, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.dashboard-sidebar, .dashboard-main {
    position: relative;
    z-index: 1; /* Overlay watermark and background glow elements */
}

/* Watermark background using the official NovaCup logo */
.dashboard-watermark {
    position: absolute;
    top: 50%;
    left: 50%; /* Centered by default on mobile devices */
    transform: translate(-50%, -50%);
    width: 140vh; /* Scaled to 140% of screen height to make it giant */
    height: 140vh;
    background-image: url('novacup-logo.jpg');
    background-repeat: no-repeat;
    background-size: 178% 100%; /* Keeps the exact aspect ratio of the 1024x576 widescreen image */
    background-position: 40.15vh center; /* Mathematically centers the 'N' symbol inside the square container */
    opacity: 0.06; /* Slightly increased opacity so the 'N' is clearly visible */
    filter: blur(2px); /* Reduced blur to preserve the sharp neon look */
    mix-blend-mode: screen; /* Keys out the dark background of the JPG logo */
    pointer-events: none;
    z-index: 0;
}

/* Centered in the content area on screens with sidebar */
@media (min-width: 769px) {
    .dashboard-watermark {
        left: calc(50% + 120px); /* Shifts right by 120px to center it within the main content area (accounting for the 240px sidebar) */
    }
}

/* Light theme adaptation */
body.light-theme .dashboard-watermark {
    filter: invert(1) blur(2px); /* Inverts colors so the black background becomes white and disappears via multiply */
    mix-blend-mode: multiply;
    opacity: 0.04;
}


/* ==========================================================================
   Image Editor Screen Styles (Creative Suite)
   ========================================================================== */
.image-editor-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-base);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    z-index: 9500; /* Higher than dashboard-screen */
    overflow: hidden;
}

.image-editor-screen.hidden {
    display: none !important;
}

.img-editor-header {
    height: 60px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 10;
}

.img-editor-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
}

.img-editor-title i {
    color: var(--color-secondary);
}

.img-editor-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.img-editor-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Left Sidebar for Quick Tools */
.img-editor-sidebar-left {
    width: 240px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    overflow-y: auto;
}

/* Right Sidebar for Parameter Adjustments */
.img-editor-sidebar-right {
    width: 320px;
    background-color: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
    overflow-y: auto;
}

/* Center Canvas Area */
.img-editor-viewport {
    flex: 1;
    background-color: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 24px;
    overflow: auto;
}

/* Checkerboard background for transparent images */
.img-editor-canvas-container {
    position: relative;
    background-image: 
        linear-gradient(45deg, #181920 25%, transparent 25%), 
        linear-gradient(-45deg, #181920 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #181920 75%), 
        linear-gradient(-45deg, transparent 75%, #181920 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #0c0d12;
    border: 2px dashed var(--border-color-light);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    padding: 10px;
}

.img-editor-canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transform-origin: center center;
    transition: transform 0.2s ease-out;
}

/* UI Elements inside Sidebar groups */
.img-editor-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.img-editor-group h4 {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.img-editor-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.img-editor-label-val {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* Redesign tools grid for quick buttons */
.img-editor-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-editor-tool {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-main);
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-editor-tool:hover {
    border-color: var(--color-primary);
    background: var(--bg-surface-highlight);
    transform: translateY(-1px);
}

.btn-editor-tool.active-tool {
    border-color: var(--color-secondary);
    background: rgba(0, 243, 255, 0.08);
    color: var(--color-secondary);
}

.btn-editor-tool i, .btn-editor-tool svg {
    width: 18px;
    height: 18px;
}

/* Crop overlay styles */
.crop-overlay {
    position: absolute;
    border: 2px dashed var(--color-secondary);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: move;
    display: none;
    z-index: 15;
}

.crop-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--color-secondary);
    border: 1px solid #fff;
    border-radius: 50%;
}

.crop-handle-tl { top: -5px; left: -5px; cursor: nwse-resize; }
.crop-handle-tr { top: -5px; right: -5px; cursor: nesw-resize; }
.crop-handle-bl { bottom: -5px; left: -5px; cursor: nesw-resize; }
.crop-handle-br { bottom: -5px; right: -5px; cursor: nwse-resize; }

.img-editor-zoom-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(22, 23, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 5;
}

.img-editor-zoom-bar button {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: background 0.2s;
}

.img-editor-zoom-bar button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.img-editor-zoom-bar button i {
    width: 14px;
    height: 14px;
}

/* Layout additions for Image Editor Tabs */
.img-editor-left-nav {
    width: 60px;
    background-color: var(--bg-surface-elevated);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 16px;
    z-index: 2;
}

.img-editor-nav-tab {
    background: transparent;
    border: none;
    width: 48px;
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    font-size: 9px;
    gap: 4px;
    transition: all var(--transition-fast);
}

.img-editor-nav-tab:hover {
    color: var(--text-main);
    background: var(--bg-surface-highlight);
}

.img-editor-nav-tab.active {
    color: var(--color-primary);
    background: rgba(255, 0, 127, 0.1);
    border-left: 2px solid var(--color-primary);
    border-radius: 0 8px 8px 0;
}

.img-editor-nav-tab i {
    width: 18px;
    height: 18px;
}

.img-editor-tab-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    width: 100%;
}

.img-editor-tab-panel.hidden {
    display: none !important;
}

.img-editor-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.img-editor-panel-header h4 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 14px;
}

/* Layers Stack List */
.img-layers-stack-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
}

.img-layer-item {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}

.img-layer-item:hover {
    border-color: var(--border-color-light);
}

.img-layer-item.active {
    border-color: var(--color-primary);
    background: rgba(255, 0, 127, 0.05);
}

.img-layer-item.locked {
    opacity: 0.8;
}

.img-layer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.img-layer-icon {
    color: var(--color-secondary);
    display: flex;
    align-items: center;
}

.img-layer-icon i {
    width: 14px;
    height: 14px;
}

.img-layer-name {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.img-layer-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-layer-action {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.btn-layer-action:hover {
    background: var(--bg-surface-highlight);
    color: var(--text-main);
}

.btn-layer-action.active {
    color: var(--color-primary);
}

/* Contextual right panels */
.right-context-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.right-context-panel.hidden {
    display: none !important;
}

/* Background Gradients grid */
.bg-grad-preset {
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.bg-grad-preset:hover {
    transform: scale(1.05);
}
.bg-grad-preset.active {
    border-color: var(--color-secondary) !important;
    box-shadow: 0 0 6px var(--color-secondary-glow);
}

/* Zoom controls additions */
.zoom-separator {
    width: 1px;
    height: 16px;
    background: var(--border-color);
    margin: 0 4px;
}

.btn-zoom-circle {
    border-radius: 50%;
    width: 20px !important;
    height: 20px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    padding: 0;
}

/* Smart Guides */
.smart-guide-line {
    position: absolute;
    background-color: #ff00ff; /* Magenta guides */
    z-index: 10;
    pointer-events: none;
}

.smart-guide-h {
    height: 1px;
    left: 0;
    right: 0;
}

.smart-guide-v {
    width: 1px;
    top: 0;
    bottom: 0;
}

/* Grid & Rulers Overlay */
.img-editor-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    display: none;
}

.img-editor-grid-overlay.visible {
    display: block;
}

/* Canvas Selection Outline box */
.canvas-selection-box {
    position: absolute;
    border: 2px solid #00c6ff;
    pointer-events: none;
    z-index: 8;
    display: none;
}

.canvas-selection-box.visible {
    display: block;
}

.canvas-selection-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border: 2px solid #00c6ff;
    border-radius: 50%;
    pointer-events: auto;
    z-index: 9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: transform 0.15s ease;
}

.canvas-selection-handle:hover {
    transform: scale(1.25);
}

.canvas-selection-handle-tl { top: -6px; left: -6px; cursor: nwse-resize; }
.canvas-selection-handle-tr { top: -6px; right: -6px; cursor: nesw-resize; }
.canvas-selection-handle-bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
.canvas-selection-handle-br { bottom: -6px; right: -6px; cursor: nwse-resize; }
.canvas-selection-handle-ml { top: calc(50% - 6px); left: -6px; cursor: ew-resize; }
.canvas-selection-handle-mr { top: calc(50% - 6px); right: -6px; cursor: ew-resize; }
.canvas-selection-handle-mt { top: -6px; left: calc(50% - 6px); cursor: ns-resize; }
.canvas-selection-handle-mb { bottom: -6px; left: calc(50% - 6px); cursor: ns-resize; }

.canvas-selection-rotator {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border: 2px solid #00c6ff;
    border-radius: 50%;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    cursor: grab;
    pointer-events: auto;
    z-index: 9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: transform 0.15s ease;
}

.canvas-selection-rotator:hover {
    transform: translateX(-50%) scale(1.25);
}

.canvas-selection-rotator-line {
    position: absolute;
    width: 2px;
    height: 20px;
    background: #00c6ff;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.template-preset-card {
    transition: all 0.2s ease;
}

.template-preset-card:hover {
    background: var(--bg-surface-elevated-hover) !important;
    border-color: #00c6ff !important;
    transform: translateY(-1px);
}

/* Switches (Notificaciones) */
.switch-container input:checked + .switch-slider {
    background-color: var(--color-primary) !important;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: .4s;
}

.switch-container input:checked + .switch-slider:before {
    transform: translateX(16px);
}

/* Timeline Professional CSS */
.track-lane.collapsed {
    height: 28px !important;
    min-height: 28px !important;
}
.track-header-cell.collapsed {
    height: 28px !important;
    min-height: 28px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}
.track-lane.collapsed .timeline-clip {
    height: 20px !important;
    top: 4px !important;
}
.track-lane.collapsed .clip-name, .track-lane.collapsed .clip-trim-handle {
    display: none !important;
}

/* Track status styles */
.btn-track-lock.active, .btn-track-hide.active, .btn-track-collapse.active, .btn-track-mute.active, .btn-track-mute-video.active {
    color: #00F3FF !important;
}
.track-lane.locked {
    pointer-events: none !important;
    opacity: 0.6;
    background: repeating-linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.1),
        rgba(0, 0, 0, 0.1) 10px,
        rgba(255, 255, 255, 0.02) 10px,
        rgba(255, 255, 255, 0.02) 20px
    ) !important;
}

/* Snap Guide Line */
.timeline-snap-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1.5px;
    background: #FF007F;
    box-shadow: 0 0 8px #FF007F;
    z-index: 1000;
    pointer-events: none;
}

/* Selection Marquee */
.timeline-selection-marquee {
    position: absolute;
    border: 1px dashed #00F3FF;
    background: rgba(0, 243, 255, 0.15);
    pointer-events: none;
    z-index: 999;
}

/* Ruler Markers */
.timeline-marker {
    position: absolute;
    top: 0;
    width: 10px;
    height: 16px;
    background: #FFD700;
    clip-path: polygon(50% 0%, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);
    cursor: pointer;
    z-index: 100;
    transition: transform 0.1s ease;
}
.timeline-marker:hover {
    transform: scale(1.3);
}
.timeline-marker.purple { background: #9b5de5; }
.timeline-marker.red { background: #f15bb5; }
.timeline-marker.blue { background: #00bbf9; }

/* Custom clip colors */
.timeline-clip.color-purple {
    background: linear-gradient(135deg, #8e2de2, #4a00e0) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}
.timeline-clip.color-blue {
    background: linear-gradient(135deg, #00c6ff, #0072ff) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}
.timeline-clip.color-green {
    background: linear-gradient(135deg, #11998e, #38ef7d) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}
.timeline-clip.color-coral {
    background: linear-gradient(135deg, #ff416c, #ff4b2b) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}
.timeline-clip.color-yellow {
    background: linear-gradient(135deg, #f5af19, #f12711) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

/* Warp mesh handles overlays styling */
.canvas-warp-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9;
}

.canvas-warp-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #00f3ff;
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: move;
    pointer-events: auto;
    z-index: 10;
    transform: translate(-50%, -50%);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, background 0.15s ease;
}

.canvas-warp-handle:hover {
    transform: translate(-50%, -50%) scale(1.3);
    background: #ff007f;
}

.canvas-warp-handle.active {
    background: #39ff14;
    transform: translate(-50%, -50%) scale(1.4);
}

/* Make tool buttons bigger for mobile touch */
.device-mobile .timeline-toolbar .btn-tool {
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
}
.device-mobile .timeline-toolbar .btn-tool i {
    width: 20px !important;
    height: 20px !important;
}

.device-mobile .timeline-body-wrapper {
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x pan-y !important;
}
.device-mobile .timeline-content-scroll {
    touch-action: pan-x pan-y !important;
}
