:root {
    --bg1: #000000;
    --bg2: #0a0a0a;
    --bg3: #111111;
    --glass: rgba(255, 255, 255, 0.02);
    --glass-strong: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.06);
    --text: #ffffff;
    --text-secondary: #cccccc;
    --muted: #888888;
    --accent1: #ffffff;
    --accent2: #f0f0f0;
    --accent3: #e0e0e0;
    --accent-glow: rgba(255, 255, 255, 0.2);
    --player-max-width: 960px;
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px var(--accent-glow);
}

* { box-sizing: border-box; }
img, video { max-width: 100%; height: auto; display: block; }
button, input, select { font: inherit; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 50%, var(--bg3) 100%);
    overflow: hidden;
    font-weight: 400;
    line-height: 1.5;
}

#background-effects::before,
#background-effects::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    filter: blur(100px);
    opacity: 0.15;
    z-index: 0;
    animation: float 20s ease-in-out infinite;
}
#background-effects::before {
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.1), transparent 70%);
    top: -100px; left: -100px;
    animation-delay: 0s;
}
#background-effects::after {
    background: radial-gradient(circle at 70% 70%, rgba(255,255,255,0.08), transparent 70%);
    bottom: -100px; right: -100px;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

.glass.panel {
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,0.03);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.glass.panel:hover {
    border-color: rgba(255,255,255,0.12);
    box-shadow: var(--shadow-soft), var(--shadow-glow), inset 0 1px 0 rgba(255,255,255,0.08);
}

.header {
    position: fixed;
    top: 16px; left: 16px; right: 16px;
    padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between;
    z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 18px; margin: 0; letter-spacing: 0.5px; animation: textGlow 4s ease-in-out infinite; }
.logo-glow {
    width: 12px; height: 12px; 
    border-radius: 50%; 
    background: linear-gradient(45deg, var(--accent1), var(--accent2));
    box-shadow: 0 0 16px rgba(255,255,255,0.3), 0 0 32px rgba(255,255,255,0.1);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 16px rgba(255,255,255,0.3), 0 0 32px rgba(255,255,255,0.1);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 24px rgba(255,255,255,0.4), 0 0 48px rgba(255,255,255,0.2);
        transform: scale(1.1);
    }
}

.playlist-input { display: flex; gap: 10px; }
.playlist-input input {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 16px;
    border-radius: 12px;
    min-width: 240px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.playlist-input input:focus {
    outline: none;
    border-color: var(--accent1);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.playlist-input input::placeholder { 
    color: var(--muted); 
    font-weight: 400;
}

.btn {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(240,240,240,0.1));
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text);
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn.small { 
    padding: 8px 12px; 
    border-radius: 10px; 
    font-size: 12px; 
}

.btn:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(240,240,240,0.2));
    border-color: var(--accent1);
    box-shadow: 0 8px 25px rgba(255,255,255,0.2), 0 0 20px rgba(255,255,255,0.1);
    transform: translateY(-2px);
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
}

.btn:active { 
    transform: translateY(0px) scale(0.98); 
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loading-countdown {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--accent1);
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    animation: pulse-countdown 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.countdown-text {
    color: var(--text);
    font-weight: 500;
}

.countdown-timer {
    font-weight: 700;
    color: var(--accent1);
    min-width: 35px;
    text-align: center;
    text-shadow: 0 0 10px var(--accent-glow);
}

@keyframes pulse-countdown {
    0%, 100% { 
        opacity: 1; 
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    }
    50% { 
        opacity: 0.8; 
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
    }
}

.layout {
    position: absolute; top: 110px; bottom: 16px; left: 16px; right: 16px;
    display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px;
    align-items: start;
}

.dashboard { 
    padding: 20px; 
    height: 140px; 
    grid-column: span 2; 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
}

.stat .label { 
    color: var(--text-secondary); 
    font-size: 13px; 
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat .value { 
    font-size: 32px; 
    margin-top: 8px; 
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShine 7s linear infinite;
}

.progress { 
    width: 100%; 
    height: 12px; 
    background: rgba(255,255,255,0.05); 
    border-radius: 999px; 
    margin-top: 12px; 
    overflow: hidden; 
    border: 1px solid rgba(255,255,255,0.1);
}

#progressBar { 
    height: 100%; 
    width: 0%; 
    background: linear-gradient(90deg, var(--accent1), var(--accent2)); 
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
    transition: width 0.8s ease;
    position: relative;
}

#progressBar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 16px; 
}

