/* =========================================
   Modern UI Design - Variables & Reset
   ========================================= */
:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #E0E7FF;

    --secondary-color: #64748B;
    --accent-color: #F59E0B;
    --danger-color: #EF4444;
    --success-color: #10B981;

    --bg-body: #F8F9FA;
    --bg-surface: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.95);

    --text-main: #111827;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    --text-light: #F9FAFB;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --glass-blur: blur(8px);

    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --container-width: 1200px;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #0F172A;
        --bg-surface: #1E293B;
        --bg-glass: rgba(30, 41, 59, 0.95);
        --text-main: #F8FAFC;
        --text-secondary: #CBD5E1;
        --text-muted: #64748B;
        --primary-light: rgba(79, 70, 229, 0.2);
    }
}

/* =========================================
   Base
   ========================================= */
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-top: 80px;
}

.admin-body {
    padding-top: 0 !important;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

/* =========================================
   Components
   ========================================= */

/* Glass Panel */
.glass-panel {
    background: var(--bg-surface);
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Navbar */
.navbar {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-main) !important;
    letter-spacing: -0.04em;
    display: flex;
    align-items: center;
}

.navbar-brand i {
    color: var(--primary-color);
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary) !important;
    padding: 0.6rem 1.25rem !important;
    border-radius: 9999px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    background-color: var(--primary-light);
}

/* Container */
.container {
    max-width: 1280px;
    padding: 0 2rem;
}

/* =========================================
   Sidebar — Section Cards style
   ========================================= */

/* Container: transparent, cards stack vertically */
.sidebar {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Each direct child div becomes a floating card */
.sidebar > div {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Section headings — small uppercase label */
.sidebar h2, .sidebar h3, .sidebar h4, .sidebar h5 {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 0 0 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: none;
    -webkit-text-fill-color: initial;
    line-height: 1.4;
}

/* Select dropdowns */
.sidebar select {
    width: 100%;
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-md);
    padding: 0.55rem 2rem 0.55rem 0.85rem;
    font-size: 0.875rem;
    background: var(--bg-body);
    color: var(--text-main);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239CA3AF' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 14px 10px;
    outline: none;
    transition: border-color 0.15s;
}

.sidebar select:hover,
.sidebar select:focus {
    border-color: var(--primary-color);
}

/* Text / Search inputs */
.sidebar input[type="text"],
.sidebar input[type="search"] {
    width: 100%;
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-md);
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    background: var(--bg-body);
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s;
}

.sidebar input[type="text"]:focus,
.sidebar input[type="search"]:focus {
    border-color: var(--primary-color);
}

/* Links */
.sidebar a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    padding: 0.3rem 0;
    transition: color 0.15s, translate 0.15s;
    text-decoration: none;
}

.sidebar a:hover {
    color: var(--primary-color);
    translate: 3px 0;
}

/* Paragraph text */
.sidebar p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.sticky-sidebar {
    position: sticky;
    top: 100px;
}

/* Footer */
.footer {
    background: var(--bg-surface);
    padding: 3rem 0;
    margin-top: 5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =========================================
   Navbar Search
   ========================================= */
.navbar-search {
    display: flex;
    align-items: stretch; /* 両要素を同じ高さに揃える */
}

.navbar-search .search-input {
    border: 1px solid #E2E8F0;
    border-right: none;
    border-radius: 9999px 0 0 9999px;
    padding: 0 1rem;
    font-size: 0.9rem;
    background: #F8FAFC;
    color: var(--text-main);
    width: 160px;
    outline: none;
    transition: border-color 0.2s, width 0.2s, background 0.2s;
    box-sizing: border-box;
}

.navbar-search .search-input:focus {
    border-color: var(--primary-color);
    background: #FFFFFF;
    width: 200px;
}

.navbar-search .search-btn {
    border: 1px solid #E2E8F0;
    border-left: none;
    border-radius: 0 9999px 9999px 0;
    padding: 0 0.75rem;
    background: #F8FAFC;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.navbar-search .search-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Sidebar keyword search form */
.sidebar-search-form {
    display: flex;
}

.sidebar-search-form input[type="text"] {
    flex: 1;
    border: 1px solid #E5E7EB;
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    background: var(--bg-body);
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s;
    /* sidebar の汎用 input ルールを上書き */
    width: auto;
    border-radius: var(--radius-md) 0 0 var(--radius-md) !important;
}

.sidebar-search-form input[type="text"]:focus {
    border-color: var(--primary-color);
}

.sidebar-search-form button {
    border: 1px solid #E5E7EB;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: var(--primary-color);
    color: #ffffff;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.sidebar-search-form button:hover {
    background: var(--primary-hover);
}

/* =========================================
   Video Cards
   ========================================= */
.video-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    border: none;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.video-thumbnail-container {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    background-color: #F3F4F6;
}

.video-thumbnail-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.video-card:hover .video-thumbnail-container img {
    transform: scale(1.08);
}

.video-card-body {
    padding: 1.25rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.video-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-main);
    transition: color 0.2s;
}

.video-card:hover .video-card-title {
    color: var(--primary-color);
}

.video-card-meta {
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.video-card-meta a {
    color: var(--text-muted);
}

.video-card-meta a:hover {
    color: var(--primary-color);
}

/* =========================================
   Detail Pages
   ========================================= */
.detail-header {
    margin-bottom: 2rem;
    text-align: center;
}

.detail-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-main), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.video-player-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    background: #000;
    margin-bottom: 2rem;
}

