﻿:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --accent: #a855f7;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-panel: #111827;
    --border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --header-height: 56px;
    --success: #10b981;
    /* Emerald */
    --danger: #ef4444;
    /* Red */
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Helvetica Neue', 'Arial', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', 'Yu Gothic', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100%;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 60px;
    background: rgba(13, 13, 26, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Expanded: flex-start handled via class */
    padding: 10px 0;
    border-right: 1px solid var(--border);
    z-index: 100;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.expanded {
    width: 200px;
    align-items: flex-start;
    padding-left: 10px;
}

.sidebar.expanded .reorder-hint,
.sidebar.expanded #resetSidebarOrder {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.sidebar.expanded #resetSidebarOrder {
    justify-content: flex-start;
    padding-left: 10px;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.sidebar:not(.expanded) .logo-text,
.sidebar:not(.expanded) .reorder-hint span,
.sidebar:not(.expanded) #resetSidebarOrder span {
    display: none !important;
}

.sidebar:not(.expanded) .sidebar-header {
    justify-content: center !important;
    padding: 0 !important;
}

.sidebar:not(.expanded) .logo {
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
}

.logo {
    font-size: 1.25rem;
    padding-left: 2px;
}

.logo-icon {
    color: var(--primary);
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.logo-text {
    font-weight: 900;
    letter-spacing: 1px;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    color: var(--primary);
    margin-left: 2px;
}

.nav-btn {
    width: 46px;
    height: 46px;
    margin-bottom: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.sidebar.expanded .nav-btn {
    width: 180px;
    justify-content: flex-start;
    padding-left: 14px;
}

.nav-text {
    display: none;
    margin-left: 14px;
    font-size: 0.95rem;
    font-weight: 600;
}

.sidebar.expanded .nav-text {
    display: inline-block;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(3px);
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: #fff;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.5), 0 0 10px rgba(59, 130, 246, 0.3);
}

.nav-btn.dragging {
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.95);
    border: 2px dashed var(--primary);
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: #fff;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px #fff;
}

.spacer {
    flex: 1;
}

/* Main Panel */
.main-panel {
    flex: 1;
    background: var(--bg-panel);
    padding: 20px;
    overflow-y: auto;
    max-width: 600px;
    border-right: 1px solid var(--border);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    display: inline-block;
}

h3 {
    font-size: 1rem;
    margin: 0 0 10px 0;
    color: var(--accent);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Consistent Accordion (details/summary) */
details.styled-accordion {
    margin-top: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

details.styled-accordion summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 700;
    color: var(--accent);
    font-size: 0.85rem;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.1);
    outline: none;
    user-select: none;
}

details.styled-accordion summary::-webkit-details-marker {
    display: none;
}

details.styled-accordion summary::before {
    content: "\f0da";
    /* fa-caret-right */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    transition: transform 0.2s ease;
    width: 12px;
    text-align: center;
}

details.styled-accordion[open] summary::before {
    transform: rotate(90deg);
}

details.styled-accordion summary:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

details.styled-accordion>.accordion-content {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Elements */
.styled-input,
.styled-textarea,
.styled-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.styled-input:focus,
.styled-textarea:focus,
.styled-select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 5px rgba(224, 170, 255, 0.3);
}

/* Dropdown options styling */
.styled-select option {
    background-color: var(--bg-card);
    color: #fff;
    padding: 10px;
}

.control-row {
    margin-bottom: 15px;
}

.control-row label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--border);
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: rgba(123, 44, 191, 0.1);
}

.file-upload-area input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* List Items */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.rank-item-card {
    background: rgba(0, 0, 0, 0.2);
    border-left: 4px solid var(--primary);
    padding: 10px;
    border-radius: 4px;
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 10px;
    align-items: center;
}

.rank-number-input {
    width: 60px;
    display: flex;
    justify-content: center;
}

.rank-number-input input {
    width: 100%;
    background: rgba(224, 170, 255, 0.1);
    border: 1px solid rgba(224, 170, 255, 0.3);
    border-radius: 4px;
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    padding: 6px 2px;
}

