html {
    height: 100%;
    font-size: 75%;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 0;
    flex: 1;
}

#main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-inverse);
}

.hero {
    padding: 6rem 2rem;
    text-align: center;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(circle at bottom left, rgba(79, 70, 229, 0.15), transparent);
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 3rem;
}

#navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.uni-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    transition: var(--transition);
    cursor: pointer;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.uni-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: var(--glass-shadow);
}

.uni-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.uni-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-primary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: scale(1.05);
}

.btn-link {
    background: transparent;
    color: var(--text-main);
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}

.btn-link:hover {
    color: var(--primary-color);
}

.btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--bg-accent);
    color: var(--text-main);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid var(--glass-border);
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #3d4a5e;
    border-color: var(--primary-color);
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem !important;
}

select option {
    background-color: var(--bg-dark);
    color: var(--text-main);
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   CONTENT MANAGER STYLES
   ============================================ */

.content-manager-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.content-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.header-content h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.header-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.breadcrumb-item.clickable {
    cursor: pointer;
    transition: color 0.2s ease;
}

.breadcrumb-item.clickable:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
    cursor: default;
}

.breadcrumb-separator {
    color: var(--text-muted);
    opacity: 0.5;
}


/* Content Level */
.content-level {
    margin-bottom: 3rem;
}

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.level-header h2 {
    font-size: 1.75rem;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.content-item {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.content-item:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

/* Scope-disabled items (out of lecturer's access scope) */
.content-item.scope-disabled {
    opacity: 0.75;
    cursor: not-allowed;
    pointer-events: none;
    background: rgba(100, 116, 139, 0.1);
    border-color: rgba(100, 116, 139, 0.2);
}

.content-item.scope-disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(100, 116, 139, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-header h3 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin: 0;
    flex: 1;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.card-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.card-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

/* Chapter Boxes */
.chapters-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.chapter-box {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
}

.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-bottom: 1px solid var(--glass-border);
}

.chapter-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--primary-color);
}

.chapter-content {
    padding: 1.5rem;
}

/* Topic Sections */
.topic-section {
    margin-bottom: 1.5rem;
}

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.topic-title {
    color: #818cf8;
    font-size: 1rem;
    font-weight: 600;
    padding-left: 0.75rem;
    border-left: 3px solid var(--primary-color);
    margin: 0;
}

.btn-edit-topic {
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-edit-topic:hover {
    background: var(--bg-accent);
    border-color: var(--primary-color);
}

.btn-add-topic {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 2px dashed var(--glass-border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    margin-top: 1rem;
}

.btn-add-topic:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

/* Video List */
.video-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.video-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-accent);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.video-item:hover {
    background: var(--bg-card);
    transform: translateX(5px);
    border-color: var(--primary-color);
}

/* Draft video styling */
.video-item-draft {
    border-style: dashed;
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.04);
}
.video-item-draft:hover {
    border-color: rgba(245, 158, 11, 0.7);
    background: rgba(245, 158, 11, 0.08);
}
.video-draft-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    padding: 2px 7px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
    white-space: nowrap;
}

.play-icon {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.video-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.video-title {
    font-weight: 500;
    font-size: 0.95rem;
}

.video-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1rem;
    grid-column: 1 / -1;
}

/* Modal Forms */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.modal-form label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.modal-input,
.modal-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-accent);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.modal-input:focus,
.modal-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-card);
}

.modal-textarea {
    min-height: 100px;
    resize: vertical;
}

.delete-warning {
    padding: 1rem;
}

.warning-text {
    color: #ef4444;
    font-weight: 600;
    margin: 1rem 0;
}

.warning-subtext {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .content-manager-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .level-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Empty topic styling */
.topic-section.empty-topic {
    background: rgba(99, 102, 241, 0.05);
    border: 1px dashed rgba(99, 102, 241, 0.3);
    padding: 1rem;
    border-radius: 8px;
}

.topic-empty-badge {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 400;
    margin-left: 0.5rem;
}

.topic-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* [PAGE-ALIGN] PDF Peek button — opens textbook at page */
.peek-pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 1px 4px;
    margin-left: 2px;
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    vertical-align: middle;
    line-height: 1;
}

.peek-pdf-btn:hover {
    opacity: 1;
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    transform: scale(1.15);
}

/* [PAGE-ALIGN] PDF Peek Modal */
.peek-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.peek-modal-content {
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.1));
    border-radius: 16px;
    width: 90vw;
    max-width: 860px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.peek-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-bottom: 1px solid var(--glass-border, rgba(255,255,255,0.1));
}

.peek-modal-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-color, #818cf8);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.peek-page-jump {
    display: flex;
    align-items: center;
    gap: 6px;
}

.peek-page-label-text {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
    white-space: nowrap;
}

