﻿body {
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
}

.sidebar .list-group-item {
    background-color: transparent;
    border-radius: 6px;
    margin-bottom: 6px;
    padding: 10px 15px;
    transition: all 0.3s ease;
    color: #4a148c;
    font-weight: 500;
    position: relative;
    border: 1px solid transparent;
}

    .sidebar .list-group-item:hover {
        background-color: #e1bee7;
        color: #311b92;
        border-color: #d1c4e9;
        transform: translateX(2px);
        cursor: pointer;
    }

    .sidebar .list-group-item > ul {
        display: none;
        padding-left: 15px;
        margin-top: 8px;
    }

    .sidebar .list-group-item.active > ul {
        display: block;
    }

    .sidebar .list-group-item i {
        margin-right: 8px;
    }

.sidebar .toggle-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
}

body {
    background-color: #f8f9fa;
    font-family: Arial, sans-serif;
}

.navbar {
    background-color: #5e2ca5 !important;
    border-bottom: 2px solid #4a1f8b;
}

    .navbar .nav-link,
    .navbar .navbar-brand,
    .navbar .btn-outline-secondary {
        color: #fff !important;
    }

    .navbar .btn-outline-secondary {
        border-color: #fff !important;
    }

        .navbar .btn-outline-secondary:hover {
            background-color: #fff;
            color: #5e2ca5 !important;
        }

.sidebar {
    background: linear-gradient(to bottom right, #f3e5f5, #ede7f6);
    border-right: 1px solid #d1c4e9;
    /* padding: 25px 20px; */
    border-radius: 0 0 10px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

    .sidebar h5 {
        font-weight: bold;
        margin-bottom: 15px;
        font-size: 1.2rem;
        color: #4a148c;
        text-transform: uppercase;
        letter-spacing: 1px;
        border-bottom: 2px solid #d1c4e9;
        padding-bottom: 10px;
    }

    .sidebar .list-group-item {
        border: none;
        /* padding: 10px; */
        transition: all 0.2s;
    }

        .sidebar .list-group-item:hover {
            background-color: #f0f0f0;
            cursor: pointer;
        }

.document-card {
    background: white;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: box-shadow 0.3s;
}

    .document-card:hover {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }

.document-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.document-meta {
    font-size: 0.9rem;
    color: #888;
}

.document-content {
    font-size: 0.95rem;
    margin-top: 5px;
}

.upload-btn {
    margin-bottom: 20px;
}

footer {
    background-color: #e9ecef;
    padding: 20px 0;
    text-align: center;
    margin-top: 40px;
}

#nav-documents .dropdown-menu {
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#nav-documents.hovering .dropdown-menu {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.category-list a[data-submenu]:hover {
    background-color: #f0f0f0;
    color: #000;
}

.submenu-panel {
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.submenu-content {
    display: none;
}

.category-list a[data-submenu]:hover ~ .submenu-panel,
.submenu-panel:hover {
    opacity: 1;
    pointer-events: auto;
}

.category-list a[data-submenu="business"]:hover ~ .submenu-panel #business,
.category-list a[data-submenu="marketing"]:hover ~ .submenu-panel #marketing,
.category-list a[data-submenu="ketoan"]:hover ~ .submenu-panel #ketoan,
.category-list a[data-submenu="phapluat"]:hover ~ .submenu-panel #phapluat,
.category-list a[data-submenu="kynang"]:hover ~ .submenu-panel #kynang,
.category-list a[data-submenu="xahoi"]:hover ~ .submenu-panel #xahoi {
    display: block;
}

/* Hover toàn khối "Tài liệu" để mở danh mục */
#nav-documents .dropdown-menu {
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#nav-documents.hovering .dropdown-menu {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Submenu logic */
.submenu-panel {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.submenu-content {
    display: none;
}

    .submenu-content.active {
        display: block;
    }

/* Highlight item bên phải */
.submenu-panel a.dropdown-item:hover {
    color: #007bff !important;
    text-decoration: underline;
}

/* Hover hiển thị nền */
.category-list a[data-submenu]:hover {
    background-color: #f0f0f0;
    color: #000;
}

/* Highlight item khi hover bên trái */
.category-list a.dropdown-item:hover {
    background-color: #f0f0f0;
    color: #007bff !important;
}

/* Hiệu ứng mũi tên khi hover */
.category-list a.dropdown-item i {
    transition: transform 0.2s ease;
}

.category-list a.dropdown-item:hover i {
    transform: translateX(4px);
}


/* Hiển thị dropdown khi hover (áp dụng cho cả admin và documents) */
.nav-item.dropdown:hover .dropdown-menu {
    display: flex !important;
}
/* Hiển thị dropdown khi hover */
.nav-item.dropdown:hover .dropdown-menu {
    display: flex !important;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
}

.position-static {
    position: static !important;
}

.submenu-panel .submenu-content {
    display: none;
}

.dropdown-item.active, .dropdown-item:active {
    background-color: rgba(var(--bs-light-rgb),var(--bs-bg-opacity)) !important;
}

.dropdown-menu-custom .submenu,
.submenu-panel .submenu-content.active {
    display: block !important;
}

#adminDropdownMenu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
}

.document-title {
    display: -webkit-box;
    -webkit-line-clamp: 1; /* số dòng muốn hiển thị */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}


.document-content {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* số dòng muốn hiển thị */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.document-content-home {
    display: -webkit-box;
    -webkit-line-clamp: 3; /* số dòng muốn hiển thị */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-content {
    border-radius: 12px;
}

.nav-tabs .nav-link {
    border: none;
    font-weight: 600;
    color: #6c757d;
}

    .nav-tabs .nav-link.active {
        border-bottom: 2px solid #0d6efd;
        color: #0d6efd;
        background-color: transparent;
    }

.form-control {
    border-radius: 6px;
    height: 48px;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-outline-primary {
    border: 1px solid #0d6efd;
    color: #0d6efd;
}

.btn-outline-danger {
    border: 1px solid #dc3545;
    color: #dc3545;
}

    .btn-outline-primary:hover,
    .btn-outline-danger:hover {
        background-color: #f8f9fa;
    }

.modal-body {
    padding: 0 !important;
}

@media (min-width: 768px) {
    #authModal .modal-dialog {
        max-width: 450px;
    }
}

@media (min-width: 1200px) {
    #authModal .modal-dialog {
        max-width: 400px;
    }
}

@media (max-width: 575.98px) {
    #authModal .modal-dialog {
        margin: 1rem;
    }
}

.doc-header {
    background-color: #ede7f6;
    padding: 20px;
    border-radius: 10px;
}

.doc-title {
    color: #4a148c;
    font-size: 1.4rem;
    font-weight: bold;
}

.doc-meta {
    font-size: 0.9rem;
    color: #6c757d;
}

.doc-actions {
    margin-top: 15px;
    text-align: right;
}

.viewer-wrapper iframe {
    border: none;
    width: 100%;
    height: 600px;
    border-radius: 6px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.doc-description {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}


.description-scroll::-webkit-scrollbar {
    width: 6px;
}

.description-scroll::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 3px;
}

.description-scroll:hover::-webkit-scrollbar-thumb {
    background-color: #555;
}

.description-scroll {
    max-height: 300px; /* hoặc bất kỳ chiều cao bạn muốn */
    overflow-y: auto;
    padding-right: 10px; /* tạo khoảng trống để không che mất chữ khi có thanh scroll */
}

.clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 6em; /* Tùy theo line-height */
    line-height: 1.5em;
}

