/* =============================================
   WBVDO — Main Stylesheet
   Premium YouTube-inspired Dark Theme
   ============================================= */

/* ── CSS Custom Properties ── */
:root {
    /* Dark Theme (Default) */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #222222;
    --bg-card: #272727;
    --bg-hover: #3a3a3a;
    --bg-active: #3e3e3e;
    --bg-input: #121212;
    --bg-overlay: rgba(0, 0, 0, 0.7);
    --bg-glass: rgba(26, 26, 26, 0.85);

    --text-primary: #f1f1f1;
    --text-secondary: #aaaaaa;
    --text-tertiary: #717171;
    --text-link: #3ea6ff;

    --border-color: #303030;
    --border-light: #3a3a3a;

    --accent-red: #ff0000;
    --accent-red-hover: #cc0000;
    --accent-blue: #3ea6ff;
    --accent-blue-hover: #65b8ff;
    --accent-green: #2ecc71;
    --accent-yellow: #f39c12;
    --accent-purple: #9b59b6;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(62,166,255,0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    --navbar-height: 56px;
    --sidebar-width: 240px;
    --mini-sidebar-width: 72px;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f9f9f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f0f0;
    --bg-card: #ffffff;
    --bg-hover: #e5e5e5;
    --bg-active: #d9d9d9;
    --bg-input: #f0f0f0;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    --bg-glass: rgba(255, 255, 255, 0.85);

    --text-primary: #0f0f0f;
    --text-secondary: #606060;
    --text-tertiary: #909090;
    --text-link: #065fd4;

    --border-color: #e0e0e0;
    --border-light: #ececec;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

/* Global Light Theme Overrides for Bootstrap Dark Classes */
[data-theme="light"] .bg-dark,
[data-theme="light"] .bg-black,
[data-theme="light"] .bg-opacity-40 {
    background-color: var(--bg-card) !important;
}
[data-theme="light"] .text-white,
[data-theme="light"] .text-light {
    color: var(--text-primary) !important;
}
[data-theme="light"] .text-muted,
[data-theme="light"] .text-secondary {
    color: var(--text-secondary) !important;
}
[data-theme="light"] .border-secondary {
    border-color: var(--border-color) !important;
}

/* ── Global Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

::selection {
    background: var(--accent-red);
    color: white;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(150, 150, 150, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(150, 150, 150, 0.6);
}

/* ── Top Navbar ── */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--bg-glass);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .top-navbar {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 200px;
}

.navbar-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.25rem;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.navbar-btn:hover {
    background: var(--bg-hover);
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: opacity var(--transition-fast);
}

.navbar-logo:hover {
    opacity: 0.85;
}

.logo-icon {
    font-size: 1.75rem;
    color: var(--accent-red);
    line-height: 1;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent-red), #ff4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Search Bar */
.navbar-center {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 640px;
    flex: 1;
    margin: 0 24px;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.search-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-wrapper:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 1px var(--accent-blue);
}

.search-input {
    flex: 1;
    height: 40px;
    padding: 0 16px;
    background: var(--bg-input);
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-family);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-btn {
    width: 56px;
    height: 40px;
    background: var(--bg-tertiary);
    border: none;
    border-left: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.search-btn:hover {
    background: var(--bg-hover);
}

.voice-search-btn {
    background: var(--bg-tertiary);
}

/* Navbar Right */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 200px;
    justify-content: flex-end;
}

.create-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.create-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.02);
}

.create-btn:active {
    transform: scale(0.98);
}

.create-btn .bi-plus-lg {
    font-size: 1.1rem;
}

.notification-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: var(--accent-red);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.user-avatar-btn {
    padding: 2px;
}

.user-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.sign-in-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius-xl);
    color: var(--accent-blue);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.sign-in-btn:hover {
    background: rgba(62, 166, 255, 0.1);
    color: var(--accent-blue);
}

/* Dropdown Panels */
.navbar-dropdown {
    position: relative;
}

.dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg), 0 4px 20px rgba(0,0,0,0.25);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: all var(--transition-normal);
    z-index: 1001;
    overflow: hidden;
}
[data-theme="light"] .dropdown-panel {
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-lg), 0 4px 20px rgba(0,0,0,0.05);
}

.navbar-dropdown.open .dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-header h6 {
    font-size: 1rem;
    font-weight: 600;
}