.peek-page-input {
    width: 52px;
    padding: 4px 6px;
    text-align: center;
    background: var(--bg-accent, #334155);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.1));
    border-radius: 6px;
    color: var(--text-main, #e2e8f0);
    font-size: 0.85rem;
    font-weight: 600;
    -moz-appearance: textfield;
    transition: border-color 0.15s ease;
}

.peek-page-input::-webkit-outer-spin-button,
.peek-page-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.peek-page-input:focus {
    outline: none;
    border-color: var(--primary-color, #6366f1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.peek-page-total {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
    white-space: nowrap;
}

.peek-offset-badge {
    font-size: 0.65rem;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.25);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    font-weight: 600;
}

.peek-nav-btn {
    background: var(--bg-accent, #334155);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.1));
    color: var(--text-main, #e2e8f0);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.peek-nav-btn:hover {
    background: var(--primary-color, #6366f1);
    color: white;
    border-color: var(--primary-color, #6366f1);
}

.peek-close-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.peek-close-btn:hover {
    background: #ef4444;
    color: white;
}

.peek-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    background: #0f172a;
    min-height: 400px;
}

.peek-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-muted, #94a3b8);
    font-size: 0.95rem;
}

.btn-add-video-small {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0 12px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-add-video-small:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-edit-topic {
    background: transparent;
    border: 1px solid var(--glass-border);
    padding: 0 8px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-edit-topic:hover {
    background: var(--bg-accent);
    border-color: var(--primary-color);
}

.btn-add-topic {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px dashed var(--primary-color);
    color: var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-add-topic:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

/* Drag and Drop Styles */
[draggable="true"] {
    cursor: grab;
    user-select: none;
}

[draggable="true"]:active {
    cursor: grabbing;
}

.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5) !important;
}

.drop-over {
    border: 2px solid var(--primary-color) !important;
    background: rgba(99, 102, 241, 0.1) !important;
    position: relative;
    transition: all 0.2s ease;
}

.drop-over::before {
    content: '🎯';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    opacity: 0.5;
    z-index: 10;
}

/* Collapsible Section Styles */
.chapter-header,
.topic-header {
    cursor: pointer;
    user-select: none;
}

.chapter-header:hover h3,
.topic-header:hover .topic-title {
    opacity: 0.8;
}

.chevron-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.collapsed .chapter-content,
.collapsed .video-list {
    display: none;
}

.collapsed .chevron-icon {
    transform: rotate(-90deg);
}

.expansion-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.btn-control-small {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-control-small:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

/* Search Styles */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-accent);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.25rem 0.5rem;
    min-width: 300px;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

.search-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.6rem 0.75rem;
    width: 100%;
    font-size: 0.95rem;
    outline: none;
}

.btn-search {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-search:hover {
    opacity: 1;
}

.btn-search-clear {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-muted);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.btn-search-clear:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.search-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.85rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.search-results-container {
    margin-top: 1.5rem;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-result-item {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.search-result-item:hover {
    border-color: var(--primary-color);
    transform: translateX(8px);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.result-icon {
    font-size: 2rem;
    min-width: 50px;
    text-align: center;
}

.result-content {
    flex: 1;
}

.result-title {
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
}

.result-type-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    color: var(--primary-color);
}

.result-path {
    font-size: 0.85rem;
    color: var(--primary-color);
    opacity: 0.8;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.result-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.result-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    opacity: 0.3;
    transition: all 0.2s ease;
}

.search-result-item:hover .result-arrow {
    opacity: 1;
    transform: translateX(5px);
}

/* Search Target Highlight */
.search-target-highlight {
    border: 2px solid var(--primary-color) !important;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4) !important;
    animation: pulseHighlight 2s ease-in-out infinite;
    position: relative;
    z-index: 5;
    border-radius: 12px;
}

@keyframes pulseHighlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 35px rgba(99, 102, 241, 0.6);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    }
}

/* Sidebar Layout */
.content-manager-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    position: relative;
}

.main-content-area {
    flex: 1;
    min-width: 0;
}

.search-panel {
    width: 350px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: slideInRight 0.3s ease forwards;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.search-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
}

.search-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.search-panel .search-result-item {
    padding: 1rem;
    gap: 1rem;
    border-radius: 12px;
}

.search-panel .result-icon {
    font-size: 1.2rem;
    min-width: 30px;
}

.search-panel .result-title {
    font-size: 0.95rem;
}

.search-panel .result-path {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.search-panel .result-description {
    display: none;
}

.btn-close-sidebar {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    margin-left: auto;
    margin-right: 0.75rem;
}

.btn-close-sidebar:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: scale(1.1) rotate(90deg);
    border-color: #ef4444;
}

.video-item-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-item:hover .video-item-actions {
    opacity: 1;
}

.btn-icon-small {
    background: var(--bg-accent);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-width: 32px;
    height: 32px;
}

.btn-icon-small:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.btn-icon-small.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* Context Menu Trigger (3-dots) */
.context-trigger {
    background: var(--bg-accent);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-width: 32px;
    height: 32px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.context-trigger:hover {
    background: var(--bg-hover, rgba(99, 102, 241, 0.1));
    border-color: var(--primary-color);
    color: var(--text-main);
    transform: scale(1.1);
}

/* ============================================
   VIDEO CAPTION STYLES
   ============================================ */
::cue {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: calc(var(--player-width, 100vw) * 0.025);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    /* 🚀 Push captions up slightly to avoid controls overlap */
    transform: translateY(calc(var(--player-width, 100vw) * -0.03));
}