.rank-number-input input:focus {
    background: rgba(224, 170, 255, 0.2);
    border-color: var(--accent);
    outline: none;
}

.rank-inputs input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 6px 4px;
    margin-bottom: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.rank-inputs input:focus {
    border-bottom-color: var(--primary);
    outline: none;
}

#savedVideosGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

/* Material Library Styles */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.lib-item {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.2s;
}

.lib-item:hover {
    border-color: #7b2cbf;
}

.lib-item.selected {
    border-color: #00b894;
    box-shadow: 0 0 10px rgba(0, 184, 148, 0.5);
}

.lib-item img,
.lib-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lib-item .lib-name {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 10px;
    padding: 2px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Edit and Delete Buttons */
.lib-item:hover .delete-btn,
.lib-item:hover .edit-btn,
.lib-item:hover .download-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.lib-item .download-btn {
    position: absolute;
    top: 5px;
    right: 55px;
    background: #3b82f6;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: none;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.lib-item .edit-btn {
    position: absolute;
    top: 5px;
    right: 30px;
    background: #10b981;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: none;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.lib-item .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ef4444;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: none;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Preview Area */
.preview-area {
    flex: 2;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    padding-top: 80px;
    /* Add top spacing */
    position: relative;
    overflow-y: auto;
    /* Allow scrolling if needed */
}

.preview-wrapper {
    height: auto;
    max-height: 80vh;
    /* Restore original large size */
    aspect-ratio: 9/16;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    /* Add spacing below video */
}

canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Preview Controls */
.preview-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 25px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(123, 44, 191, 0.5);
}

.time-display {
    font-family: 'Inter', monospace;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 500;
    letter-spacing: 1px;
}

.export-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #7209b7, #4cc9f0);
    border: none;
    padding: 12px 24px;
    color: #fff;
    font-weight: bold;
    border-radius: 50px;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(114, 9, 183, 0.4);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.export-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(114, 9, 183, 0.6);
}

.section-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    background: var(--bg-dark);
    padding: 5px;
    border-radius: 8px;
}

.section-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
}

.section-tab.active {
    background: var(--primary);
    color: #fff;
}

.section-content {
    display: none;
}

.section-content.active {
    display: block;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    color: var(--accent);
    margin-top: 0;
}

.modal-desc {
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    margin-top: 20px;
    gap: 10px;
}

.modal-primary-btn,
.modal-secondary-btn,
.modal-cancel-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.modal-primary-btn {
    background: var(--primary);
    color: white;
}

.modal-secondary-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.modal-cancel-btn {
    background: transparent;
    color: #888;
}