.dropdown-action {
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.dropdown-action:hover {
    background: var(--bg-hover);
}

.dropdown-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: background var(--transition-fast);
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

.dropdown-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.text-danger { color: #ff4444 !important; }
.text-warning { color: var(--accent-yellow) !important; }

/* User Panel */
.user-panel {
    min-width: 300px;
}

.user-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.user-panel-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.user-panel-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.user-panel-handle {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Notification Panel */
.notification-panel {
    min-width: 360px;
    max-width: 400px;
}

.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-tertiary);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 8px;
    display: block;
    color: var(--text-secondary);
    animation: floatIcon 4s ease-in-out infinite;
}

@keyframes floatIcon {
    0% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

/* Mobile Search */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--bg-secondary);
    z-index: 1002;
    display: none;
    align-items: center;
    padding: 0 8px;
}

.mobile-search-overlay.active {
    display: flex;
}

.mobile-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.mobile-search-back,
.mobile-search-submit {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-primary);
    background: none;
    border: none;
}

.mobile-search-input {
    flex: 1;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    font-family: var(--font-family);
}

/* ── Sidebar ── */
.app-container {
    display: flex;
    padding-top: var(--navbar-height);
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 900;
    transition: transform var(--transition-slow);
}

.sidebar-inner {
    padding: 8px 0;
}

.sidebar-section {
    padding: 4px 12px;
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 400;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.sidebar-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.sidebar-item.active {
    background: var(--bg-active);
    font-weight: 600;
    border-left: 3px solid var(--accent-red);
    padding-left: 9px;
}

.sidebar-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 12px;
}

.sidebar-signin-prompt {
    padding: 12px;
    text-align: left;
}

.sidebar-signin-prompt p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.sidebar-signin-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius-xl);
    color: var(--accent-blue);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.sidebar-signin-btn:hover {
    background: rgba(62, 166, 255, 0.1);
}

.sidebar-footer {
    padding: 16px 24px;
}

.sidebar-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.sidebar-footer-links a {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}

.sidebar-footer-links a:hover {
    color: var(--text-primary);
}

.sidebar-copyright {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 12px;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 899;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mini Sidebar */
.mini-sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    bottom: 0;
    width: var(--mini-sidebar-width);
    background: var(--bg-secondary);
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 4px 0;
    z-index: 800;
    overflow-y: auto;
}

.mini-sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 0;
    width: 100%;
    color: var(--text-secondary);
    font-size: 0.625rem;
    transition: all var(--transition-fast);
}

.mini-sidebar-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mini-sidebar-item.active {
    color: var(--text-primary);
}

.mini-sidebar-item i {
    font-size: 1.25rem;
}

/* ── Main Content ── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: calc(100vh - var(--navbar-height));
    transition: margin-left var(--transition-slow);
}

/* Sidebar collapsed state */
body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed .mini-sidebar {
    display: flex;
}

body.sidebar-collapsed .main-content {
    margin-left: var(--mini-sidebar-width);
}

/* ── Flash Alert Toasts ── */
.alert-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
    position: relative;
}

.alert-success {
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: var(--accent-green);
}

.alert-error {
    background: rgba(255, 68, 68, 0.12);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ff4444;
}

.alert-warning {
    background: rgba(243, 156, 18, 0.12);
    border: 1px solid rgba(243, 156, 18, 0.3);
    color: var(--accent-yellow);
}

.alert-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    opacity: 0.6;
    transition: all var(--transition-fast);
}

.alert-close:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

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

/* ── Category Chips ── */
.category-chips-wrapper {
    margin-bottom: 24px;
    overflow: hidden;
    position: sticky;
    top: var(--navbar-height);
    z-index: 100;
    background: var(--bg-primary);
    padding: 12px 0;
    margin: -24px -24px 24px -24px;
    padding: 12px 24px;
}

.category-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.category-chips::-webkit-scrollbar {
    display: none;
}

.category-chip {
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.category-chip:hover {
    background: var(--bg-hover);
}

.category-chip.active {
    background: var(--text-primary);
    color: var(--bg-primary);
}

/* ── Page Header ── */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Video Grid ── */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px 16px;
}

/* ── Video Card ── */
.video-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    background: transparent;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.video-card-thumbnail {
    position: relative;
    display: block;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--bg-tertiary);
}

.thumbnail-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.video-card:hover .thumbnail-wrapper img {
    transform: scale(1.05);
}

.thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    color: var(--text-tertiary);
    font-size: 3rem;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.thumbnail-hover-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    transform: translateX(8px);
    transition: all var(--transition-normal);
}

.video-card:hover .thumbnail-hover-actions {
    opacity: 1;
    transform: translateX(0);
}

