/* Cài đặt chung và Font */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    min-height: 100vh;
}

/* Phần Header */
header {
    text-align: center;
    border-bottom: 2px solid #dd2c00;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

header h1 {
    font-size: 1.8em;
    color: #dd2c00;
    margin: 10px 0 5px;
    font-weight: 700;
    line-height: 1.3;
}

header h2 {
    font-size: 1.2em;
    color: #555;
    margin: 0;
    font-weight: 500;
}

.no-documents {
    text-align: center;
    padding: 20px;
    color: #777;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    line-height: 1.5;
    color: #666;
}


/* --- Bắt đầu CSS cho giao diện cây thư mục --- */

#document-tree {
    list-style: none;
    padding: 0;
}

.document-group {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden; /* Giúp bo góc đẹp hơn */
    background-color: #fff;
}

.group-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1em;
    color: #003366;
    transition: background-color 0.2s;
}

.group-header:hover {
    background-color: #e9ecef;
}

.group-header .group-icon {
    margin-right: 10px;
    color: #0056b3;
}

.group-header .toggle-icon {
    margin-left: auto;
    transition: transform 0.2s ease-in-out;
    color: #6c757d;
}

/* Kiểu dáng cho danh sách bên trong */
.document-group .document-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Ẩn danh sách văn kiện khi thư mục bị thu gọn */
.document-group.collapsed .document-list {
    display: none;
}

/* Xoay icon mũi tên khi thư mục bị thu gọn */
.document-group.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

/* CSS cho từng file bên trong thư mục */
.document-group .document-list li {
    margin: 0;
    border: none;
    border-radius: 0;
}

.document-group .document-list a {
    display: flex;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    border-bottom: 1px solid #f8f9fa;
}
.document-group .document-list li:last-child a {
    border-bottom: none;
}

.document-group .document-list a:hover {
    background-color: #f8f9fa;
}

.document-group .pdf-icon {
    color: #dd2c00;
    font-size: 1.5em; /* Giảm kích thước icon một chút */
    margin-right: 15px;
}

.document-group a span {
    flex-grow: 1;
}

.document-group .view-icon {
    color: #aaa;
    font-size: 1.2em;
    transition: color 0.2s;
}
.document-group a:hover .view-icon {
    color: #dd2c00;
}

/* --- Kết thúc CSS cho cây thư mục --- */


/* Trình xem PDF (Modal) */
#pdf-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

#pdf-viewer-modal.visible {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

#pdf-toolbar {
    background-color: #222;
    color: white;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-top: 1px solid #444;
}

#pdf-toolbar button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px 10px;
}

#pdf-toolbar button:hover {
    background-color: #444;
    border-radius: 4px;
}

.page-controls, .zoom-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

#pdf-canvas-container {
    flex-grow: 1;
    overflow: auto;
    text-align: center;
    padding: 10px;
}

#pdf-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5em;
    background-color: rgba(0,0,0,0.7);
    padding: 20px;
    border-radius: 10px;
}