.mini-stat { 
    background: rgba(255,255,255,0.03); 
    border: 1px solid var(--border); 
    border-radius: 12px; 
    padding: 16px; 
    transition: all 0.3s ease;
}

.mini-stat:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-2px);
}

.mini-label { 
    color: var(--text-secondary); 
    font-size: 12px; 
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-value { 
    font-size: 18px; 
    margin-top: 8px; 
    font-weight: 600;
    color: var(--text);
    animation: textGlow 6s ease-in-out infinite;
}

.player { 
    padding: 20px; 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
    align-items: center; 
}

.player-frame { 
    display: flex; 
    justify-content: center; 
    width: 100%; 
}

#player { 
    width: 100%; 
    max-width: min(var(--player-max-width), 70vw); 
    height: 400px; 
    background: rgba(255,255,255,0.02); 
    border: 1px solid var(--border); 
    border-radius: 16px; 
    overflow: hidden; 
    box-shadow: var(--shadow-soft);
}

.player-info { 
    display: flex; 
    align-items: baseline; 
    gap: 12px; 
    width: 100%; 
    max-width: var(--player-max-width); 
}

.player-info .title { 
    font-size: 18px; 
    font-weight: 600; 
    color: var(--text);
    line-height: 1.4;
    animation: textGlow 5s ease-in-out infinite;
}

.player-info .duration { 
    color: var(--text-secondary); 
    font-size: 14px; 
    font-weight: 500;
}

.player-meta { 
    color: var(--text-secondary); 
    font-size: 14px; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    width: 100%; 
    max-width: var(--player-max-width); 
    font-weight: 500;
}

.player-meta .dot { 
    opacity: 0.6; 
    color: var(--accent1);
}

.controls { 
    display: flex; 
    gap: 12px; 
    width: 100%; 
    max-width: var(--player-max-width); 
}

.list { 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    width: 100%; 
    min-width: 320px; 
    max-width: 400px; 
    height: 100%; 
}

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

.list-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShine 6s linear infinite;
}
.videos { 
    overflow-y: auto; 
    overflow-x: hidden; 
    border: 1px solid var(--border); 
    border-radius: 16px; 
    flex: 1; 
    background: rgba(0,0,0,0.5); 
    min-height: 0; 
    max-height: 60vh; 
    scrollbar-gutter: stable; 
    backdrop-filter: blur(10px);
}

/* Custom scrollbar for playlist */
.videos::-webkit-scrollbar { 
    width: 6px; 
}

.videos::-webkit-scrollbar-track { 
    background: rgba(255,255,255,0.02); 
    border-radius: 6px; 
    margin: 2px 0; 
}

.videos::-webkit-scrollbar-thumb { 
    background: linear-gradient(180deg, var(--accent1), var(--accent2)); 
    border-radius: 6px; 
    border: 1px solid rgba(0,0,0,0.1); 
    background-clip: padding-box; 
    transition: all 0.3s ease; 
    box-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.videos::-webkit-scrollbar-thumb:hover { 
    background: linear-gradient(180deg, var(--accent1), var(--accent2)); 
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
    transform: scaleX(1.2);
}

.videos::-webkit-scrollbar-thumb:active { 
    background: linear-gradient(180deg, var(--accent1), var(--accent2)); 
    box-shadow: 0 0 30px rgba(255,255,255,0.4);
}

/* Firefox scrollbar styling */
.videos { 
    scrollbar-color: var(--accent1) rgba(255,255,255,0.02); 
    scrollbar-width: thin; 
}
.video-row { 
    display: grid; 
    grid-template-columns: auto 1fr auto; 
    gap: 12px; 
    align-items: center; 
    padding: 16px 20px; 
    border-bottom: 1px solid rgba(255,255,255,0.04); 
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.video-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.6s ease;
}

.video-row:hover::before {
    left: 100%;
}

.video-row:hover {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.08);
    transform: translateX(4px);
}