.ai-primary-button {
    width: 100%;
    background: linear-gradient(135deg, #7b2cbf, #9d4edd);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    transition: background 0.2s;
}

.ai-primary-button:hover {
    background: linear-gradient(135deg, #9d4edd, #c77dff);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    /* Top: Preview */
    .preview-area {
        height: 40vh;
        flex: none;
        order: 1;
        padding: 10px;
        background: #000;
        border-bottom: 1px solid var(--border);
    }

    .preview-wrapper {
        height: 100%;
        max-height: 100%;
        width: auto;
        aspect-ratio: 9/16;
        box-shadow: none;
    }

    /* Middle: Main Panel */
    .main-panel {
        flex: 1;
        order: 2;
        max-width: none;
        padding: 15px;
        padding-bottom: 80px;
        /* Space for bottom nav */
        border-right: none;
    }

    /* Bottom: Sidebar (Nav) */
    .sidebar {
        width: 100%;
        height: 60px;
        order: 3;
        flex-direction: row;
        justify-content: space-around;
        border-right: none;
        border-top: 1px solid var(--border);
        padding: 0;
        position: fixed;
        bottom: 0;
        left: 0;
        background: rgba(13, 13, 26, 0.95);
        backdrop-filter: blur(10px);
        z-index: 1000;
    }

    .logo {
        display: none;
    }

    .spacer {
        display: none;
    }

    .nav-btn {
        margin: 0;
        flex: 1;
        height: 100%;
        border-radius: 0;
        font-size: 1.4rem;
        /* Larger touch target */
    }

    .nav-btn.active {
        box-shadow: inset 0 -4px 0 var(--primary);
        /* Bottom line indicator */
        background: rgba(255, 255, 255, 0.05);
    }

    /* Adjust specific elements */
    .export-button {
        bottom: 10px;
        right: 10px;
        padding: 10px 18px;
        font-size: 0.85rem;
    }

    .preview-controls {
        padding: 5px 15px;
        gap: 15px;
    }

    .control-btn {
        width: 35px;
        height: 35px;
    }

    .time-display {
        font-size: 0.9rem;
    }
}

/* Visual Timeline */
.timeline-visual {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    overflow-x: auto;
    min-height: 180px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.timeline-visual::-webkit-scrollbar {
    height: 6px;
}

.timeline-visual::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.timeline-clip {
    flex: 0 0 140px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    position: relative;
    transition: all 0.2s;
    cursor: grab;
    user-select: none;
}

.timeline-clip.dragging {
    opacity: 0.5;
    transform: scale(0.9);
}

.timeline-clip.drag-over {
    border-color: var(--primary) !important;
    background: rgba(123, 44, 191, 0.2);
    box-shadow: 0 0 10px var(--primary);
}

.timeline-clip.active {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(224, 170, 255, 0.3);
    transform: scale(1.05);
}

.clip-thumb {
    width: 100%;
    aspect-ratio: 9/16;
    background: #000;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    position: relative;
}

.clip-type-icon {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.6);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.clip-info {
    text-align: center;
}

.clip-label {
    display: block;
    font-size: 0.75rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clip-duration {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.clip-actions {
    position: absolute;
    top: -10px;
    right: -10px;
    display: none;
    gap: 5px;
}

.timeline-clip:hover .clip-actions {
    display: flex;
}

.clip-action-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.clip-action-btn.del {
    background: var(--danger);
}

.clip-action-btn.dup {
    background: var(--primary);
}

.clip-action-btn.edit {
    background: var(--success);
}

.timeline-transition {
    flex: 0 0 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-transition:hover {
    background: rgba(123, 44, 191, 0.2);
    border-color: var(--primary);
    color: #fff;
}

.timeline-add-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
    font-style: italic;
}

/* Animations */
@keyframes clipPulse {
    0% {
        border-color: var(--accent);
    }

    50% {
        border-color: var(--primary);
    }

    100% {
        border-color: var(--accent);
    }
}

.timeline-clip.playing {
    animation: clipPulse 1s infinite;
}

/* Modal & Progress */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: #10002b;
    border-radius: 6px;
    overflow: hidden;
    margin: 20px 0;
    border: 1px solid var(--border);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #9d4edd);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--primary);
}

/* Saved Videos List */
.video-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 80vh;
    overflow-y: auto;
}

.saved-video-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.saved-video-item:hover {
    border-color: var(--primary);
    background: #2a2a4a;
}

.video-item-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow: hidden;
}

.video-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.video-item-actions {
    display: flex;
    gap: 8px;
    margin-left: 15px;
}

.mini-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
}

.mini-action-btn:hover {
    transform: scale(1.1);
    color: #fff;
}

.mini-action-btn.play {
    color: var(--success);
}

.mini-action-btn.download {
    color: var(--accent);
}

.mini-action-btn.delete:hover {
    background: var(--danger);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* === POLISHED MODERN DESIGN === */

body {
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    background-attachment: fixed;
}

/* Sidebar Refinement - Glassmorphism */
.sidebar {
    width: 240px !important;
    background: rgba(15, 23, 42, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 30px 15px !important;
    display: flex !important;
    flex-direction: column !important;
    transition: all 0.3s ease !important;
}

.logo {
    display: block !important;
    font-size: 1.6rem !important;
    font-weight: 900 !important;
    color: #fff !important;
    margin-bottom: 40px !important;
    padding-left: 10px !important;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-btn {
    width: 100% !important;
    height: 52px !important;
    margin-bottom: 8px !important;
    justify-content: flex-start !important;
    padding-left: 20px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 14px !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: white !important;
    transform: translateX(4px);
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--primary), #2563eb) !important;
    color: white !important;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3) !important;
}

.nav-text {
    display: inline-block !important;
    margin-left: 12px !important;
    font-size: 0.95rem !important;
}

.spacer {
    display: block !important;
}

/* Main Panel Refinement */
.main-panel {
    background: transparent !important;
    padding: 40px !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
    border: none !important;
    padding-bottom: 150px !important;
}

.card {
    background: rgba(30, 41, 59, 0.5) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 24px !important;
    padding: 30px !important;
    margin-bottom: 30px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

h2 {
    font-size: 2rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
    border: none !important;
    margin-bottom: 40px !important;
}

/* Styled UI Elements */
.styled-input,
.styled-textarea,
.styled-select {
    background: rgba(15, 23, 42, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    color: white !important;
    padding: 14px !important;
}

.primary-button,
.ai-primary-button,
.export-button {
    border-radius: 12px !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Preview Area Integration - Fixed with clear contrast */
.preview-area {
    position: fixed !important;
    top: 40px !important;
    right: 40px !important;
    width: 380px !important;
    height: auto !important;
    z-index: 100 !important;
    pointer-events: none;
}

.preview-wrapper {
    pointer-events: auto;
}

#previewCanvas,
#savedVideoPreview {
    width: 100% !important;
    height: auto !important;
    border-radius: 30px !important;
    border: 6px solid rgba(255, 255, 255, 0.07) !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5) !important;
    background: #000;
}

/* Layout Reset */
.app-container {
    display: flex !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    grid-template-areas: none !important;
}

#sidebarToggle {
    display: flex !important;
}

.tab-content {
    animation: fadeInSlide 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-controls {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px !important;
    margin-top: 20px !important;
    padding: 10px 25px !important;
}

/* Grid Layout container */
.app-container {
    display: grid !important;
    grid-template-columns: 1fr 480px !important;
    grid-template-rows: 60px 1fr !important;
    grid-template-areas:
        "preview nav"
        "preview main";
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #020617;
    /* Left pane bg */
}

/* 1. Preview Pane (Left) */
.preview-area {
    grid-area: preview;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: 100% !important;
    height: 100% !important;
    background: radial-gradient(circle at center, #1e293b 0%, #020617 100%) !important;
    padding: 20px !important;
    padding-top: 80px !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    pointer-events: auto !important;
    z-index: 5 !important;
}

.preview-wrapper {
    width: 100%;
    height: 100%;
    max-width: none !important;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Canvas styling */
#previewCanvas,
#savedVideoPreview {
    width: auto !important;
    height: 90% !important;
    max-width: 100% !important;
    aspect-ratio: 9/16;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

/* 2. Navigation (Top Right) */
.sidebar {
    grid-area: nav;
    width: 100% !important;
    height: 100% !important;
    background: var(--bg-panel) !important;
    border-bottom: 1px solid var(--border);
    border-right: none !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 0 10px !important;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

/* Nav items horizontal */
.sidebar .logo {
    margin: 0 20px 0 0 !important;
    font-size: 1.2rem;
    white-space: nowrap;
    color: var(--primary);
    font-weight: bold;
}

.sidebar .nav-btn {
    width: auto !important;
    min-width: 40px !important;
    height: 40px !important;
    margin: 0 4px !important;
    padding: 0 15px !important;
    display: inline-flex !important;
    justify-content: center !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
    /* Prevent shrinking */
    white-space: nowrap !important;
}

.sidebar .nav-text {
    display: inline-block !important;
    margin-left: 6px !important;
    font-size: 0.85rem !important;
}

.sidebar .spacer {
    display: none !important;
}

/* 3. Main Panel (Bottom Right) */
.main-panel {
    grid-area: main;
    width: 100% !important;
    max-width: none !important;
    border-right: none !important;
    border-left: 1px solid var(--border);
    background: var(--bg-panel);
    z-index: 10;
    padding-bottom: 50px !important;
    /* Space for scroll */
}

/* Adjust Controls in Preview Area */
.export-actions-wrapper {
    position: absolute !important;
    bottom: 20px !important;
    right: 20px !important;
    left: auto !important;
    width: auto !important;
    display: flex !important;
    gap: 10px !important;
}

/* Move Play/Time controls to center bottom of preview - DESKTOP ONLY OVERLAP */
/* CSS RULE REMOVED to fix overlap issue. Controls should stack naturally. */
/* .preview-controls { ... } */

/* Base style for controls (Mobile default) */
.preview-controls {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 8px 15px;
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: auto !important;
    /* Ensure buttons work on mobile too */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

#timeDisplay {
    color: white !important;
    font-family: monospace;
    font-size: 1.1rem;
    margin-left: 10px;
}

.export-controls {
    position: absolute;
    top: 20px;
    right: 20px;
}

/* ==========================================
   ULTIMATE LAYOUT FIX (CRITICAL)
   ========================================== */

/* Top Header Styles */
.top-header {
    height: var(--header-height);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    color: white;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.header-logo i {
    color: var(--primary);
    font-size: 1.4rem;
}

.header-logo small {
    font-size: 0.65rem;
    background: var(--primary);
    color: white;
    padding: 1px 5px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 4px;
}

/* Forcefully disable grid and use original Flexbox */
.app-container {
    display: flex !important;
    flex-direction: row !important;
    padding-top: var(--header-height) !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    grid-template-areas: none !important;
    height: 100vh !important;
    box-sizing: border-box !important;
}

/* Restore Sidebar to Left side */
.sidebar {
    grid-area: auto !important;
    position: relative !important;
    width: 220px !important;
    height: 100vh !important;
    flex-direction: column !important;
    background: rgba(15, 23, 42, 0.9) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: flex !important;
    backdrop-filter: blur(10px) !important;
    padding: 30px 10px !important;
    z-index: 200 !important;
    flex-shrink: 0 !important;
}

.sidebar .logo {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 40px !important;
    padding-left: 10px !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #2563eb);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.4rem !important;
    font-weight: 900 !important;
    color: white !important;
    letter-spacing: 1px;
}

.logo-text span {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
    color: #94a3b8;
    font-weight: 400;
}

.logo:hover {
    transform: translateY(-2px);
}

/* Desktop Refined Sidebar Styles */
@media (min-width: 769px) {
    .sidebar .nav-btn {
        width: 100% !important;
        height: 44px !important;
        justify-content: flex-start !important;
        padding-left: 15px !important;
        margin-bottom: 5px !important;
        display: flex !important;
        align-items: center !important;
    }

    .sidebar .nav-text {
        display: inline-block !important;
        margin-left: 10px !important;
        font-size: 0.95rem !important;
    }

    .preview-controls {
        background: rgba(15, 23, 42, 0.8) !important;
        backdrop-filter: blur(8px);
        margin: 0 !important;
        margin-top: -42px !important;
        /* Move up onto the video bottom */
        border-radius: 0 0 12px 12px !important;
        padding: 0 12px !important;
        display: flex !important;
        gap: 8px !important;
        pointer-events: auto !important;
        /* CRITICAL: Fixed unable to click buttons */
    }

    .sidebar:not(.expanded) .reorder-hint {
        display: none !important;
    }

    .sidebar.expanded .reorder-hint {
        display: flex !important;
    }
}

/* Desktop Layout Restoration */
@media (min-width: 769px) {
    .main-panel {
        grid-area: auto !important;
        flex: 1 !important;
        margin: 0 !important;
        padding: 30px !important;
        padding-right: 520px !important;
        /* Reservation for floating preview */
        background: transparent !important;
        border: none !important;
        display: block !important;
    }

    .preview-area {
        grid-area: auto !important;
        position: fixed !important;
        top: 60px !important;
        right: 40px !important;
        width: 440px !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        pointer-events: none !important;
        z-index: 300 !important;
    }

    .preview-wrapper {
        pointer-events: auto !important;
        width: 100%;
    }

    #previewCanvas,
    #savedVideoPreview {
        width: 100% !important;
        height: auto !important;
        border-radius: 12px !important;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    /* Hide floating export buttons that were overlapping */
    .preview-area .export-actions-wrapper,
    .preview-area .export-controls {
        display: none !important;
    }
}

.preview-controls .control-btn {
    flex-shrink: 0 !important;
    font-size: 0.85rem !important;
    min-width: 32px;
}

.preview-controls .record-trigger,
.preview-controls .bg-record-trigger {
    padding: 4px 8px !important;
    border-radius: 6px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    white-space: nowrap !important;
}

.preview-controls .record-trigger.recording i {
    animation: pulse-record 1.5s infinite;
    color: #ff4757;
}

.preview-controls .record-trigger i {
    font-size: 0.7rem;
}

@keyframes pulse-record {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.preview-controls .bg-record-trigger i {
    animation: ghost-float 2s ease-in-out infinite;
}

@keyframes ghost-float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
        opacity: 0.7;
    }

    100% {
        transform: translateY(0);
    }
}

.preview-controls .control-btn {
    font-size: 0.9rem !important;
    background: transparent !important;
    border: none !important;
    padding: 5px !important;
    box-shadow: none !important;
}

#timeDisplay {
    color: white !important;
    font-family: monospace;
    font-size: 0.95rem !important;
    margin-left: 5px;
    line-height: 2 !important;
}

#sidebarToggle {
    display: flex !important;
}

/* ==========================================
   MOBILE RESPONSIVE (Smartphone)
   ========================================== */
@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        height: auto !important;
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .app-container {
        flex-direction: column !important;
        display: block !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        height: auto !important;
        min-height: 100vh !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
    }

    /* Bottom Navigation Bar for Mobile (App-like Tab Bar) */
    .sidebar {
        width: 100% !important;
        height: 70px !important;
        flex-direction: row !important;
        padding: 0 !important;
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 2000 !important;
        overflow: hidden !important;
        border-right: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-bottom: none !important;
        background: rgba(15, 23, 42, 0.9) !important;
        backdrop-filter: blur(25px) !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
    }

    .sidebar::-webkit-scrollbar {
        display: none;
    }

    .sidebar .logo,
    .sidebar-header,
    .sidebar-footer,
    #sidebarToggle,
    #resetSidebarOrder,
    .reorder-hint {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        height: 0 !important;
        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .sidebar-content {
        flex-direction: row !important;
        width: 100% !important;
        height: 100% !important;
        justify-content: space-around !important;
        align-items: center !important;
        display: flex !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 0 10px !important;
        background: transparent !important;
    }

    .sidebar .nav-btn {
        width: 48px !important;
        height: 48px !important;
        padding: 0 !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        justify-content: center !important;
        align-items: center !important;
        border-radius: 12px !important;
        transition: all 0.2s ease !important;
    }

    .sidebar .nav-btn i {
        font-size: 1.3rem !important;
        margin: 0 !important;
    }

    .sidebar .nav-text {
        display: none !important;
        /* Hide labels for icon-only look */
    }

    .sidebar .nav-btn.active {
        background: rgba(59, 130, 246, 0.15) !important;
        color: #60a5fa !important;
        box-shadow: none !important;
        border-right: none !important;
    }

    /* Preview Box for Mobile */
    .preview-area {
        position: relative !important;
        top: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 20px 15px !important;
        box-sizing: border-box !important;
        order: -1 !important;
        background: #020617 !important;
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        margin-bottom: 20px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        pointer-events: auto !important;
    }

    #previewCanvas,
    #savedVideoPreview {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
        aspect-ratio: 9/16 !important;
        margin: 0 auto !important;
    }

    .preview-controls {
        position: relative !important;
        margin-top: 15px !important;
        margin-bottom: 10px !important;
        transform: none !important;
        left: 0 !important;
        width: 100% !important;
        max-width: 360px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        border-radius: 12px !important;
        /* Round all corners for mobile tool-look */
        background: rgba(15, 23, 42, 0.9) !important;
    }

    /* Main Panel space adjustment */
    .main-panel {
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px 15px !important;
        padding-bottom: 120px !important;
        /* Space for bottom nav */
        overflow-x: hidden !important;
        overflow-y: visible !important;
        flex: none !important;
        box-sizing: border-box !important;
    }

    /* Hide redundant elements or optimize for small screen */
    .time-display {
        font-size: 0.8rem !important;
    }

    .toggle-floating-btn {
        display: none !important;
    }

    /* Adjust recording icons on mobile */
    .preview-controls .record-trigger,
    .preview-controls .bg-record-trigger {
        font-size: 0 !important;
        padding: 0 !important;
        width: 36px !important;
        height: 36px !important;
        justify-content: center !important;
        margin-left: 5px !important;
    }

    .preview-controls .record-trigger i,
    .preview-controls .bg-record-trigger i {
        font-size: 1rem !important;
        margin: 0 !important;
    }
}

/* PREMIUM SIDEBAR TOGGLE & FLOATING BUTTON (Desktop Only) */
@media (min-width: 769px) {
    .toggle-floating-btn {
        width: 24px;
        height: 24px;
        background: var(--primary);
        border: none;
        border-radius: 50%;
        color: white;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: -12px;
        right: 15px;
        z-index: 1000;
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        font-size: 0.7rem;
    }

    .toggle-floating-btn:hover {
        transform: scale(1.15);
        background: #60a5fa;
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.8);
    }

    .sidebar:not(.expanded) .toggle-floating-btn {
        right: 50%;
        transform: translateX(50%);
    }

    .sidebar.expanded {
        width: 240px !important;
    }

    .sidebar:not(.expanded) {
        width: 65px !important;
    }

    .sidebar:not(.expanded) .logo-text,
    .sidebar:not(.expanded) .nav-text,
    .sidebar:not(.expanded) .reorder-hint,
    .sidebar:not(.expanded) #resetSidebarOrder span {
        display: none !important;
    }

    .sidebar:not(.expanded) .sidebar-footer {
        padding: 10px 0 !important;
    }

    .sidebar:not(.expanded) .nav-btn {
        width: 45px !important;
        margin-left: auto;
        margin-right: auto;
    }
}

.logo-text span {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
    letter-spacing: normal;
    color: var(--primary) !important;
    -webkit-text-fill-color: var(--primary) !important;
}

/* RESTORING MISSING BUTTON STYLES */
.primary-button {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    display: inline-block;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4);
}

