/* ================= TỔNG THỂ ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    min-height: 100vh;
    background-color: #f9f9f9;
    color: #0f172a;
    overflow-x: hidden;
    position: relative;
}

/* TRIỆT TIÊU KHỐI TRẮNG RỖNG DO GOOGLE ADSENSE TỰ ĐỘNG CHÈN DƯỚI HEADER */
.google-auto-placed,
ins.adsbygoogle:empty,
ins.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ================= 1. HEADER ================= */
.yt-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    border-bottom: 1px solid #e2e8f0;
}

.yt-header-left,
.yt-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.yt-header-left {
    gap: 12px;
}

.btn-sidebar-burger {
    background: none;
    border: none;
    color: #334155;
    font-size: 19px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-sidebar-burger:hover {
    background-color: #f1f5f9;
}

.yt-brand-container {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    user-select: none;
}

.brand-text-wrapper {
    display: flex;
    align-items: baseline;
    font-style: italic;
    font-family: 'Arial Black', sans-serif;
}

.brand-text-wrapper .brand-text {
    font-size: 22px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.brand-text-wrapper .brand-domain {
    font-size: 13px;
    font-weight: 800;
    color: #0066ff;
    margin-left: 1px;
}

.yt-header-center {
    flex: 0 1 540px;
    display: flex;
    align-items: center;
    margin: 0 16px;
}

.yt-search-form {
    display: flex;
    align-items: center;
    width: 100%;
    height: 38px;
}

.yt-search-box {
    flex: 1;
    height: 100%;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-right: none;
    border-radius: 20px 0 0 20px;
    padding: 0 14px;
    display: flex;
    align-items: center;
}

.yt-search-box input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-size: 14px;
    color: #0f172a;
}

.btn-clear-search-link {
    color: #64748b;
    text-decoration: none;
    font-size: 18px;
    padding: 0 4px;
}

.btn-submit-search {
    width: 54px;
    height: 100%;
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 0 20px 20px 0;
    color: #475569;
    cursor: pointer;
}

.btn-submit-search:hover {
    background-color: #e2e8f0;
    color: #0066ff;
}

.btn-icon-mobile-search {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #0f172a;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-icon-mobile-search:active {
    background-color: #e2e8f0;
    transform: scale(0.92);
}

.btn-yt-upload,
.yt-btn-login {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 34px;
    border-radius: 17px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.btn-yt-upload {
    background-color: #f1f5f9;
    color: #0f172a;
}

.yt-btn-login {
    border: 1px solid #0066ff;
    color: #0066ff;
}

.yt-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #0066ff;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-decoration: none;
    overflow: hidden;
    flex-shrink: 0;
}

.yt-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-voice-search {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #f1f5f9;
    border: none;
    outline: none;
    color: #0f172a;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.btn-voice-search:hover {
    background-color: #e2e8f0;
}

/* ================= 2. MOBILE HEADER TÙY CHỌN & DROPDOWN ================= */
.mobile-search-keyword-badge,
.btn-mobile-header-icon {
    display: none;
}

.filter-dropdown-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.header-filter-popup {
    position: absolute;
    top: 44px;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
    min-width: 200px;
    display: none;
    flex-direction: column;
    padding: 6px 0;
    z-index: 10005;
    overflow: hidden;
    animation: popupFadeIn 0.15s ease-out;
}

.header-filter-popup.active {
    display: flex;
}

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

.filter-popup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: #1e293b;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.filter-popup-item i {
    font-size: 15px;
    color: #64748b;
    width: 20px;
    text-align: center;
}

.filter-popup-item:active,
.filter-popup-item:hover {
    background-color: #f1f5f9;
    color: #0066ff;
}

.filter-popup-item:active i,
.filter-popup-item:hover i {
    color: #0066ff;
}

/* ================= 3. HỘP THOẠI NHẬN DIỆN GIỌNG NÓI ================= */
.voice-search-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
    animation: voiceModalFade 0.2s ease-out;
}

