/* assets/css/style.css - Modern Dark UI */

:root {
    --bg-color: #0d0d0d;
    --card-bg: #1a1a1a;
    --card-border: #2a2a2a;
    --accent: #3d5afe;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --success: #05be6c;
    --danger: #cf6679;
    --warning: #e0ab0b;
    --navbar-bg: #111111;
    --font-family: 'Poppins', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* New Hover Play Button for Cards */
.project-preview-thumb {
    position: relative;
    overflow: hidden;
}

.project-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    z-index: 10;
}

.project-preview-thumb:hover .project-play-overlay {
    opacity: 1;
}

.play-circle {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    transition: var(--transition);
    transform: scale(0.8);
}

.project-preview-thumb:hover .play-circle {
    transform: scale(1);
    background: var(--accent);
    border-color: var(--accent);
}

.play-circle:hover {
    transform: scale(1.1) !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.editor-app-view {
    height: 100vh;
    overflow: hidden;
}

body.editor-app-view main {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.editor-app-view .container {
    max-width: 100%;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 2px auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: rgba(17, 17, 17, 0.7) !important;
    backdrop-filter: blur(15px) saturate(160%);
    -webkit-backdrop-filter: blur(15px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent);
}

.nav-menu {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--text-primary);
}

.nav-btn {
    background-color: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.nav-btn:hover {
    background-color: #5c72ff;
    transform: translateY(-2px);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.user-badge {
    font-size: 0.85rem;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block;
    }

    .navbar {
        position: fixed;
        /* Fixed at top */
        width: 100%;
        top: 0;
        left: 0;
    }

    body {
        padding-top: 60px;
        /* Offset for fixed navbar */
    }

    .nav-menu {
        display: none;
        /* Hide by default on mobile */
    }

    .container-nav.mobile-active .nav-menu {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: calc(100vh - 60px);
        background: rgba(17, 17, 17, 0.98);
        padding: 40px 20px;
        backdrop-filter: blur(20px);
        z-index: 999;
        overflow-y: auto;
        justify-content: flex-start;
    }

    .nav-links {
        flex-direction: column;
        gap: 25px;
    }

    .nav-auth {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin-top: 30px;
        padding-top: 30px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-left: none;
        margin-left: 0;
        padding-left: 0;
    }

    .section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px;
    }

    .section-header h1 {
        font-size: 2rem !important;
        margin-bottom: 5px !important;
        line-height: 1.2;
    }

    .section-header p {
        font-size: 0.9rem !important;
        opacity: 0.8;
    }

    .collapsible-section .section-toggle h2 {
        font-size: 1.1rem !important;
        display: flex;
        align-items: center;
        white-space: nowrap;
    }

    .collapsible-section .section-toggle h2 i {
        margin-right: 10px !important;
        font-size: 1.2rem;
    }

    /* Mobile App Mode for Editor */
    body.editor-app-view {
        overflow: hidden;
        height: 100vh;
        background: #000;
    }

    body.editor-app-view .editor-header {
        display: none !important;
    }

    body.editor-app-view .editor-layout,
    body.editor-app-view .editor-container {
        display: block !important; /* Overwrite flex/grid, use strict fixed positioning */
        height: 100vh !important;
        width: 100vw !important;
        overflow: hidden !important;
        padding: 0 !important;
    }
    
    body.editor-app-view .editor-toolbar {
        display: none !important;
    }
    body.editor-app-view .editor-toolbar h2 {
        display: none !important;
    }
    body.editor-app-view .editor-toolbar button {
        flex: 1;
        padding: 0 5px !important;
        font-size: 0.85rem !important;
    }

    /* Fixed Preview occupying the top 60% */
    /* Fixed Preview occupying the top 60% - Unified for both editors */
    body.editor-app-view .workspace-preview {
        position: fixed;
        top: 60px; /* Pull up to navbar bottom */
        left: 0;
        width: 100%;
        height: calc(60vh - 60px) !important;
        background: #000;
        z-index: 100;
        padding: 0 10px 10px 10px;
        display: flex;
        flex-direction: column;
        justify-content: flex-end; /* Push player-controls to absolute bottom of this area */
        align-items: center;
        border-bottom: none;
    }

    body.editor-app-view .workspace-center {
        position: fixed;
        top: 60px; /* Consistent with preview */
        left: 0;
        width: 100%;
        height: calc(60vh - 60px) !important;
        background: #000;
        z-index: 100;
        padding: 0 10px 10px 10px;
        display: flex;
        flex-direction: column;
        justify-content: flex-end; /* Pin controls to bottom */
        align-items: center;
        border-bottom: none;
    }
    
    body.editor-app-view .preview-container {
        width: 100% !important;
        height: auto !important;
        min-height: 150px;
        margin: auto !important; /* Centering the preview in the flexible space above buttons */
        flex-shrink: 1;
        border: 1px solid rgba(255,255,255,0.2) !important;
    }
    
    body.editor-app-view .aspect-9-16 {
        width: auto !important;
        height: 70% !important; /* User is happy with this size */
        max-width: 90vw;
    }
    
    body.editor-app-view .aspect-16-9 {
        width: 100% !important;
        height: auto !important;
        max-height: 60%; 
    }
    
    body.editor-app-view .workspace-center-desktop-fix {
        padding: 0 !important;
        border-radius: 0 !important;
        background: #000 !important;
        height: 100% !important;
        max-height: calc(60vh - 125px) !important;
        width: 100% !important;
    }

    body.editor-app-view .video-workspace {
        max-width: 100%;
        width: 100%;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    body.editor-app-view .preview-container {
        border-radius: 8px;
        max-height: calc(60vh - 160px); /* Leave enough room for player controls */
        width: auto !important;
        max-width: 100%;
        margin: 0 auto;
    }

    body.editor-app-view .player-controls {
        background: rgba(0,0,0,0.8);
        margin: 5px 0 0 0;
        padding: 10px;
        border-radius: 12px;
        width: 100%;
        flex-shrink: 0; /* Never shrink the controls */
    }

    /* Bottom Tools Workspace occupying the lower 40% */
    body.editor-app-view .workspace-settings,
    body.editor-app-view .workspace-left,
    body.editor-app-view .workspace-right {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 40vh !important; /* Exactly 40% of the screen height */
        overflow-y: auto;
        padding: 15px;
        background: #111;
        border-top: 1px solid rgba(255,255,255,0.05);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.8);
        z-index: 101;
    }

    body.editor-app-view .workspace-settings,
    body.editor-app-view .workspace-left {
        padding-bottom: 250px !important; /* Extra padding to prevent dropdown lists from falling off-screen */
    }

    body.editor-app-view .workspace-right {
        padding-bottom: 75px !important; /* Padding for the floating bottom tabs */
    }

    /* Hide Timing tab headers on mobile timing tab */
    body.editor-app-view .workspace-right .tabs-header {
        display: none !important;
    }

    /* Fixed Tabs at Bottom */
    .mobile-editor-tabs {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #111;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding: 8px 15px env(safe-area-inset-bottom);
        z-index: 1000;
        justify-content: space-around;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    }

    .mobile-tab-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        background: none;
        border: none;
        color: #888;
        padding: 8px;
        gap: 4px;
        flex: 1;
        transition: 0.2s;
    }

    .mobile-tab-btn i {
        font-size: 1.2rem;
    }

    .mobile-tab-btn span {
        font-size: 0.65rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .mobile-tab-btn.active {
        color: var(--accent);
    }

    .mobile-tab-btn.active i {
        filter: drop-shadow(0 0 5px var(--accent));
    }

    /* Hide sections based on tab selection (JS toggles this) */
    .mobile-section-bg,
    .mobile-section-lyrics,
    .mobile-section-layers,
    .mobile-section-sync {
        display: none;
    }

    /* Initial state for mobile */
    .mobile-section-bg, .mobile-section-composition {
        display: block;
    }
    
    .mobile-section-layers {
        display: none;
    }

    /* Adjust cards for mobile app look */
    body.editor-app-view .collapsible-section {
        background: rgba(255,255,255,0.03);
        border-radius: 12px;
        margin-bottom: 15px;
        border: 1px solid rgba(255,255,255,0.05);
    }

    body.editor-app-view .shortcut-legend-card {
        display: none !important; /* Keywords not needed on mobile */
    }

    body.editor-app-view .controls-row {
        flex-wrap: wrap;
        gap: 12px 10px;
    }

    body.editor-app-view .time-display {
        flex: 1;
        white-space: nowrap;
    }

    body.editor-app-view .main-btns {
        display: flex;
        gap: 10px;
    }

    body.editor-app-view .sync-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 2fr 1fr 1fr;
        gap: 8px;
    }

    body.editor-app-view #mark-btn {
        height: 42px;
        font-size: 0.85rem;
        letter-spacing: 1px;
    }

    body.editor-app-view .sync-actions .btn {
        height: 42px;
        padding: 0 5px;
        font-size: 0.75rem !important;
        white-space: nowrap;
    }

    /* Target specific Cover Editor tweaks */
    .shortcut-hint {
        display: none !important;
    }

    .preview-instruction {
        font-size: 0.65rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 10px;
        margin-top: 5px;
    }
}

