/* =========================================
   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;
    }

    /* Titles */
    .detail-title {
        font-size: 1.6rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    /* Breadcrumb */
    .breadcrumb-list .active {
        max-width: 180px;
    }
}

/* =========================================
   Small Mobile (max-width: 480px)
   ========================================= */
@media (max-width: 480px) {
    /* Container */
    .container {
        padding: 0 0.75rem;
    }

    /* Navbar search */
    .navbar-search .search-input {
        width: 90px;
        font-size: 0.82rem;
        padding: 0 0.6rem;
    }

    .navbar-search .search-input:focus {
        width: 110px;
    }

    /* Detail page title */
    .detail-title {
        font-size: 1.25rem;
    }

    /* Section titles */
    .section-title {
        font-size: 1.2rem;
        padding-left: 0.75rem;
    }

    /* Breadcrumb */
    .breadcrumb-list .active {
        max-width: 130px;
    }

    /* Channel grid */
    .channel-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.65rem;
    }

    .channel-card-item {
        padding: 1rem 0.75rem;
    }

    .channel-card-avatar,
    .channel-card-avatar-placeholder {
        width: 56px;
        height: 56px;
    }

    /* Tag nav pills */
    .tag-nav-btn {
        height: 34px;
        padding: 0 12px;
        font-size: 0.8rem;
    }

    /* Show all button */
    .btn-show-all {
        padding: 0.65rem 1.75rem;
        font-size: 0.9rem;
    }

    /* Video description section */
    .video-description-section summary {
        font-size: 0.85rem;
    }
}

/* =========================================
   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);
}

/* =========================================
   Affiliate Widget
   ========================================= */
.affiliate-widget {
    margin: 2rem 0;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #f0e8dc;
    box-shadow: 0 2px 16px rgba(228, 121, 17, 0.07);
    overflow: hidden;
}

.affiliate-widget__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #e47911;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid #f5e8d5;
    background: #fffaf4;
}

.affiliate-widget__header::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 13px;
    background: #e47911;
    border-radius: 2px;
    flex-shrink: 0;
}

.affiliate-widget__grid {
    display: flex;
    flex-direction: column;
}

.affiliate-widget__card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}

.affiliate-widget__card:last-child {
    border-bottom: none;
}

.affiliate-widget__card:hover {
    background: #fffaf4;
    text-decoration: none;
    color: inherit;
}

.affiliate-widget__img-wrap {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    background: #f9f9f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #eee;
}

.affiliate-widget__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
    transition: transform 0.2s ease;
}

.affiliate-widget__card:hover .affiliate-widget__img-wrap img {
    transform: scale(1.06);
}

.affiliate-widget__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.affiliate-widget__name {
    font-size: 0.82rem;
    line-height: 1.45;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.affiliate-widget__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #e47911;
    transition: color 0.15s;
}

.affiliate-widget__card:hover .affiliate-widget__cta {
    color: #c8650a;
}

.affiliate-widget__cta::after {
    content: '›';
    font-size: 1rem;
    line-height: 1;
}

/* =========================================
   Video Detail Page Layout (vd-*)
   ========================================= */

/* Outer wrapper — remove default spacing so bands can bleed */
.vd-layout {
    margin-left: -15px;
    margin-right: -15px;
}

/* Primary zone: white bg, video info area */
.vd-primary {
    background: var(--bg-surface);
    padding: 2rem 1.5rem 2.5rem;
}

/* Affiliate band: warm amber-cream tint */
.vd-affiliate-band {
    background: #fffaf3;
    border-top: 1px solid #f5e8d5;
    border-bottom: 1px solid #f5e8d5;
}

.vd-affiliate-inner {
    padding: 2rem 1.5rem;
}

/* Related videos zone: light body-bg */
.vd-related {
    background: var(--bg-body);
    border-top: 1px solid rgba(0,0,0,0.04);
}

.vd-related-inner {
    padding: 2.5rem 1.5rem 3rem;
}

/* Group cards within related (channel / tag) */
.vd-related-group {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
}

.vd-related-group:last-child {
    margin-bottom: 0;
}

/* Label inside each group */
.vd-related-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* =========================================
   Index Page Layout (index-*)
   ========================================= */

.index-layout {
    margin-left: -15px;
    margin-right: -15px;
}

/* Regular pickup section */
.index-section {
    background: var(--bg-surface);
    padding: 2rem 1.5rem 2.5rem;
}

/* Colored band sections */
.index-band {
    border-top: 1px solid rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    margin-top: 0;
}

.index-band__inner {
    padding: 2rem 1.5rem 2.5rem;
}

/* Today's videos — soft green tint */
.index-band--today {
    background: #f0fdf6;
    border-color: #d1fae5;
}