.hover-action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
    backdrop-filter: blur(4px);
}

.hover-action-btn:hover {
    background: rgba(0, 0, 0, 0.95);
}

.video-card-body {
    display: flex;
    gap: 12px;
    padding: 12px 0 16px;
}

.video-card-avatar {
    flex-shrink: 0;
}

.video-card-avatar img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-card-info {
    flex: 1;
    min-width: 0;
}

.video-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.video-card-title:hover {
    color: var(--text-primary);
}

.video-card-channel {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
    transition: color var(--transition-fast);
}

.video-card-channel:hover {
    color: var(--text-primary);
}

.verified-badge {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.video-card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.meta-dot {
    font-size: 0.5rem;
}

.video-card-menu {
    flex-shrink: 0;
}

.video-menu-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1rem;
    opacity: 0;
    transition: all var(--transition-fast);
}

.video-card:hover .video-menu-btn {
    opacity: 1;
}

.video-menu-btn:hover {
    background: var(--bg-hover);
}

/* Load More */
.load-more-wrapper {
    text-align: center;
    padding: 32px 0;
}

/* Pulse Animation for loading */
.pulse {
    animation: pulseAnim 1.5s ease-in-out infinite;
}

@keyframes pulseAnim {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: var(--radius-xl);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.load-more-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.02);
}

.load-more-btn:active {
    transform: scale(0.98);
}

/* Empty State */
.empty-state-page {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    color: var(--text-tertiary);
}

.empty-state-page h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-page p {
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto 24px;
}

.empty-state-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius-xl);
    color: var(--accent-blue);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.empty-state-btn:hover {
    background: rgba(62, 166, 255, 0.1);
    color: var(--accent-blue);
}

/* ── Profile Page ── */
.profile-banner-section {
    margin: -24px -24px 0 -24px;
}

.profile-banner {
    height: 200px;
    background-size: cover;
    background-position: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    position: relative;
}

.profile-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, var(--bg-primary));
}

.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 0 24px 24px;
    margin-top: -48px;
    position: relative;
    z-index: 1;
}

.profile-avatar-wrapper {
    flex-shrink: 0;
}

.profile-avatar-img {
    width: 128px;
    height: 128px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 4px solid var(--bg-primary);
    box-shadow: var(--shadow-md);
}