@keyframes voiceModalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.voice-search-modal-box {
    background-color: #ffffff;
    width: 100%;
    max-width: 440px;
    min-height: 290px;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation: voiceModalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes voiceModalScale {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.voice-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.voice-modal-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
}

.btn-voice-modal-close {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #64748b;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.btn-voice-modal-close:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.voice-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 14px;
}

.voice-live-text-box {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.voice-live-text {
    font-size: 18px;
    font-weight: 700;
    color: #0066ff;
    text-align: center;
    line-height: 1.4;
    word-break: break-word;
}

.voice-mic-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 110px;
    margin-bottom: 12px;
}

.voice-modal-mic-btn {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background-color: #ef4444;
    color: #ffffff;
    border: none;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
    transition: transform 0.15s ease;
}

.voice-modal-mic-btn:active {
    transform: scale(0.92);
}

.voice-modal-mic-btn.listening .voice-pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2.5px solid #ef4444;
    animation: voiceRingExpand 1.6s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
    pointer-events: none;
}

.voice-modal-mic-btn.listening .voice-pulse-ring.delay {
    animation-delay: 0.8s;
}

@keyframes voiceRingExpand {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

.voice-modal-hint {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

/* ================= 4. MOBILE SEARCH FULLSCREEN ================= */
.search-mobile-fullscreen {
    position: fixed;
    inset: 0;
    background-color: #ffffff;
    z-index: 999999;
    display: none;
    flex-direction: column;
}

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

.search-mobile-bar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.btn-back-screen {
    background: none;
    border: none;
    width: 38px;
    height: 38px;
    font-size: 18px;
    color: #0f172a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-search-form {
    flex: 1;
    display: flex;
    align-items: center;
    background-color: #f1f5f9;
    border-radius: 20px;
    padding: 0 14px;
    height: 38px;
}

.mobile-search-form input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14.5px;
    color: #0f172a;
}

#btn-clear-mobile {
    background: none;
    border: none;
    color: #64748b;
    font-size: 16px;
    cursor: pointer;
}

.search-suggestions-container {
    flex: 1;
    overflow-y: auto;
}

.search-history-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.search-history-header button {
    background: none;
    border: none;
    color: #0066ff;
    cursor: pointer;
}

.search-suggest-list {
    list-style: none;
}

.search-suggest-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 14.5px;
    color: #0f172a;
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;
}

/* ================= 5. BỐ CỤC CHÍNH (DESKTOP) ================= */
.yt-main-layout {
    display: flex;
    margin-top: 56px;
}

.yt-mini-sidebar {
    width: 78px;
    background-color: #ffffff;
    min-height: calc(100vh - 56px);
    position: fixed;
    top: 56px;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    z-index: 900;
    border-right: 1px solid #e2e8f0;
}

.mini-sidebar-item {
    width: 70px;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #334155;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.15s;
    text-align: center;
}

.mini-sidebar-item i {
    font-size: 18px;
}

.mini-sidebar-item span {
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.2;
}

.mini-sidebar-item:hover, 
.mini-sidebar-item.active {
    background-color: #f1f5f9;
    color: #0066ff;
}

.sidebar-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.sidebar-icon-wrapper i {
    font-size: 18px;
    line-height: 1;
}

.sidebar-icon-wrapper .notify-badge-pill {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: #ef4444;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1.5px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    z-index: 2;
}

.btn-sidebar-plus .plus-circle-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #0066ff;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    margin-bottom: 2px;
}

.yt-content-wrapper {
    flex: 1;
    width: calc(100% - 78px);
    margin-left: 78px;
    padding: 14px 24px 60px;
}

.yt-chips-bar {
    position: sticky;
    top: 56px;
    background-color: #f9f9f9;
    display: flex;
    gap: 8px;
    padding: 8px 0 14px;
    overflow-x: auto;
    white-space: nowrap;
    z-index: 800;
    scrollbar-width: none;
}

.yt-chips-bar::-webkit-scrollbar {
    display: none;
}