.secondary-button {
    background: rgba(255, 255, 255, 0.05);
    color: white !important;
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.accent-btn {
    background: linear-gradient(135deg, #7b2cbf, #9d4edd);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.accent-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(123, 44, 191, 0.4);
}

/* Preset Items */
.preset-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.preset-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.preset-item-info {
    flex: 1;
    overflow: hidden;
}

.preset-item-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.preset-item-date {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.video-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #3b82f6;
    color: white;
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 800;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Batch Mode Selection */
.lib-item.batch-selected::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: #fff;
    text-shadow: 0 0 10px #f00, 0 0 20px #f00;
    z-index: 10;
    pointer-events: none;
    opacity: 1;
}

.lib-item.batch-selected {
    border: 4px solid #ef4444 !important;
    /* Red frame as requested */
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
    opacity: 1;
    transform: scale(0.95);
}

/* File Upload Drag & Drop */
.file-upload-area {
    border: 2px dashed var(--border);
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 120px;
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

.file-upload-area.drag-over {
    border-color: var(--accent);
    background: rgba(168, 85, 247, 0.1);
    transform: scale(1.02);
}

.file-upload-area input[type='file'] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-area i {
    font-size: 2rem;
    color: var(--text-muted);
}

.file-upload-area p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Spacer to push bottom nav items down */
.spacer {
    margin-top: auto;
    width: 100%;
    height: 10px;
}

.nav-btn {
    text-decoration: none !important;
}