textarea.form-control {
    resize: vertical;
    color: #000 !important;
}

.nav-tabs .nav-link.active {
    background: linear-gradient(45deg, #7e57c2, #9575cd);
    color: #fff !important;
    border-color: transparent;
    font-weight: bold;
}

.nav-tabs .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.list-group-item a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.star {
    color: #666;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

    .star.hovered,
    .star.selected {
        color: gold;
        transform: scale(1.2);
    }

.comment-card blockquote {
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 4px solid #28a745;
    padding-left: 1rem;
    margin-bottom: 0.5rem;
}

.btn-upgrade {
    background-color: #ffc107 !important;
    color: #fff !important;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.4);
    display: inline-block;
}

    .btn-upgrade:hover {
        box-shadow: 0 0 20px 5px rgba(255, 193, 7, 0.7);
        animation: pulse-glow 1s infinite;
        color: #fff !important;
    }

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 10px rgba(255, 193, 7, 0.4);
    }

    50% {
        box-shadow: 0 0 25px rgba(255, 193, 7, 0.8);
    }

    100% {
        box-shadow: 0 0 10px rgba(255, 193, 7, 0.4);
    }
}

.favorite-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex; /* dùng Flexbox */
    align-items: center; /* canh giữa theo chiều dọc */
    justify-content: center; /* canh giữa theo chiều ngang */
    transition: all 0.2s ease-in-out;
    color: #888;
    background-color: #f8f9fa;
    border: 1px solid #ccc;
}

    .favorite-btn:hover {
        background-color: #eaeaea;
        color: #c112d9;
        border-color: #c112d9;
    }

    .favorite-btn.active {
        color: #c112d9;
        background-color: #fce4fd;
        border-color: #c112d9;
    }