.video-row:last-child { 
    border-bottom: none; 
}

.video-title { 
    font-size: 15px; 
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
    animation: slideInFromLeft 0.6s ease forwards;
    opacity: 0;
    transform: translateX(-20px);
}

.video-title.completed {
    color: var(--text-secondary);
    text-decoration: line-through;
}

.video-duration { 
    color: var(--text-secondary); 
    font-size: 12px; 
    font-weight: 500;
    animation: slideInFromRight 0.6s ease forwards;
    opacity: 0;
    transform: translateX(20px);
}

/* Staggered animation delays for video rows */
.video-row:nth-child(1) .video-title { animation-delay: 0.1s; }
.video-row:nth-child(1) .video-duration { animation-delay: 0.2s; }
.video-row:nth-child(2) .video-title { animation-delay: 0.2s; }
.video-row:nth-child(2) .video-duration { animation-delay: 0.3s; }
.video-row:nth-child(3) .video-title { animation-delay: 0.3s; }
.video-row:nth-child(3) .video-duration { animation-delay: 0.4s; }
.video-row:nth-child(4) .video-title { animation-delay: 0.4s; }
.video-row:nth-child(4) .video-duration { animation-delay: 0.5s; }
.video-row:nth-child(5) .video-title { animation-delay: 0.5s; }
.video-row:nth-child(5) .video-duration { animation-delay: 0.6s; }
.video-row:nth-child(6) .video-title { animation-delay: 0.6s; }
.video-row:nth-child(6) .video-duration { animation-delay: 0.7s; }
.video-row:nth-child(7) .video-title { animation-delay: 0.7s; }
.video-row:nth-child(7) .video-duration { animation-delay: 0.8s; }
.video-row:nth-child(8) .video-title { animation-delay: 0.8s; }
.video-row:nth-child(8) .video-duration { animation-delay: 0.9s; }
.video-row:nth-child(9) .video-title { animation-delay: 0.9s; }
.video-row:nth-child(9) .video-duration { animation-delay: 1.0s; }
.video-row:nth-child(10) .video-title { animation-delay: 1.0s; }
.video-row:nth-child(10) .video-duration { animation-delay: 1.1s; }

.video-actions { 
    display: flex; 
    gap: 8px; 
    align-items: center;
}

.checkbox { 
    width: 20px; 
    height: 20px; 
    accent-color: #000000;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.checkbox:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.2));
}

.checkbox:checked {
    animation: checkboxPop 0.4s ease;
}

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

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

@keyframes checkboxPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Smart Progress Bar */
.smart-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    animation: slideDown 0.3s ease-out;
}

.progress-container {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff88, #00d4ff);
    border-radius: 2px;
    transition: width 0.3s ease;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

.progress-fill.error {
    background: linear-gradient(90deg, #ff4444, #ff6666);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.progress-text {
    position: absolute;
    top: -8px;
    right: 0;
    font-size: 12px;
    font-weight: 600;
    color: #00ff88;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
    transition: color 0.3s ease;
}

.progress-text.error {
    color: #ff4444;
    text-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
}

.progress-status {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    text-align: center;
    margin-top: 4px;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.smart-progress-bar.hide {
    animation: slideUp 0.3s ease-in forwards;
}

/* Syllabus Section */
.syllabus-section {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 16px;
}

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

.syllabus-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.syllabi-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.syllabus-folder {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.syllabus-folder:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.syllabus-folder-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 8px;
    user-select: none;
}

.syllabus-folder-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    color: var(--accent1);
}

.syllabus-folder.expanded .syllabus-folder-icon {
    transform: rotate(90deg);
}

.syllabus-folder-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.syllabus-folder-count {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
}

.syllabus-folder-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.syllabus-folder:hover .syllabus-folder-actions {
    opacity: 1;
}

.syllabus-action-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.syllabus-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text);
    transform: scale(1.1);
}

.syllabus-folder-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.syllabus-folder.expanded .syllabus-folder-content {
    max-height: 500px;
}

/* Subject Items */
.subject-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    margin: 4px 0;
    transition: all 0.3s ease;
    cursor: move;
    position: relative;
}

.subject-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.subject-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    z-index: 1000;
}