.yt-chip {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.yt-chip.active {
    background-color: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

/* ================= 6. CARD TÀI LIỆU ================= */
.yt-video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 20px;
    row-gap: 28px;
}

.yt-card-item {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.yt-card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.yt-thumbnail-box {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #f1f5f9;
    position: relative;
    display: block;
    overflow: hidden;
    flex-shrink: 0;
}

.yt-doc-paper-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: block;
}

.yt-doc-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.yt-category-pill {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #0066ff;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
}

.yt-details-box {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    position: relative;
}

.yt-channel-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #0066ff;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    text-decoration: none;
    font-weight: 700;
}

.yt-channel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-letter-box {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
}

.yt-meta-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding-right: 18px;
}

.yt-doc-title {
    font-size: 16.5px;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 4px;
}

.yt-doc-title a {
    color: #0f172a;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-doc-title a:hover {
    color: #0066ff;
}

.yt-subject-row,
.yt-school-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    margin-bottom: 3px;
}

.yt-subject-row {
    color: #10b981;
    font-size: 12.5px;
}

.yt-school-row {
    color: #0284c7;
    font-size: 12px;
    margin-bottom: 5px;
}

.subject-name-text,
.school-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yt-author-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
}

.author-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #334155;
    font-weight: 600;
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.author-link:hover {
    color: #0066ff;
}

.date-text {
    color: #64748b;
    font-size: 11.5px;
}

.card-more-menu-wrapper {
    position: absolute;
    top: 10px;
    right: 8px;
}

.btn-card-more {
    background: none;
    border: none;
    color: #64748b;
    font-size: 15px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
}

.btn-card-more:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.card-dropdown-menu {
    position: absolute;
    top: 30px;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    width: 160px;
    display: none;
    flex-direction: column;
    z-index: 50;
    overflow: hidden;
}

.card-dropdown-menu.active {
    display: flex;
}

.dropdown-item {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 12.5px;
    color: #334155;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background-color 0.15s;
    text-decoration: none;
}

.dropdown-item:hover {
    background-color: #f8fafc;
    color: #0066ff;
}

.card-dropdown-menu .item-danger {
    color: #ef4444;
}

.card-dropdown-menu .item-danger:hover {
    background-color: #fee2e2;
}

.index-counters-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.index-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2.5px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
}

.index-stat-pill.dl-pill {
    background-color: #fef3c7;
    border: 1px solid #fde68a;
    color: #b45309;
}

.index-stat-pill.dl-pill i {
    font-size: 10px;
    color: #d97706;
}

.index-stat-pill.like-pill {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.index-stat-pill.like-pill i {
    font-size: 10px;
    color: #ef4444;
}

.index-stat-pill.view-pill {
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
}

/* ================= 7. SIDEBAR MENU 3 GẠCH ================= */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    display: none;
}

.sidebar-backdrop.active {
    display: block;
}

.sidebar-drawer-left {
    position: fixed;
    top: 0;
    left: -320px;
    width: 310px;
    height: 100vh;
    background-color: #ffffff;
    z-index: 10001;
    transition: left 0.25s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.1);
}

.sidebar-drawer-left.active {
    left: 0;
}

.drawer-header {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
}

.drawer-user-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.drawer-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.drawer-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #0066ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    overflow: hidden;
}

.drawer-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drawer-user-name {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
}

.drawer-coin-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 10px;
    padding: 8px 12px;
    margin-top: 10px;
    width: 100%;
}

.coin-display {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #b45309;
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
}

.coin-display i {
    color: #f59e0b;
    font-size: 16px;
}

.btn-drawer-buy-coin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #f59e0b;
    color: #ffffff;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    white-space: nowrap;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-drawer-buy-coin:hover {
    background-color: #d97706;
    transform: translateY(-1px);
}

.drawer-divider {
    height: 1px;
    background-color: #e2e8f0;
    margin: 12px 0;
}

.drawer-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #334155;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    width: 100%;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.drawer-link:hover, 
.drawer-link.active {
    background-color: #f1f5f9;
    color: #0066ff;
    font-weight: 700;
}

.drawer-link.active i {
    color: #0066ff;
}