/* Dashboard / Index */
main {
    flex: 1;
    padding: 40px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

.project-card h3 {
    margin-bottom: 5px;
    font-size: 1.25rem;
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.project-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-secondary {
    background-color: #333;
    color: white;
}

.btn-secondary:hover {
    background-color: #444;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.header-actions .btn {
    margin-left: 10px;
}

.btn:hover {
    opacity: 0.9;
}

.btn-upload-prominent {
    background-color: var(--accent) !important;
    color: white !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 15px rgba(61, 90, 254, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-upload-prominent:hover {
    box-shadow: 0 4px 20px rgba(61, 90, 254, 0.5);
    transform: translateY(-1px);
}

/* Forms */
.form-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    transition: 0.3s;
    box-sizing: border-box;
}

select.form-control {
    cursor: pointer;
    background-color: #1a1a1a !important;
    /* Force dark background for dropdown element */
    color: #ffffff !important;
}

select.form-control option {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 10px;
}

.crown-gold {
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}

textarea.form-control {
    min-height: 200px;
    resize: vertical;
}

/* Project Preview Thumb */
.project-preview-thumb {
    width: calc(100% + 40px);
    margin: -20px -20px 15px -20px;
    height: 160px;
    background: #000;
    position: relative;
    overflow: hidden;
}

.project-preview-thumb img,
.project-preview-thumb video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.project-preview-thumb:hover img,
.project-preview-thumb:hover video {
    transform: scale(1.05);
}

.no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #121212, #252525);
    color: #333;
    font-size: 2.5rem;
}

/* Editor Tabs */
.tabs-header {
    display: flex;
    background: #111;
    border-bottom: 1px solid var(--card-border);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
    height: 100%;
    flex-direction: column;
}

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

/* Editor Layout */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    /* even more compact */
    background-color: var(--card-bg);
    padding: 8px 15px;
    /* even more compact */
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.editable-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-input {
    background: transparent;
    border: none;
    color: white;
    font-family: inherit;
    font-weight: 700;
    font-size: 1.25rem;
    /* slightly smaller */
    padding: 2px 4px;
    border-radius: 4px;
    width: 300px;
    transition: var(--transition);
}

.meta-input:hover,
.meta-input:focus {
    background-color: #222;
}

.artist-input {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.export-group {
    display: flex;
    gap: 8px;
}

.editor-layout {
    display: grid !important;
    grid-template-columns: 320px 1fr 380px !important;
    grid-template-rows: 1fr !important;
    gap: 15px;
    /* smaller gap */
    height: calc(100vh - 100px);
    /* Adjust based on new header/footer */
    overflow: hidden;
    padding: 0 10px 10px 10px;
}

.workspace-settings,
.workspace-preview,
.workspace-right {
    height: 100% !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.workspace-settings,
.workspace-right {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.workspace-settings {
    overflow-y: auto;
    padding: 20px;
}

.workspace-settings::-webkit-scrollbar {
    width: 6px;
}

.workspace-settings::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.workspace-preview {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    height: 100%;
}

.video-workspace {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.video-workspace:fullscreen {
    background-color: #000;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.video-workspace:fullscreen .preview-container {
    flex: 1;
    /* Occupy remaining space above controls */
    width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
    max-width: 100% !important;
    border: none;
    border-radius: 0;
    margin: auto !important;
    /* Centers it in the flex area */
    aspect-ratio: 16 / 9;
    /* Default to landscape */
}

.video-workspace:fullscreen .player-controls {
    width: 100%;
    background-color: rgba(17, 17, 17, 0.95);
    border: none;
    border-radius: 0;
    padding: 10px 40px 30px 40px;
    z-index: 100;
}

.text-layer-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    border: 1px solid var(--card-border);
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
}

.text-layer-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.text-layer-item.active {
    background: #ff4081;
    color: white;
    border-color: #ff4081;
}

#layer-editor-panel {
    scroll-margin-top: 20px;
}

.preview-container {
    max-width: 100%;
    max-height: 100%;
    background-color: #000;
    position: relative;
    overflow: hidden;
    container-type: size;
    /* Crucial for relative font scaling */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    border: 1px solid var(--card-border);
    transition: width 0.3s, height 0.3s;
}

/* Base Fullscreen Force - Default is 16:9 */
#fullscreen-target:fullscreen .preview-container {
    max-height: 100% !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    margin: auto !important;
}

#fullscreen-target:fullscreen .preview-container.ratio-9-16 {
    width: auto !important;
    height: 100% !important;
    aspect-ratio: 9 / 16 !important;
}

#fullscreen-target:fullscreen .preview-container.ratio-1-1 {
    width: auto !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
}

.preview-container.ratio-9-16 {
    aspect-ratio: 9 / 16;
    height: 100% !important;
    width: auto !important;
    max-width: none;
    margin: 0 auto;
}

.preview-container.ratio-1-1 {
    aspect-ratio: 1 / 1;
    height: 100% !important;
    width: auto !important;
    max-width: none;
    margin: 0 auto;
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Change to cover for better filling */
    z-index: 1;
}

.bg-black {
    background-color: #000;
}

.visualizer-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.lyrics-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    pointer-events: none;
}