.video-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-description {
    background: var(--bg-body);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1.5rem;
    color: var(--text-main);
    font-size: 0.95rem;
}

/* Tags */
.modern-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 9999px;
    background-color: #EBF5FF;
    color: var(--primary-color);
    margin: 0.25rem;
    transition: all 0.2s;
}

.modern-badge:hover {
    background-color: var(--primary-color);
    color: white;
}

/* =========================================
   Admin / Forms
   ========================================= */
.form-control {
    border-radius: var(--radius-md);
    border: 1px solid #E5E7EB;
    background-color: #F9FAFB;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    height: auto;
    transition: all 0.2s;
    color: var(--text-main);
}

select.form-control {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-control:focus {
    border-color: var(--primary-color);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    display: block;
}

.btn {
    border-radius: var(--radius-md);
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Admin Tables */
.modern-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.modern-table th {
    background-color: var(--bg-body);
    font-weight: 600;
    color: var(--text-secondary);
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #E5E7EB;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modern-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #F3F4F6;
    color: var(--text-main);
    vertical-align: middle;
}

.modern-table tr:hover td {
    background-color: #F8FAFC;
}

.modern-table tr:last-child td {
    border-bottom: none;
}

/* =========================================
   Utilities / Misc
   ========================================= */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 4px solid var(--primary-color);
}

.text-muted-sm {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Show All Button */
.btn-show-all {
    display: inline-block;
    padding: 0.75rem 2.5rem;
    text-align: center;
    background: var(--primary-color);
    border: none;
    border-radius: 9999px;
    color: #ffffff;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-show-all:hover {
    background: var(--primary-hover);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

/* Login Page */
.login-card {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

/* =========================================
   Admin Layout
   ========================================= */
.admin-container {
    display: flex;
    flex-wrap: nowrap;
    min-height: 100vh;
    background-color: #F1F5F9;
}

.glass-sidebar {
    width: 260px;
    background: #0F172A;
    border-right: none;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1000;
    padding: 2rem 1rem;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    overflow-y: auto;
}

.glass-sidebar .brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 3rem;
    text-align: center;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-sidebar .brand i {
    color: var(--primary-color);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.25rem;
    color: #94A3B8;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar-link:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    background: var(--primary-color);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.sidebar-link.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.admin-main-content {
    flex: 1;
    margin-left: 0;
    width: 0;
    padding: 3rem;
    min-height: 100vh;
}

/* Glass Tables */
.glass-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1rem;
}

.glass-table th {
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1.25rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.glass-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    color: var(--text-main);
    vertical-align: middle;
    font-size: 0.95rem;
}

.glass-table tr:hover td {
    background: #FAFAFA;
}

.glass-table tr:last-child td {
    border-bottom: none;
}

/* Custom Checkbox */
.custom-control-label::before {
    background-color: #FFFFFF;
    border: 1px solid #CBD5E1;
}

/* Page Header in Admin */
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.admin-page-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 991.98px) {
    .glass-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }

    .glass-sidebar.show {
        transform: translateX(0);
    }

    .admin-main-content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .admin-mobile-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .navbar-collapse {
        background: var(--bg-surface);
        padding: 1rem;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        margin-top: 1rem;
    }

    .navbar-search .search-input {
        width: 120px;
    }

    .navbar-search .search-input:focus {
        width: 150px;
    }
}

/* =========================================
   Mobile Off-canvas Sidebar
   ========================================= */

/* Floating Action Button */
.sidebar-fab {
    display: none; /* hidden on desktop by default */
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.45);
    cursor: pointer;
    z-index: 1040;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s;
}