.drawer-filter-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-radius: 8px;
    padding: 4px;
}

.drawer-label {
    font-size: 12px;
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 2px;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-field label {
    font-size: 12px;
    color: #475569;
    font-weight: 600;
}

.filter-field input {
    height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 13px;
    outline: none;
}

.filter-field input:focus {
    border-color: #0066ff;
}

.filter-actions-group {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.btn-submit-filter,
.btn-reset-filter {
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-submit-filter {
    flex: 1;
    background-color: #0066ff;
    color: #ffffff;
    border: none;
    font-size: 13px;
    font-weight: 600;
}

.btn-reset-filter {
    padding: 0 12px;
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #64748b;
    font-size: 12.5px;
}

.drawer-bottom-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.about-us-toggle {
    border: none;
    background: none;
    cursor: pointer;
    justify-content: space-between;
}

.about-us-toggle .arrow-icon {
    font-size: 11px;
    margin-left: auto;
    transition: transform 0.25s ease;
}

.about-us-toggle.active .arrow-icon {
    transform: rotate(180deg);
}

.about-us-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 12px 0 24px;
    background-color: #f8fafc;
    border-radius: 8px;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.25s ease;
}

.about-us-content.show {
    max-height: 200px;
    opacity: 1;
    padding: 10px 12px 10px 24px;
    margin: 4px 0;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #475569;
}

.social-icons-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #cbd5e1;
}

.social-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 12px;
    color: #ffffff;
}

.social-icon-btn.facebook { background-color: #1877f2; }
.social-icon-btn.tiktok { background-color: #000000; }
.social-icon-btn.zalo { background-color: #0068ff; }
.social-icon-btn.mail { background-color: #ea4335; }
.social-icon-btn.zalo .zalo-text { font-size: 8px; font-weight: 900; }

.btn-drawer-logout-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 0;
    width: 100%;
    background-color: #fee2e2;
    color: #ef4444;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s;
    margin-top: 8px;
}

.btn-drawer-logout-action:hover {
    background-color: #fecaca;
}

/* ================= 8. KHỐI TÀI LIỆU THỊNH HÀNH ================= */
.trending-search-section {
    margin-top: 36px;
    margin-bottom: 24px;
    border-top: 1px solid #e2e8f0;
    padding-top: 22px;
}

.trending-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.trending-section-header h3 {
    font-size: 17.5px;
    font-weight: 800;
    color: #0f172a;
}

/* ================= 9. GỢI Ý TÌM KIẾM NGƯỜI DÙNG ================= */
.user-suggestions-dropdown {
    position: absolute;
    top: 42px;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 999999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 6px 0;
}

.user-suggestion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f8fafc;
}

.user-suggestion-item:hover {
    background-color: #f1f5f9;
}

.user-sug-left {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.user-sug-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #0066ff;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    overflow: hidden;
    flex-shrink: 0;
}

.user-sug-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-sug-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.user-sug-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-sug-handle {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-suggestion-item .btn-yt-subscribe {
    background-color: #cc0000;
    color: #ffffff;
    border: none;
    padding: 5px 12px;
    height: 30px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.user-suggestion-item .btn-yt-subscribe:hover {
    background-color: #b00000;
}

.user-suggestion-item .btn-yt-subscribe.subscribed {
    background-color: #f2f2f2;
    color: #0f0f0f;
    border: 1px solid #e5e5e5;
    font-weight: 600;
}

#mobile-user-suggestions-box {
    padding: 0 12px;
    margin-bottom: 8px;
}

#mobile-user-suggestions-box .user-suggestions-dropdown {
    position: static;
    box-shadow: none;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

#btn-load-more-users:hover {
    background-color: #e2e8f0 !important;
    color: #0066ff !important;
    border-color: #94a3b8 !important;
}

#btn-load-more-users:active {
    transform: scale(0.97);
}

/* ================= 10. BANNER PWA ================= */
.pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 440px;
    background: #0f172a;
    color: #ffffff;
    padding: 14px 18px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    z-index: 999999;
    border: 1px solid #334155;
    animation: pwaSlideUp 0.3s ease-out;
}