.btn-pulse-upload {
    background: #fff;
    color: #222;
    border: 2.5px solid #f59e42;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 0 #f59e4280;
    transition: box-shadow 0.2s, color 0.2s, background 0.2s;
    animation: pulse-glow 1.1s infinite alternate;
}

    .btn-pulse-upload:hover,
    .btn-pulse-upload:focus {
        color: #fff;
        background: linear-gradient(90deg,#f59e42,#f472b6);
        border-color: #f472b6;
        box-shadow: 0 0 24px #f59e4299, 0 0 40px #f472b655;
        animation: none;
        transition: all 0.2s;
        outline: none;
        text-decoration: none;
    }

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 #f59e4233, 0 0 0 0 #f472b633;
    }

    100% {
        box-shadow: 0 0 16px 8px #f59e4299, 0 0 32px 8px #f472b666;
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    20%, 60% {
        transform: translateX(-2px);
    }

    40%, 80% {
        transform: translateX(2px);
    }
}

.btn-pulse-upload {
    /* ... */
    animation: shake 0.7s infinite;
}

#suggestBox {
    max-height: 340px;
    overflow-y: auto;
    cursor: pointer;
    border-radius: 0 0 8px 8px;
}

    #suggestBox strong {
        color: #0d6efd;
    }

    #suggestBox .icon {
        width: 18px;
        height: 18px;
        margin-right: 6px;
        opacity: 0.8;
    }

    #suggestBox .badge {
        font-size: 0.85em;
        margin-right: 8px;
    }
.scroll-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto; /* để chỉ scroll ngang ở đây */
    scroll-behavior: smooth;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    padding-top:10px;
}

    .scroll-container::-webkit-scrollbar {
        height: 7px;
    }

    .scroll-container::-webkit-scrollbar-thumb {
        background: #eee;
        border-radius: 4px;
    }

    .scroll-container .card {
        min-width: 210px;
        max-width: 260px;
        flex: 0 0 auto;
    }