.subject-item.drop-target {
    border-color: var(--accent1);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.subject-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 8px;
    user-select: none;
}

.subject-icon {
    font-size: 16px;
    color: var(--accent1);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.subject-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.subject-count {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
}

.subject-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.subject-item:hover .subject-actions {
    opacity: 1;
}

.subject-action-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.subject-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text);
    transform: scale(1.1);
}

.subject-content {
    padding: 0 12px 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Link Items */
.link-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.link-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.link-icon {
    font-size: 12px;
    color: var(--accent1);
    margin-right: 8px;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

.link-text {
    flex: 1;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.link-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.link-item:hover .link-actions {
    opacity: 1;
}

.link-action-btn {
    width: 18px;
    height: 18px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.3s ease;
}

.link-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text);
    transform: scale(1.1);
}

/* Playlists Section */
.playlists-section {
    margin-bottom: 20px;
}

.playlists-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 12px 0;
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.playlists-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(2px);
}

.playlist-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.playlist-item-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-count {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

/* Drag and Drop */
.drop-zone {
    border: 2px dashed rgba(0, 255, 136, 0.3);
    background: rgba(0, 255, 136, 0.05);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    color: var(--accent1);
    font-size: 12px;
    transition: all 0.3s ease;
}

.drop-zone.active {
    border-color: var(--accent1);
    background: rgba(0, 255, 136, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    z-index: 1000;
    min-width: 150px;
}

.context-menu-item {
    padding: 8px 16px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent1);
}

.context-menu-item.danger:hover {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

@media (max-width: 1100px) {
    .layout { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 16px; }
    .dashboard { grid-column: 1; }
    .list { min-height: 260px; max-width: none; }
}

/* When playlist hidden, use single column layout */
.layout.no-list { grid-template-columns: 1fr !important; }


/* Auth View */
.auth-view { display: flex; align-items: center; justify-content: center; padding: 40px; min-height: 60vh; }
.auth-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: var(--shadow-soft);
}
.auth-title { margin: 0 0 6px 0; font-size: 20px; font-weight: 700; }
.auth-subtitle { margin: 0 0 16px 0; color: var(--text-secondary); font-size: 14px; }
#loginForm { display: flex; flex-direction: column; gap: 10px; }
#loginForm input {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 14px;
    border-radius: 12px;
}
.auth-hint { color: var(--muted); font-size: 12px; margin-top: 12px; }

/* Cards + Grid */
.view-header { display: flex; align-items: center; gap: 12px; padding: 12px 4px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    cursor: pointer;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.14); box-shadow: var(--shadow-glow); background: rgba(255,255,255,0.04); }
.card-title { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; }
.card-title .icon { color: var(--accent1); font-size: 18px; }
.card-title .title-text { background: linear-gradient(90deg, #ffffff, #bbbbbb, #ffffff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: textShine 8s linear infinite; }
.card-sub { color: var(--text-secondary); font-size: 13px; margin-top: 8px; }
.card-actions { display: flex; gap: 8px; margin-top: 14px; opacity: 0.95; flex-wrap: wrap; }
.card-actions .btn.small { padding: 8px 10px; font-size: 12px; white-space: nowrap; }
.progress-compact { width: 100%; height: 8px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; margin-top: 10px; border: 1px solid rgba(255,255,255,0.1); }
.progress-compact > span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #00ff88, #00d4ff); box-shadow: 0 0 12px rgba(0, 255, 136, 0.3) inset; transition: width 0.4s ease; }

/* FAB */
.fab {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(240,240,240,0.1));
    color: var(--text);
    font-size: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.fab:hover { box-shadow: 0 12px 36px rgba(0,0,0,0.6), 0 0 16px rgba(255,255,255,0.2); border-color: var(--accent1); }

@keyframes textGlow {
    0%, 100% { text-shadow: 0 0 4px rgba(255,255,255,0.08), 0 0 10px rgba(255,255,255,0.06); }
    50% { text-shadow: 0 0 10px rgba(255,255,255,0.18), 0 0 20px rgba(255,255,255,0.12); }
}
@keyframes textShine {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .brand h1, .list-header h2, .player-info .title, .card-title .title-text, .mini-value, .stat .value { animation: none !important; }
}