/* Yesterday's videos — soft amber tint */
.index-band--yesterday {
    background: #fffbeb;
    border-color: #fde68a;
}

/* Show-all button area, sits below bands */
.index-layout > .py-5 {
    background: var(--bg-surface);
    border-top: 1px solid rgba(0,0,0,0.04);
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
    .vd-affiliate-band {
        background: rgba(245, 158, 11, 0.07);
        border-color: rgba(245, 158, 11, 0.15);
    }
    .index-band--today {
        background: rgba(16, 185, 129, 0.07);
        border-color: rgba(16, 185, 129, 0.15);
    }
    .index-band--yesterday {
        background: rgba(245, 158, 11, 0.07);
        border-color: rgba(245, 158, 11, 0.15);
    }
    .index-layout > .py-5 {
        background: var(--bg-surface);
    }
}

/* =========================================
   Blog Card (public /blog/ page)
   ========================================= */
.blog-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    color: var(--text-main);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: var(--text-main);
}

.blog-card__thumb {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    background: #F3F4F6;
}

.blog-card__thumb img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card__thumb img {
    transform: scale(1.06);
}

.blog-card__thumb-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 2rem;
}

.blog-card__body {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-main);
    transition: color 0.2s;
}

.blog-card:hover .blog-card__title {
    color: var(--primary-color);
}

.blog-card__summary {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__meta {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-card__source {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.78rem;
}

/* =========================================
   Blog Widget (sidebar / slot)
   ========================================= */
.blog-widget {
    margin: 1.5rem 0;
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(79, 70, 229, 0.1);
    box-shadow: 0 2px 12px rgba(79, 70, 229, 0.06);
    overflow: hidden;
}

.blog-widget__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid rgba(79, 70, 229, 0.08);
    background: #f5f3ff;
}

.blog-widget__header::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 13px;
    background: var(--primary-color);
    border-radius: 2px;
    flex-shrink: 0;
}

/* --- card layout --- */
.blog-widget__grid--card {
    display: flex;
    flex-direction: column;
}

.blog-widget__card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.blog-widget__card:last-child { border-bottom: none; }

.blog-widget__card:hover {
    background: #f5f3ff;
    text-decoration: none;
    color: inherit;
}

.blog-widget__thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    border: 1px solid #eee;
}

.blog-widget__thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.blog-widget__card:hover .blog-widget__thumb img {
    transform: scale(1.06);
}

.blog-widget__thumb-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.blog-widget__body {
    flex: 1;
    min-width: 0;
}

.blog-widget__title {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.blog-widget__meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.blog-widget__source {
    font-weight: 600;
    color: var(--primary-color);
}

/* --- list layout --- */
.blog-widget__grid--list {
    display: flex;
    flex-direction: column;
}

.blog-widget__list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.blog-widget__list-item:last-child { border-bottom: none; }

.blog-widget__list-item:hover {
    background: #f5f3ff;
    text-decoration: none;
    color: inherit;
}

.blog-widget__list-thumb {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
}

.blog-widget__list-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
}

/* --- text layout --- */
.blog-widget__text-list {
    list-style: none;
    padding: 0.5rem 1.25rem;
    margin: 0;
}

.blog-widget__text-list li {
    padding: 0.45rem 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.85rem;
    line-height: 1.4;
}

.blog-widget__text-list li:last-child { border-bottom: none; }

.blog-widget__text-list a {
    color: var(--text-main);
    transition: color 0.15s;
}

.blog-widget__text-list a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

@media (prefers-color-scheme: dark) {
    .blog-widget { background: var(--bg-surface); border-color: rgba(79,70,229,0.2); }
    .blog-widget__header { background: rgba(79,70,229,0.1); }
    .blog-widget__card:hover,
    .blog-widget__list-item:hover { background: rgba(79,70,229,0.07); }
}

/* Article video grid */
.hc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 768px) { .hc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .hc-grid { grid-template-columns: 1fr; } }
.hc-video-card { border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08); background: #fff; transition: transform 0.15s; }
.hc-video-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.13); }
.hc-video-card a { text-decoration: none; color: inherit; display: block; }
.hc-thumb-wrap { position: relative; width: 100%; padding-bottom: 56.25%; overflow: hidden; background: #000; }
.hc-thumb-wrap img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.hc-card-body { padding: 10px 12px 12px; }
.hc-card-title { font-size: 13px; font-weight: bold; color: #1a2a3a; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hc-card-meta { font-size: 11px; color: #999; margin-top: 6px; }
.hc-video-card--featured { }
.hc-video-card--featured .hc-card-title { color: #2563EB; }
.hc-video-card--featured .hc-card-body { background: #eff6ff; }