.lyric-text {
    /* Fluid scaling based on container width */
    width: 100%;
    font-size: calc(var(--fs, 32) * (100cqw / 1000));
    font-weight: 700;
    text-align: center;
    color: #fff;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    transition: transform 0.2s ease;
}

.preview-action-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.preview-action-btn:hover {
    background-color: var(--accent);
    transform: scale(1.1);
}

/* Audio Player */
.player-controls {
    background-color: var(--card-bg);
    padding: 7px 20px;
    /* compact */
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.progress-bar-container {
    height: 10px;
    background-color: #333;
    border-radius: 5px;
    margin-bottom: 15px;
    cursor: pointer;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent);
    width: 0%;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.time-display {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.player-btn {
    background-color: #444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* Style Settings Panel */
.style-settings-panel {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.setting-item label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
}

/* Lyrics Sync Panel */
.lyrics-panel {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.lyrics-list-header {
    padding: 20px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-btns {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

#pointer-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.lyrics-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.lyric-line-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    transition: var(--transition);
    cursor: grab;
    user-select: none;
}

.lyric-line-item:active {
    cursor: grabbing;
}

.lyric-line-item:hover {
    background-color: #252525;
}

.lyric-line-item.active {
    background-color: rgba(5, 190, 108, 0.15);
    border: 1.5px solid var(--success);
    box-shadow: 0 0 10px rgba(5, 190, 108, 0.2);
}

.lyric-line-item.synced {
    background-color: rgba(255, 255, 255, 0.02);
}

.line-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #444;
    margin-top: 18px;
}

.lyric-line-item.synced .line-status {
    background-color: var(--success);
}

.lyric-line-item.current-playing {
    background-color: rgba(61, 90, 254, 0.25);
    border-color: var(--accent);
    transform: scale(1.02);
    z-index: 5;
}

.lyric-line-item.current-playing .line-status {
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
}

/* Past lines - dimmed */
.lyric-line-item.past {
    opacity: 0.6;
}


.line-text-input {
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    padding: 5px 0;
    border-bottom: 1px solid transparent;
}

.line-text-input:focus {
    border-bottom-color: var(--accent);
    outline: none;
}

.line-time-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.line-timestamp {
    background-color: #333;
    border: none;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    width: 80px;
    font-size: 0.9rem;
}

.jump-btn,
.reset-line-btn,
.delete-line-btn {
    background: none;
    border: 1px solid #555;
    color: #aaa;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition);
}

.jump-btn:hover {
    color: #fff;
    border-color: #777;
    background-color: #333;
}

.reset-line-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
    background-color: rgba(207, 102, 121, 0.1);
}

.settings-section h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.footer {
    margin-top: 20px;
}

/* Draggable & Animation Fixes */
.draggable-text,
.draggable-image {
    position: absolute;
    cursor: move;
    z-index: 20;
    border: 1px solid transparent;
    background: transparent;
    padding: 6px;
    border-radius: 4px;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.draggable-text {
    text-align: center;
    line-height: 1.2;
    font-size: calc(var(--fs, 20) * (100cqw / 1000));
}

.draggable-image {
    width: calc(var(--fs, 100) * (100cqw / 1000));
}

.draggable-text:hover,
.draggable-image:hover {
    border: 1px dashed rgba(255, 255, 255, 0.4);
}

.draggable-text.selected,
.draggable-image.selected {
    border: 1px solid var(--accent);
    background: rgba(61, 90, 254, 0.15);
}

.delete-handle {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 24px;
    height: 24px;
    background: #ff5252;
    color: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    border: 2px solid #fff;
    z-index: 30;
}

.resize-handle {
    position: absolute;
    bottom: -12px;
    right: -12px;
    width: 24px;
    height: 24px;
    background: #3d5afe;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: nwse-resize;
    z-index: 30;
    display: none;
    align-items: center;
    justify-content: center;
}

.resize-handle::after {
    content: "↘";
    font-size: 14px;
    color: #fff;
}

.draggable-text.selected .delete-handle,
.draggable-text.selected .resize-handle,
.draggable-image.selected .delete-handle,
.draggable-image.selected .resize-handle {
    display: flex;
}

/* Unified Aspect Ratio System */
.preview-container {
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    background: #000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--card-border);
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aspect-1-1 {
    aspect-ratio: 1 / 1;
    width: 500px; /* Base for desktop */
}

.aspect-16-9 {
    aspect-ratio: 16 / 9;
    width: 800px; /* Base for desktop */
}

.aspect-9-16 {
    aspect-ratio: 9 / 16;
    height: 500px; /* Base for desktop */
    max-height: 80vh;
}

.corner-banner-shape {
    position: absolute;
    width: calc(var(--bw, 280) * (100cqw / 1000));
    height: calc(var(--bh, 40) * (100cqw / 1000));
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: calc(var(--fs, 14) * (100cqw / 1000));
    line-height: calc(var(--bh, 40) * (100cqw / 1000));
    z-index: 95;
    pointer-events: auto;
    cursor: move;
}

.draggable-image img {
    pointer-events: none;
    user-select: none;
}

/* Custom Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    text-align: center;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
}

.modal-body {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Toast Notification (Improvement) */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 6000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.glass-toast {
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: toastEnter 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.glass-toast.success {
    border-left: 4px solid var(--success);
}

.glass-toast.error {
    border-left: 4px solid var(--danger);
}

.glass-toast.info {
    border-left: 4px solid var(--accent);
}

@keyframes toastEnter {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-exit {
    opacity: 0;
    transform: translateX(100px);
    transition: 0.4s ease;
}

@keyframes lyricFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes lyricSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

/* Animation Classes */
.anim-fade {
    animation: lyricFadeIn 0.5s ease-out forwards !important;
}

.anim-slide-up {
    animation: lyricSlideUp 0.6s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards !important;
}

.anim-typewriter {
    width: fit-content;
    margin: 0 auto;
    overflow: hidden;
    white-space: nowrap;
    animation: typing 1s steps(40, end) forwards !important;
}

@media (max-width: 1000px) {
    .editor-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

@media (min-width: 769px) {
    .mobile-section-composition,
    .mobile-section-layers {
        display: block !important;
    }
    
    .workspace-center-desktop-fix {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: #111;
        border-radius: 16px;
        position: relative;
        overflow: hidden;
        padding: 40px;
        margin: 0;
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 20px;
        padding-bottom: 20px;
    }

    .dashboard-actions {
        width: 100%;
        display: flex !important;
        flex-direction: row !important;
        /* Force side by side */
        gap: 10px !important;
    }

    .action-btn-mobile {
        flex: 1;
        padding: 12px 10px !important;
        font-size: 0.85rem !important;
        justify-content: center;
    }

    .action-btn-mobile i {
        margin-right: 5px !important;
    }

    .pro-tip-banner {
        margin-top: -45px;
        /* Move up slightly as requested */
        margin-bottom: 25px !important;
    }
}

.footer {
    padding: 8px 0;
    /* Shrink footer as requested */
    margin-top: auto;
    border-top: 1px solid var(--card-border);
    background: #000;
}

.footer .container {
    text-align: center;
}

.footer p {
    color: #7ca6f5;
    font-size: 0.9rem;
    opacity: 1;
}

.viewport {
    container-type: inline-size;
    position: relative;
    width: 100%;
    height: 100%;
}

.preview-container img,
.preview-container video {
    width: 100%;
    height: 100%;
}

/* Shortcut Legend Styling */
.shortcut-legend-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px 18px;
    /* Slightly more compact */
    margin-top: auto;
    /* Pin to bottom of flex container to align with other columns */
    backdrop-filter: blur(10px);
}

.legend-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.8;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-item kbd {
    background: #222;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 1px 5px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    color: #fff;
    box-shadow: 0 1.5px 0 #000;
}

.legend-item span {
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Settings Accordion */
.collapsible-section {
    border-bottom: 1px solid var(--card-border);
    transition: var(--transition);
}

.collapsible-section:last-child {
    border-bottom: none;
}

.collapsible-trigger {
    padding: 18px 5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background 0.2s;
}

.collapsible-trigger:hover {
    background: rgba(255, 255, 255, 0.02);
}

.collapsible-trigger h3 {
    margin: 0 !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
}

.collapsible-trigger i.fa-chevron-down {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
    opacity: 0;
}

.collapsible-section.active .collapsible-trigger i.fa-chevron-down {
    transform: rotate(180deg);
    color: var(--accent);
}

.collapsible-section.active .collapsible-content {
    max-height: 1500px;
    /* Increased for text layers list */
    opacity: 1;
    padding-bottom: 25px;
}

.collapsible-section.active .collapsible-trigger h3 {
    color: var(--accent);
}