.box-section {
    border-radius: 1.2rem;
    box-shadow: 0 3px 18px 0 rgba(35,40,56,0.09);
    padding: 2rem 1.2rem 1.2rem 1.2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

 
 

.box-gradient-1 {
    background: linear-gradient(120deg, #353d5b 60%, #2dbaf4 100%);
    /* Xanh dương sáng -> đậm */
}

.box-gradient-2 {
    background: linear-gradient(120deg, #483885 60%, #fc7469 100%);
    /* Tím nhẹ sang cam, cho "đề xuất" */
}

.box-body {
    position: relative;
    z-index: 3;
}

/* Đổ bóng tiêu đề/box cho nổi bật */
.box-section::before {
    content: "";
    display: block;
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 20%, rgba(255,255,255,0.07) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}


.scroll-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(120deg, #2dbaf4 50%, #353d5b 100%);
    box-shadow: 0 4px 18px 0 rgba(35,40,56,0.14);
    border: 0;
    outline: none;
    transition: transform 0.15s cubic-bezier(.4,0,.2,1), box-shadow 0.2s, background 0.2s;
    opacity: 0.88;
    z-index: 10;
}

    .scroll-buttons img {
        width: 20px;
        height: 20px;
        filter: drop-shadow(0 1px 3px rgba(0,0,0,0.14));
        transition: filter 0.2s;
    }

    .scroll-buttons:focus,
    .scroll-buttons:hover {
        background: linear-gradient(120deg, #2dbaf4 30%, #1d72b8 100%);
        box-shadow: 0 8px 24px 0 rgba(35,40,56,0.23);
        transform: scale(1.08);
        opacity: 1;
    }

    .scroll-buttons:active {
        background: linear-gradient(120deg, #353d5b 60%, #2dbaf4 100%);
        box-shadow: 0 2px 10px rgba(35,40,56,0.17);
        transform: scale(0.96);
    }

 

.box-gradient-3 {
    background: linear-gradient(120deg, #232c4b 60%, #57c8e6 100%);
}

.box-header {
    position: relative;
    z-index: 2;
    margin-bottom: 1.3rem;
}

.section-title {
    font-size: 1.32rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 2px 10px rgba(16,16,22,0.13);
}

.btn-upload {
    background: linear-gradient(90deg, #ffb145 0%, #ff7241 100%);
    color: #fff;
    border: none;
    border-radius: 2rem;
    padding: 0.65rem 1.6rem;
    font-size: 1.05rem;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: 0 3px 16px 0 rgba(255,114,65,0.16);
}

    .btn-upload:hover, .btn-upload:focus {
        background: linear-gradient(90deg, #ff7241 0%, #ffb145 100%);
        color: #fff;
        box-shadow: 0 8px 24px 0 rgba(255,114,65,0.23);
        transform: translateY(-2px) scale(1.04);
    }


.document-card {
    transition: box-shadow 0.25s, transform 0.2s, background 0.2s;
    background: #fff;
    border-radius: 1.1rem;
    box-shadow: 0 1px 8px rgba(35,40,56,0.07);
    border: 1px solid #f0f0f3;
    overflow: hidden;
    position: relative;
}

    .document-card:hover {
        box-shadow: 0 8px 28px 0 rgba(48, 124, 201, 0.16), 0 1.5px 6px 0 rgba(35,40,56,0.11);
        background: linear-gradient(90deg,#eaf7ff 60%,#e2ecff 100%);
        transform: translateY(-4px) scale(1.011);
        border-color: #6cc4ff33;
        z-index: 2;
    }

    .document-card .document-title a {
        transition: color 0.2s;
    }

    .document-card:hover .document-title a {
        color: #176ab4;
        text-decoration: underline;
    }

    .document-card .btn-upgrade {
        transition: box-shadow 0.15s, filter 0.18s;
    }

    .document-card:hover .btn-upgrade {
        box-shadow: 0 4px 16px 0 rgba(255, 193, 7, 0.17);
        filter: brightness(1.05);
    }

/* Để mark nổi bật hơn (bôi vàng nhạt, bo tròn) */
mark {
    background: #fff3ae;
    border-radius: 0.22em;
    padding: 0 0.2em;
    font-weight: 600;
    color: #c18502;
}

.document-content-home {
    transition: box-shadow 0.22s, transform 0.19s, background 0.19s;
    background: linear-gradient(120deg, #222a38 65%, #1b97d1 120%);
    border-radius: 1rem;
    box-shadow: 0 1px 10px rgba(30,55,90,0.12);
    overflow: hidden;
    position: relative;
    border: none;
}
.document-content-home:hover {
    box-shadow: 0 8px 24px 0 rgba(49, 137, 223, 0.22), 0 2.5px 8px 0 rgba(35,40,56,0.15);
    background: linear-gradient(90deg,#eaf7ff 60%,#a5d8fa 100%);
    transform: translateY(-6px) scale(1.025);
    z-index: 3;
}

.document-content-home .card-body {
    transition: background 0.15s;
}
.document-content-home:hover .card-body {
    background: rgba(255,255,255,0.04);
}
.document-content-home .book-title a {
    transition: color 0.15s, text-shadow 0.2s;
}
.document-content-home:hover .book-title a {
    color: #0d6efd !important;
    text-shadow: 0 2px 8px #fff7;
    text-decoration: underline;
}
.book-cover {
    transition: filter 0.18s, box-shadow 0.15s;
    border-radius: 0.8rem 0.8rem 0 0;

}
.document-content-home:hover .book-cover {
    filter: brightness(1.08) drop-shadow(0 4px 8px #d7f3ff55);
 
}


.sidebar-box {
    background: #fff;
    border-radius: 1.1rem;
    box-shadow: 0 3px 18px 0 rgba(35,40,56,0.09);
    padding: 1.4rem 1.1rem 1.2rem 1.1rem;
    margin-bottom: 2rem;
    position: relative;
}

.sidebar-header {
    font-size: 1.12rem;
    text-transform: uppercase;
    color: #3566d6;
    font-weight: bold;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

    .sidebar-list li {
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.07rem;
        background: #f9fafb;
        border-radius: 0.6rem;
        transition: box-shadow 0.18s, background 0.15s, transform 0.12s;
        box-shadow: 0 2px 7px rgba(44,50,60,0.06);
        padding: 0.48rem 0.38rem;
        position: relative;
    }

        .sidebar-list li:hover {
            background: linear-gradient(90deg, #e3f1ff 55%, #f1fbff 100%);
            box-shadow: 0 4px 16px rgba(52,125,238,0.14);
            transform: translateY(-3px) scale(1.03);
        }

.sidebar-thumb {
    width: 54px;
    height: 74px;
    object-fit: cover;
    border-radius: 0.48rem;
    box-shadow: 0 2px 10px rgba(26,33,60,0.12);
    margin-right: 0.5rem;
    background: #f6f8fa;
    transition: box-shadow 0.17s;
}

.sidebar-bookinfo {
    flex: 1 1 0%;
}

.sidebar-title {
    font-size: 1.06rem;
    color: #283154;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 4.6em;
    transition: color 0.13s;
    text-decoration: none;
}

    .sidebar-title:hover {
        color: #1890ff;
        text-decoration: underline;
    }

.sidebar-meta {
    font-size: 0.95rem;
    color: #8893a7 !important;
    margin-top: 0.08rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-list .fa-file-word {
    color: #2e61dc;
}

.sidebar-list .fa-file-pdf {
    color: #f25d51;
}

.sidebar-list .fa-file-alt {
    color: #5d5e68;
}





 
 