.sidebar-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 22px rgba(79, 70, 229, 0.55);
}

.sidebar-fab.open {
    background: var(--secondary-color);
    transform: scale(0.92);
}

/* Off-canvas panel */
.sidebar-offcanvas {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: var(--bg-body);
    z-index: 1050;
    overflow-y: auto;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.12);
}

.sidebar-offcanvas.open {
    right: 0;
}

.sidebar-offcanvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    position: sticky;
    top: 0;
    background: var(--bg-body);
    z-index: 1;
}

.sidebar-offcanvas-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.sidebar-offcanvas-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.35rem;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}

.sidebar-offcanvas-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-main);
}

/* Off-canvas body — Section Cards style */
.sidebar-offcanvas-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Each direct child div = card */
.sidebar-offcanvas-body > div {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Section headings inside offcanvas */
.sidebar-offcanvas-body h2,
.sidebar-offcanvas-body h3,
.sidebar-offcanvas-body h4,
.sidebar-offcanvas-body h5 {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 0 0 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: none;
    -webkit-text-fill-color: initial;
    line-height: 1.4;
}

/* Select / Input inside offcanvas */
.sidebar-offcanvas-body select,
.sidebar-offcanvas-body input[type="text"],
.sidebar-offcanvas-body input[type="search"] {
    width: 100%;
    border: 1px solid #E5E7EB;
    border-radius: var(--radius-md);
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    background: var(--bg-body);
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s;
}

.sidebar-offcanvas-body select:focus,
.sidebar-offcanvas-body input:focus {
    border-color: var(--primary-color);
}

/* Links inside offcanvas */
.sidebar-offcanvas-body a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    padding: 0.3rem 0;
    transition: color 0.15s, translate 0.15s;
    text-decoration: none;
}

.sidebar-offcanvas-body a:hover {
    color: var(--primary-color);
    translate: 3px 0;
}

/* Backdrop */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 1035;
    pointer-events: none;
    transition: background 0.3s ease;
}

.sidebar-backdrop.open {
    background: rgba(0, 0, 0, 0.45);
    pointer-events: all;
}

/* Show FAB only on mobile */
@media (max-width: 991.98px) {
    .sidebar-fab {
        display: flex;
    }
}

/* =========================================
   Channel Grid
   ========================================= */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}

.channel-card-link {
    text-decoration: none;
    color: inherit;
}

.channel-card-item {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.channel-card-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.channel-card-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.75rem;
}

.channel-card-avatar-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    color: var(--text-muted);
}

.channel-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.channel-card-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =========================================
   Breadcrumb
   ========================================= */
.breadcrumb-nav {
    margin-bottom: 1.5rem;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
}

.breadcrumb-list li + li::before {
    content: "/";
    margin: 0 0.5rem;
    color: var(--text-muted);
}

.breadcrumb-list a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb-list a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.breadcrumb-list .active {
    color: var(--text-muted);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 240px;
}

/* =========================================
   Video Description (collapsible)
   ========================================= */
.video-description-section {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.video-description-section summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-body);
    user-select: none;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-description-section summary::-webkit-details-marker {
    display: none;
}

.video-description-section summary::after {
    content: "▼";
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.video-description-section[open] summary::after {
    transform: rotate(-180deg);
}

.video-description-section .description-body {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.7;
    white-space: pre-wrap;
    background: var(--bg-surface);
}

/* =========================================
   Tag Nav (horizontal scroll with affordance)
   ========================================= */

/* Wrapper: positions the right-fade overlay */
.tag-nav-wrapper {
    position: relative;
}

/* Right-edge gradient: hints at more content to scroll */
.tag-nav-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: calc(100% - 6px); /* leave room for scrollbar */
    background: linear-gradient(to right, transparent, var(--bg-body));
    pointer-events: none;
    z-index: 1;
}

/* Scroll container */
.tag-nav-container {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px; /* space for thin scrollbar */
    /* Thin scrollbar (Firefox) */
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

/* Thin scrollbar (Chrome/Safari) */
.tag-nav-container::-webkit-scrollbar {
    height: 3px;
}

.tag-nav-container::-webkit-scrollbar-track {
    background: transparent;
}

.tag-nav-container::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 9999px;
}

/* Pill buttons */
.tag-nav-btn {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 14px;
    border: none;
    border-radius: 9999px;
    font-size: 0.83rem;
    font-weight: 500;
    color: #2d3748;
    white-space: nowrap;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.tag-nav-btn:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
}

.tag-nav-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
}