.profile-info {
    padding-top: 56px;
    flex: 1;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.profile-display-name {
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-display-name .verified-badge {
    font-size: 1rem;
    color: var(--text-secondary);
}

.profile-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.profile-handle {
    color: var(--text-secondary);
}

.profile-bio {
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.profile-actions {
    display: flex;
    gap: 8px;
}

.btn-profile {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
}

.btn-subscribe {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.btn-subscribe:hover {
    opacity: 0.9;
}

.btn-profile-edit {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-profile-edit:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-profile-studio {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-profile-studio:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-profile-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px 12px;
}

.btn-profile-secondary:hover {
    background: var(--bg-hover);
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    padding: 0 24px;
    overflow-x: auto;
}

.profile-tab {
    padding: 12px 24px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.profile-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.profile-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
    font-weight: 600;
}

/* Mobile Responsiveness for Profile */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -64px;
        padding: 0 16px 16px;
    }
    
    .profile-avatar-img {
        width: 100px;
        height: 100px;
    }

    .profile-info {
        padding-top: 16px;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .profile-meta {
        justify-content: center;
    }

    .profile-actions {
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
    }
    
    .profile-bio {
        margin: 0 auto 16px auto;
    }
}

/* ── Settings Page ── */
.settings-page {
    max-width: 1000px;
    margin: 0 auto;
}

.settings-header {
    margin-bottom: 32px;
}

.settings-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.settings-container {
    display: flex;
    gap: 32px;
}

.settings-nav {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--navbar-height) + 24px);
    height: fit-content;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    margin-bottom: 4px;
}

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

.settings-nav-item.active {
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 600;
}

.settings-content {
    flex: 1;
    min-width: 0;
}

.settings-section {
    display: none;
}

.settings-section.active {
    display: block;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

.settings-card-header {
    margin-bottom: 24px;
}

.settings-card-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.settings-card-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.settings-danger-card {
    border-color: rgba(255, 68, 68, 0.3);
}

.settings-errors {
    margin-bottom: 16px;
}

.settings-error-item {
    padding: 8px 12px;
    background: rgba(255, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    color: #ff4444;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-family);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(62, 166, 255, 0.15);
}

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23aaa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
    box-shadow: var(--shadow-glow);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-danger:hover {
    background: #cc0000;
}

/* Avatar & Banner Upload */
.avatar-upload-area {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
}

.current-avatar img {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.banner-upload-area {
    margin-bottom: 20px;
}

.current-banner img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-upload:hover {
    background: var(--bg-hover);
}

.file-input-hidden {
    display: none;
}

.upload-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Account Info */
.account-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.account-info-item {
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.account-info-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.account-info-value {
    font-size: 0.9rem;
    font-weight: 500;
}

.badge-role {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(62, 166, 255, 0.15);
    color: var(--accent-blue);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

/* ── Footer ── */
.app-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    margin-top: 40px;
}

/* ── Animations ── */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive Design ── */

/* Tablets */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mini-sidebar {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    body.sidebar-collapsed .main-content {
        margin-left: 0;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .settings-container {
        flex-direction: column;
    }

    .settings-nav {
        width: 100%;
        position: static;
        display: flex;
        gap: 4px;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .settings-nav-item {
        white-space: nowrap;
        margin-bottom: 0;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-info {
        padding-top: 0;
    }

    .profile-meta {
        justify-content: center;
    }

    .profile-actions {
        justify-content: center;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .navbar-center {
        display: none;
    }

    .voice-search-btn {
        display: none;
    }

    .btn-label {
        display: none;
    }

    .create-btn {
        padding: 8px;
        border-radius: var(--radius-full);
    }

    .main-content {
        padding: 16px;
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .category-chips-wrapper {
        margin: -16px -16px 16px -16px;
        padding: 8px 16px;
    }

    .profile-banner {
        height: 120px;
    }

    .profile-avatar-img {
        width: 80px;
        height: 80px;
    }

    .profile-header {
        padding: 0 16px 16px;
        margin-top: -32px;
    }

    .profile-display-name {
        font-size: 1.2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .account-info-grid {
        grid-template-columns: 1fr;
    }

    .notification-panel {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        min-width: 100%;
        max-width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .user-panel {
        position: fixed;
        top: var(--navbar-height);
        right: 0;
        min-width: 280px;
        border-radius: 0 0 0 var(--radius-md);
    }

    .settings-page {
        max-width: 100%;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .navbar-left {
        min-width: auto;
    }

    .navbar-right {
        min-width: auto;
        gap: 0;
    }

    .sign-in-btn span {
        display: none;
    }

    .sign-in-btn {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: var(--radius-full);
        justify-content: center;
        border: none;
    }

    .video-card-body {
        gap: 8px;
    }
}

/* Search History Dropdown */
.search-history-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 50px; /* Don't overlap search button */
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.search-wrapper.focused .search-history-dropdown.has-items {
    display: block;
}

.search-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.search-history-item:hover {
    background-color: var(--bg-hover);
}

.search-history-item-link {
    flex-grow: 1;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.search-history-icon {
    color: var(--text-secondary);
}

.search-history-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.search-history-remove:hover {
    color: var(--accent-red);
    background-color: rgba(255, 0, 0, 0.1);
}

/* Mobile Responsive Overhaul (< 768px) */
@media (max-width: 768px) {
    body {
        padding-bottom: 64px !important;
    }
    
    .video-action-bar {
        flex-wrap: wrap !important;
        gap: 12px !important;
    }

    .action-buttons {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        scrollbar-width: none;
    }
    .action-buttons::-webkit-scrollbar {
        display: none;
    }
    .action-buttons .btn {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .watch-container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .video-title {
        font-size: 1.15rem !important;
        line-height: 1.4 !important;
    }

    .channel-info {
        width: 100%;
        justify-content: space-between;
    }

    /* Mobile Bottom Navigation (Theme-Aware Light & Dark Mode) */
    .mobile-bottom-nav {
        background: var(--bg-secondary) !important;
        border-top: 1px solid var(--border-color) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        transition: background 0.3s ease, border-color 0.3s ease;
    }

    .mobile-bottom-nav .mobile-nav-item {
        color: var(--text-secondary) !important;
        transition: transform 0.15s ease, color 0.15s ease;
    }

    .mobile-bottom-nav .mobile-nav-item:active {
        transform: scale(0.92);
    }

    .mobile-bottom-nav .mobile-nav-item.active {
        color: var(--text-primary) !important;
    }

    .mobile-bottom-nav .mobile-nav-item.active.text-danger {
        color: var(--accent-red) !important;
    }
}

[data-theme="light"] .mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.95) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .mobile-bottom-nav {
    background: rgba(18, 18, 18, 0.95) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}
