/* Container chính */
.hvd-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 20px 0;
    align-items: flex-start; /* Quan trọng để Sticky hoạt động */
}

/* Cột Sidebar (Đã thêm Sticky) */
.hvd-sidebar {
    flex: 0 0 280px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    padding: 20px;
    
    /* Thiết lập Sticky */
    position: -webkit-sticky;
    position: sticky;
    top:180px; /* Cách mép trên màn hình 50px, hãy tăng lên nếu bị lẹm Header */
    max-height: calc(100vh - 80px); /* Chiều cao tối đa bằng màn hình trừ đi khoảng cách */
    overflow-y: auto;
}

/* Làm đẹp thanh cuộn cho Sidebar */
.hvd-sidebar::-webkit-scrollbar {
    width: 6px;
}
.hvd-sidebar::-webkit-scrollbar-track {
    background: #f9f9f9; 
}
.hvd-sidebar::-webkit-scrollbar-thumb {
    background: #ddd; 
    border-radius: 4px;
}
.hvd-sidebar::-webkit-scrollbar-thumb:hover {
    background: #bbb; 
}

.hvd-sidebar-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

/* Style cho danh sách tài liệu */
.hvd-menu, .hvd-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hvd-menu li {
    position: relative;
    margin-bottom: 5px;
}

.hvd-menu > li > .hvd-cat-title {
    font-weight: bold;
    color: #333;
    display: block;
    padding: 8px 10px 8px 25px;
    text-decoration: none;
}

.hvd-toggle-btn {
    position: absolute;
    left: 0;
    top: 10px;
    width: 15px;
    height: 15px;
    cursor: pointer;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s;
}

.hvd-has-children.open .hvd-toggle-btn {
    transform: rotate(90deg);
}

.hvd-submenu {
    display: none;
    padding-left: 20px !important;
    border-left: 1px solid #ddd;
    margin-left: 7px !important;
}

.hvd-submenu a {
    display: block;
    padding: 5px 10px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.hvd-submenu a:hover, .hvd-submenu a.hvd-active {
    color: #0073aa;
    font-weight: bold;
}

/* Cột Content */
.hvd-content {
    flex: 1;
    min-width: 0;
    background: #fff;
    padding: 20px;
}

.hvd-content h1 {
    font-size: 28px;
    margin-top: 0;
    margin-bottom: 20px;
    color: #222;
}

/* Sidebar Tools (Search) */
.hvd-tools {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ddd;
}

.hvd-search-box {
    position: relative;
}

.hvd-search-icon {
    position: absolute;
    left: 10px;
    top: 10px;
    color: #888;
}

#hvd-live-search {
    width: 100%;
    padding: 8px 10px 8px 30px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Khung hiển thị kết quả Live Search */
#hvd-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 999;
    max-height: 250px;
    overflow-y: auto;
}

#hvd-search-results ul {
    list-style: none;
    margin: 0; padding: 0;
}

#hvd-search-results li a {
    display: block;
    padding: 10px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

#hvd-search-results li a:hover {
    background: #f0f8ff;
    color: #0073aa;
}

.hvd-searching {
    padding: 10px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* --- CSS Khung Đánh giá (Feedback) --- */
.hvd-feedback-wrapper {
    margin-top: 50px;
    border-top: 1px solid #eaeaea;
    padding-top: 20px;
}

.hvd-feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdfdfd;
    padding: 15px 20px;
    border-radius: 6px;
}

.hvd-feedback-info h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #333;
}

.hvd-feedback-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.hvd-feedback-buttons {
    display: flex;
    gap: 10px;
}

.hvd-btn-vote {
    background: #f4f5f7;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    color: #42526e;
    cursor: pointer;
    transition: all 0.2s;
}

.hvd-btn-vote:hover {
    background: #ebecf0;
}

/* Khi nút được chọn */
.hvd-btn-vote.active-yes {
    background: #00875a; 
    color: #fff;
}
.hvd-btn-vote.active-no {
    background: #e3fceb; 
    color: #00875a;
}

/* Khung form nhập lý do */
.hvd-feedback-form-box {
    background: #f7fbfa;
    padding: 20px;
    margin-top: 5px;
    border-radius: 6px;
}

.hvd-feedback-form-box h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

#hvd-feedback-text {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.hvd-feedback-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.hvd-btn-cancel {
    background: #e3fceb;
    color: #00875a;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

.hvd-btn-submit {
    background: #f4f5f7;
    color: #a5adba;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.hvd-btn-submit.ready {
    background: #00875a;
    color: #fff;
}

.hvd-feedback-thanks {
    margin-top: 15px;
    padding: 15px;
    background: #e3fceb;
    color: #00875a;
    border-radius: 6px;
    font-weight: bold;
}

/* Responsive cho Mobile */
@media (max-width: 768px) {
    .hvd-container {
        flex-direction: column;
    }
    .hvd-sidebar {
        flex: 1 1 100%;
        width: 100%;
        position: static; /* Tắt sticky trên mobile */
        max-height: none;
    }
    .hvd-content {
        flex: 1 1 100%;
        width: 100%;
    }
    .hvd-feedback-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}