:root {
    --gold: #d4af37;
    --dark-bg: #1a1a1a;
    --sidebar-bg: #222;
}


body { background-color: var(--dark-bg); height: 100vh; overflow: hidden; }

.container { display: flex; height: 100vh; width: 100%; }

/* --- SIDEBAR --- */
.sidebar {
    width: 350px; background-color: var(--sidebar-bg); display: flex; flex-direction: column;
    border-right: 1px solid #444; color: #fff; z-index: 20; flex-shrink: 0;
}
.sidebar-header {
    padding: 5px 15px; 
    background: #fff;
    text-align: center; border-bottom: 2px solid var(--gold); 
}
.sidebar-header h2 { color: var(--gold); font-size: 14px; margin-top: 5px; text-transform: uppercase;}
.search-container { padding: 10px; background: #333; }
.search-container input{
    border: 1px solid #9badb8;
    border-radius: 5px;
    font-size: 15px;
    color: #000;
    background: #fafbfc;
    background-color: #F0F0F0;
    border-width: 0 0 0 0;
    border-radius: 10px;
}
.search-input { width: 100%; padding: 8px; border-radius: 4px; border: 1px solid #555;margin-bottom: 0px;}
.sidebar h2{
    margin-top: 10px;
    text-align: center;
    color: #d4af37;
    font-size: 20px;
}
.donor-list { flex: 1; overflow-y: auto; padding: 10px; }
.donor-list::-webkit-scrollbar { width: 6px; }
.donor-list::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }

/* --- CẬP NHẬT GIAO DIỆN ITEM DANH SÁCH (HỖ TRỢ XỔ XUỐNG) --- */
.donor-item {
    background: #2f3136; padding: 12px; margin-bottom: 10px; border-radius: 6px;
    cursor: pointer; border-left: 4px solid transparent; 
    /* Đổi thành block để chứa phần header và phần chi tiết bên dưới */
    display: block; 
    transition: 0.2s;
}
.donor-item:hover, .donor-item.active { background: #3a3d42; border-left-color: var(--gold); }

/* Header của Item (Chứa Avatar + Tên + Tiền như cũ) */
.item-header {
    display: flex;
    align-items: center;
}

.d-avatar {
    width: 35px; height: 35px; background: var(--gold); color: #000; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-weight: bold; margin-right: 10px;flex-shrink: 0;
}
.d-info h4 { font-size: 15px; margin-bottom: 4px; color: #fff;text-transform: uppercase;}
.d-info p { font-size: 12px; color: #aaa; margin-bottom: 2px;}
.money-txt { color: #4cd137; font-weight: bold;}

/* Phần chi tiết ẩn (Sẽ hiện khi active) */
.item-details-expand {
    display: none; /* Mặc định ẩn */
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #555;
    font-size: 13px;
    color: #ccc;
    animation: fadeIn 0.3s ease;
}

.donor-item.active .item-details-expand {
    display: block; /* Hiện khi active */
}

.detail-row { margin-bottom: 5px;line-height: 1.4; }
.detail-label { color: #888; font-size: 11px; margin-right: 5px; }
.detail-msg { color: #fff; font-style: italic; background: rgba(0,0,0,0.2); padding: 5px; border-radius: 4px; margin-top: 5px; display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.copyright { padding: 10px; text-align: center; font-size: 11px; color: #777; border-top: 1px solid #444;}
.copyright a { color: var(--gold); text-decoration: none; }

/* --- MAIN DISPLAY (GIỮ NGUYÊN SCALE CŨ) --- */
.main-display {
    flex: 1; 
    position: relative; 
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    overflow: hidden; 
}
.main-display::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.6); }

/* KHUNG BAO NGOÀI */
.scale-outer-wrapper {
    position: relative;
    width: 1000px;
    height: 700px;
    margin: 0 auto;
    z-index: 10;
}

/* KHUNG NỘI DUNG CỐ ĐỊNH */
.cert-fixed-size {
    width: 1000px;
    height: 700px;
    position: absolute;
    top: 0; left: 0;
    background: #fff;
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.5);
    transform-origin: top left;
    transition: transform 0s;
}
.certificate {
    background: url("img/bangkhen.jpg") center center no-repeat;
    background-size: contain;
    position: absolute; 
    inset: 0; 
    z-index: 1;
}
.corner-img { position: absolute; width: 200px; z-index: 2; }
.top-right { top: 0; right: 0; }
.bottom-left { bottom: 0; left: 0; }

.badge-badge {
    position: absolute; top: -10px; left: 70px; width: 130px; z-index: 10;
    filter: drop-shadow(2px 4px 5px rgba(0,0,0,0.4));
}
.badge-badge img { width: 100%; display: block; }

.cert-content {
    position: absolute;
    top: 320px; 
    left: 50px; 
    right: 50px;
    text-align: center;
    z-index: 5;
}

.org-name { font-size: 24px; font-weight: bold; text-transform: uppercase; margin-bottom: 10px; line-height: 1.3; color: #333; }
.center-logo img { height: 90px; margin-bottom: 10px; }

.main-title {
    font-size: 48px; color: #b00; font-weight: 900;
    text-transform: uppercase; margin-bottom: 5px;
    text-shadow: 1px 1px 0 #ddd;
}
.honor-label { font-size: 22px; font-weight: bold; margin-bottom: 5px; color: #333; }
.donor-name {
    font-size: 30px;
    color: #8e6f53;
    text-transform: uppercase;
    font-weight: 900;
    margin-bottom: 15px;
    line-height: 1.1;
    font-family: "Time New Roman";
    max-width: 98%;
    margin-left: auto;
    margin-right: auto;
}
.desc-text {
    font-size: 22px; 
    font-weight: bold; 
    line-height: 1.4; 
    width: 80%; 
    margin: 0 auto;
    color: #8e6f53;
    font-family: "Time New Roman";
}
.cert-footer {
    position: absolute; 
    bottom: 210px;
    right: 120px;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    z-index: 6;
    color: #8e6f53;
}
.date-text {
    font-size: 15px;
    font-style: italic;
    margin-bottom: 5px;
    font-family: "Time New Roman";
}
.signature-box img { height: 90px; width: auto; }

/* NAV BUTTONS */
.nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.3); border: 2px solid var(--gold);
    color: #fff; font-size: 24px; cursor: pointer; z-index: 100; border-radius: 50%; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center;
}
.nav-btn:hover { background: var(--gold); }
.prev-btn { left: 6px; }
.next-btn { right: -21px; }

/* --- MOBILE LAYOUT --- */
@media (max-width: 900px) {
    body { overflow: auto; height: auto; }
    .container { flex-direction: column; }

    .main-display { 
        order: 1; width: 100%; 
        height: auto; 
        padding: 20px 0;
        overflow: visible;
    }

    .sidebar { 
        order: 2; width: 100%; height: 500px; 
        border-right: none; border-top: 2px solid var(--gold); 
    }

    .prev-btn { left: -15px; width: 40px; height: 40px; font-size: 18px; background: rgba(0,0,0,0.6); border: none; }
    .next-btn { right: -15px; width: 40px; height: 40px; font-size: 18px; background: rgba(0,0,0,0.6); border: none; }
}
#so{
    position: absolute;
    bottom: 63px;
    left: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 6;
    color: #8e6f53;
    font-size: 15px;
    font-style: italic;
    margin-bottom: 5px;
    font-family: "Time New Roman";
}