@keyframes pwaSlideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.pwa-app-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.pwa-text-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pwa-text-group b {
    font-size: 14.5px;
    color: #ffffff;
}

.pwa-text-group span {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.35;
    margin-top: 2px;
}

.pwa-btn-group {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-pwa-dismiss {
    background: transparent;
    color: #94a3b8;
    border: none;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}

.btn-pwa-install {
    background: #0066ff;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.35);
}

/* ================= 11. KHỐI KỆ SÁCH & GIÁO TRÌNH TRONG SUỐT ================= */
.shelf-grid-wrapper {
    grid-column: 1 / -1;
    width: 100%;
    margin: 6px 0 16px;
    padding: 0;
    background: transparent;
    border: none;
}

.shelf-header-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 2px;
}

.shelf-title-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.shelf-indicator-bar {
    width: 3.5px;
    height: 18px;
    background: #0066ff;
    border-radius: 3px;
    display: inline-block;
}

.shelf-category-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
}

.shelf-view-all-link {
    font-size: 12.5px;
    font-weight: 700;
    color: #0066ff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}

.shelf-view-all-link:hover {
    background-color: #e0edff;
}

/* KHUNG CUỘN NGANG */
.book-shelf-row {
    display: flex;
    gap: 12px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.book-shelf-row::-webkit-scrollbar {
    height: 4px;
}

.book-shelf-row::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.18);
    border-radius: 10px;
}

/* CARD SÁCH */
.book-card-item {
    flex: 0 0 200px;
    width: 200px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
}

.book-card-item:hover {
    transform: translateY(-4px);
}

.book-cover-link {
    text-decoration: none;
    display: block;
}

.book-cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4.2;
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #cbd5e1;
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-top-meta-overlay {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    gap: 4px;
    z-index: 2;
    pointer-events: none;
}

.book-top-meta-overlay .meta-badge {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(3px);
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2.5px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.book-top-meta-overlay .meta-badge.like-badge i { color: #ef4444; }
.book-top-meta-overlay .meta-badge.dl-badge i { color: #f59e0b; }

.book-info-bottom {
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.book-name-title {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
    margin: 0;
}

.book-name-title a {
    color: #0f172a;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-name-title a:hover {
    color: #0066ff;
}

.book-views-stat {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.book-views-stat i {
    color: #94a3b8;
    font-size: 11px;
}

.shelf-inline-loader {
    flex: 0 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================= NÚT LÀM MỚI TRANG TRÊN ĐỈNH ================= */
.refresh-page-toast {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #ffffff;
    padding: 9px 18px;
    border-radius: 30px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: top 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, transform 0.15s ease;
    opacity: 0;
    pointer-events: none;
    border: 1px solid #334155;
    white-space: nowrap;
    user-select: none;
}

.refresh-page-toast.show {
    top: 68px;
    opacity: 1;
    pointer-events: auto;
}

.refresh-page-toast:active {
    transform: translateX(-50%) scale(0.95);
}

.refresh-page-toast i {
    color: #38bdf8;
    font-size: 14px;
    transition: transform 0.3s;
}

.refresh-page-toast:hover {
    background: #1e293b;
    box-shadow: 0 8px 24px rgba(0, 102, 255, 0.25);
}

.refresh-page-toast:hover i {
    transform: rotate(180deg);
}

/* ================= 12. RESPONSIVE MOBILE ================= */
@media (max-width: 992px) {
    .yt-video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .desktop-only, 
    .btn-yt-upload.desktop-only,
    .yt-header-center {
        display: none !important;
    }

    .yt-header {
        height: 48px;
        padding: 0 8px;
        gap: 8px;
    }

    .yt-header-left {
        flex: 1;
        min-width: 0;
        gap: 8px;
    }

    .btn-sidebar-burger {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .yt-brand-container {
        gap: 6px;
    }

    .logo-books-svg svg {
        width: 28px;
        height: 22px;
    }

    .brand-text-wrapper .brand-text {
        font-size: 19px;
    }

    .brand-text-wrapper .brand-domain {
        font-size: 11px;
    }

    .yt-brand-container.hide-on-mobile-search,
    .yt-header-right .yt-user-avatar.hide-on-mobile-search,
    .yt-header-right .yt-btn-login.hide-on-mobile-search {
        display: none !important;
    }

    .mobile-search-keyword-badge {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background-color: #f1f5f9;
        border: 1px solid #cbd5e1;
        border-radius: 20px;
        height: 36px;
        padding: 0 6px 0 12px;
        flex: 1;
        min-width: 0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }

    .badge-click-area {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0;
        cursor: pointer;
        padding-right: 4px;
    }

    .badge-click-area i {
        font-size: 13px;
        color: #0066ff;
        flex-shrink: 0;
    }

    .badge-keyword-text {
        font-size: 13.5px;
        font-weight: 700;
        color: #0f172a;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        letter-spacing: -0.2px;
    }

    .badge-btn-clear {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        color: #64748b;
        text-decoration: none;
        font-size: 13px;
        flex-shrink: 0;
        transition: background-color 0.15s, color 0.15s;
    }

    .badge-btn-clear:active {
        background-color: #fee2e2;
        color: #ef4444;
    }

    .yt-header-right {
        gap: 6px;
        flex-shrink: 0;
    }

    .btn-mobile-header-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background-color: #f8fafc;
        border: 1px solid #e2e8f0;
        color: #1e293b;
        font-size: 15px;
        cursor: pointer;
        line-height: 1;
        flex-shrink: 0;
        transition: background-color 0.15s, color 0.15s;
    }

    .btn-mobile-header-icon:active {
        background-color: #e2e8f0;
        color: #0066ff;
    }

    .yt-user-avatar, 
    .yt-btn-login {
        width: 34px;
        height: 34px;
        min-width: 34px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 17px;
    }

    .yt-btn-login i {
        font-size: 17px;
        margin: 0;
    }

    .btn-icon-mobile-search {
        display: inline-flex;
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .yt-main-layout {
        flex-direction: column;
        margin-top: 48px;
    }

    .yt-mini-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        height: 52px;
        min-height: 52px;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        background-color: #ffffff;
        border-right: none;
        border-top: 1px solid #e2e8f0;
        z-index: 9999;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
        padding: 0 4px;
        transform: translateZ(0);
    }

    .yt-mini-sidebar::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 100px;
        background-color: #ffffff;
        pointer-events: none;
    }

    .yt-mini-sidebar .mini-sidebar-item {
        flex: 1;
        width: auto;
        max-width: 68px;
        height: 100%;
        padding: 4px 0;
        gap: 2px;
        border-radius: 6px;
        user-select: none;
        justify-content: center;
    }

    .yt-mini-sidebar .mini-sidebar-item span {
        font-size: 9.5px;
        white-space: nowrap;
    }

    .btn-sidebar-plus .plus-circle-icon {
        width: 28px;
        height: 28px;
        margin-bottom: 0;
        box-shadow: 0 2px 6px rgba(0, 102, 255, 0.35);
    }

    .yt-content-wrapper {
        width: 100%;
        margin-left: 0;
        padding: 0 5px 75px;
    }

    .yt-chips-bar {
        top: 48px;
        padding: 6px 2px 8px;
        margin: 0;
        background-color: #f9f9f9;
    }

    .pwa-install-banner {
        bottom: 64px;
        width: 94%;
        padding: 12px 14px;
    }

    .yt-video-grid {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 12px;
    }

    .yt-card-item {
        border-radius: 10px;
    }

    .refresh-page-toast.show {
        top: 54px;
    }

    .shelf-grid-wrapper {
        margin: 4px 0 14px;
    }

    .book-shelf-row {
        gap: 10px;
    }

    .book-card-item {
        flex: 0 0 150px;
        width: 150px;
    }

    .shelf-category-title {
        font-size: 15px;
    }

    .book-name-title {
        font-size: 13px;
    }
}