/* General Styles */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;

}

/* CSS cho Header */
#header {
    background-color: #fff;
    padding: 5px 0; /* Thu hẹp thanh xanh lá phía trên */
    border-top: 30px solid #0B3D2E; /* Giảm chiều cao của viền trên */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); /* Đổ bóng nhẹ */
    z-index: 1000;
    position: relative;
}

.navbar-container {
    display: flex;
    justify-content: space-between; /* Căn đều các phần tử */
    align-items: center; /* Căn giữa các phần tử theo chiều dọc */
    flex-wrap: nowrap; /* Đảm bảo các phần tử không xuống dòng */
    width: 100%;
}

.logo {
    margin-right: 20px; /* Khoảng cách giữa logo và phần tiếp theo */
}

/* Thu nhỏ kích thước logo */
.logo img {
    height: 60px; /* Giảm kích thước logo */
    width: auto;  /* Đảm bảo tỷ lệ của logo không bị biến dạng */
}

.navbar-menu {
    display: flex; /* Sử dụng Flexbox để xếp các menu items theo chiều ngang */
    align-items: center; /* Căn giữa các item trong menu theo chiều dọc */
    gap: 10px; /* Giảm khoảng cách giữa các menu items */
    margin-left: 20px; /* Khoảng cách từ menu tới các phần tử khác trong header */
}

.navbar-nav {
    display: flex; /* Đảm bảo các phần tử li nằm trên cùng một hàng */
    list-style-type: none; /* Bỏ dấu chấm ở mỗi item */
    padding: 0; /* Loại bỏ padding mặc định của ul */
    margin: 0; /* Loại bỏ margin mặc định của ul */
}

.navbar-nav .nav-item {
    list-style-type: none;
}

.navbar-nav .nav-link {
    text-decoration: none;
    color: #388e3c; /* Màu chữ cho các liên kết */
    font-size: 14px; /* Giảm cỡ chữ */
    padding: 6px 12px; /* Khoảng cách trong mỗi liên kết */
    border-radius: 5px; /* Bo tròn góc */
    transition: background-color 0.3s ease; /* Thêm hiệu ứng chuyển màu nền khi hover */
}

.navbar-nav .nav-link:hover {
    background-color: #e8f5e9; /* Màu nền khi hover */
    color: #388e3c; /* Giữ màu chữ khi hover */
}

/* Thanh tìm kiếm */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-bar input {
    padding: 6px; /* Giảm khoảng cách trong input */
    border-radius: 5px;
    border: 1px solid #ccc;
    width: 200px; /* Giảm chiều rộng của thanh tìm kiếm */
}

.search-bar button {
    background-color: #388e3c;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 6px 10px; /* Giảm kích thước nút */
    cursor: pointer;
}

.search-bar button:hover {
    background-color: #2c6f3b; /* Màu tối hơn khi hover */
}

/* Tùy chọn người dùng (Giỏ hàng, Đăng nhập, Đăng ký) */
.user-options {
    display: flex;
    align-items: center;
    gap: 15px; /* Giảm khoảng cách giữa các liên kết */
}

.user-options .nav-item {
    list-style-type: none;
    padding: 5px;
}

.user-options .nav-link {
    text-decoration: none;
    color: white;
    font-size: 14px; /* Giảm cỡ chữ */
    padding: 6px 12px; /* Giảm khoảng cách trong mỗi liên kết */
    border-radius: 5px;
    background-color: #0B3D2E;
}

.user-options .nav-link:hover {
    background-color: #e8f5e9; /* Hiệu ứng khi hover */
}

/* Section wrapper */
.books-section {
    padding-top: 20px;
    padding-bottom: 10px;
}

/* Title có vạch xanh bên trái */
.section-title {
    font-weight: 600;
    font-size: 1.4rem;
    border-left: 4px solid darkgreen;
    padding-left: 10px;
}

/* GRID CHÍNH – max 4 cột, căn giữa */
.books-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* tối đa 4 cột */
    gap: 24px;
    max-width: 1200px;         /* bề rộng tối đa của grid */
    margin: 0 auto;            /* căn giữa màn hình */
    padding: 10px 0;
}

/* Mỗi item trong grid */
.book-item {
    display: flex;
}

/* Card đẹp hơn một xíu */
.book-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    transition: all 0.25s ease;
    background-color: #fff;
    width: 100%;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.book-image img {
    border-radius: 8px;
}

/* Text trong card */
.book-card .card-title {
    font-size: 1rem;
    min-height: 48px; /* giữ chiều cao ổn khi tiêu đề 1–2 dòng */
}

.book-card .card-text {
    font-size: 0.9rem;
}

.book-card .text-danger.font-weight-bold {
    font-size: 1rem;
}

/* Ô “không có sách” chiếm full width */
.book-empty {
    grid-column: 1 / -1;
}


/* Chatbot container */
#chatBotIframe {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 300px;
    height: 400px;
    border: none;
    border-radius: 8px;
    z-index: 1000;
    display: none; /* Ẩn mặc định */
}

/* Hiệu ứng nhảy chỉ áp dụng cho hình ảnh nút */
#openChatBotBtn {
    cursor: pointer;
    position: fixed;
    width: 220px;
    height: 100px;
    z-index: 9999; /* Đảm bảo nút luôn hiển thị trên các phần tử khác */
    border-radius: 10%; /* Bo tròn hình ảnh */
    animation: bounce 2s infinite; /* Thêm hiệu ứng nhảy cho nút */
}

/* Hiệu ứng nhảy cho nút */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px); /* Điều chỉnh độ nhảy */
    }
}

/* Footer */
/* ===== FOOTER ===== */
/* Footer */
/* Thu gọn footer */
#footer {
    background: linear-gradient(135deg, #0B3D2E 0%, seagreen 100%);
    color: #fff;
    padding: 15px 10px;  /* Giảm padding trên và dưới để footer gọn gàng hơn */
    margin-top: 40px;
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    height: auto; /* Đảm bảo chiều cao của footer phù hợp với nội dung bên trong */
}

/* Căn giữa footer với 3 cột */
.footer-content {
    max-width: 1300px;             /* Giới hạn chiều rộng của footer */
    margin: 0 auto 20px auto;      /* Căn giữa */
    display: grid;
    grid-template-columns: repeat(3, 1fr);  /* 3 cột */
    gap: 120px;                     /* Tăng khoảng cách giữa các cột thêm */
    box-sizing: border-box;
}

/* Cột trong footer */
.footer-column {
    text-align: left;
}

.footer-column h4 {
    font-weight: 700;
    margin-bottom: 5px;
    font-size: 0.95rem;                    /* Giảm cỡ chữ tiêu đề */
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Đoạn văn trong footer */
.footer-column p {
    font-size: 0.75rem;                 /* Giảm cỡ chữ chung trong footer */
    line-height: 1.4;                   /* Giảm khoảng cách giữa các dòng */
    margin: 0 0 5px 0;
}

/* Liên kết trong footer */
.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 6px;                /* Giảm khoảng cách giữa các mục */
}

.footer-column ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 0.75rem;                 /* Giảm cỡ chữ của liên kết */
    transition: all 0.3s ease;
}

.footer-column ul li a:hover {
    color: #ffd700;
    transform: translateX(2px);        /* Giảm hiệu ứng khi hover */
}

/* Liên hệ: icon + text */
.contact-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    font-size: 0.75rem;                 /* Giảm cỡ chữ */
}

.contact-info i {
    font-size: 1rem;                   /* Giảm kích thước icon */
    color: #ffd700;
}

/* Dòng cuối footer */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 10px;
    text-align: center;
    font-size: 0.7rem;                  /* Giảm kích thước chữ dòng cuối */
    opacity: 0.8;
}

/* Đẩy footer xuống dưới nếu content không đủ dài */
body, html {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Thông báo lỗi */
.login-box .alert {
    text-align: center;
    margin-top: 15px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
}
/* Dropdown User */
.user-dropdown {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.user-name {
    color: #0B3D2E;
    font-weight: bold;
    padding: 6px 12px;
}

.user-name:hover {
    background-color: #e8f5e9;
    border-radius: 6px;
}

/* Menu xổ xuống */
.user-menu {
    position: absolute;
    top: 120%;
    right: 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    width: 180px;
    display: none;
    padding: 8px 0;
    z-index: 999;
}

.user-menu a,
.user-menu button {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    font-size: 14px;
    color: #0B3D2E;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}

.user-menu a:hover,
.user-menu button:hover {
    background-color: #e8f5e9;
}

/* Hiển thị menu khi hover */
.user-dropdown:hover .user-menu {
    display: block;
}
.user-dropdown {
    position: relative;
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    padding: 10px;
    display: none;
    z-index: 9999;
}

.user-dropdown:hover .user-menu {
    display: block;
}

/* ---------------------------------------------------
   🌿 PROFILE MAIN AREA
--------------------------------------------------- */

.profile-wrapper {
    max-width: 650px;
    margin: 40px auto;
    background: #ffffff;
    padding: 30px 35px;
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.profile-title {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    color: #0B3D2E;
    margin-bottom: 25px;
}

/* Each input row */
.profile-row {
    margin-bottom: 18px;
}

.profile-row label {
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 6px;
}

.profile-row input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    font-size: 15px;
    transition: 0.25s;
}

.profile-row input:focus {
    border-color: #0B3D2E;
    box-shadow: 0 0 0 2px rgba(11, 61, 46, 0.2);
    outline: none;
}

/* Buttons */
.profile-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
}

.profile-buttons a {
    color: #0B3D2E;
    font-weight: 600;
    text-decoration: none;
}

.profile-buttons a:hover {
    text-decoration: underline;
}

.profile-buttons .btn-submit {
    background: #0B3D2E;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    cursor: pointer;
    transition: 0.25s;
}

.profile-buttons .btn-submit:hover {
    background: #145f47;
}

/* Date input better style */
.profile-row input[type="date"] {
    padding: 8px 12px;
}
/* ---------------------------------------------------
   🌿 PROFILE PAGE – PREMIUM UI (FULL & FIXED)
--------------------------------------------------- */

.profile-container {
    max-width: 900px;
    margin: 50px auto;
    padding: 20px;
}

.profile-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #0B3D2E;
    margin-bottom: 30px;
}

.profile-box {
    background: #ffffff;
    padding: 40px 50px;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    border: 1px solid #e5e5e5;
}

/* Form bố cục hai cột */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 35px 50px;      /* 🔥 Tăng khoảng cách dọc + ngang */
    margin-top: 10px;
}

.form-row {
    display: flex;
    flex-direction: column;
}

.form-row label {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 12px; /* 🔥 Label cách input */
}

.form-row input {
    padding: 16px 18px;   /* 🔥 Input thoáng */
    border-radius: 12px;
    border: 1px solid #c7c7c7;
    font-size: 16px;
    transition: 0.25s;
}

.form-row input:focus {
    border-color: #0B3D2E;
    box-shadow: 0 0 0 3px rgba(11, 61, 46, 0.18);
    outline: none;
}

/* Button groups */
.button-group {
    margin-top: 35px;
    display: flex;
    justify-content: center;
    gap: 25px;
}

.button-group .btn {
    padding: 12px 28px;
    font-size: 16px;
    border-radius: 10px;
    min-width: 140px;
    transition: 0.25s;
}

/* Hover */
.btn:hover {
    opacity: .85;
    transform: translateY(-2px);
}

/* Buttons style */
.btn-primary {
    background: #0B3D2E;
    border: none;
    color: white;
}

.btn-secondary {
    background: #b4b4b4;
    border: none;
    color: white;
}

.btn-success {
    background: #27ae60;
    border: none;
    color: white;
}

.btn-danger {
    background: #c0392b;
    border: none;
    color: white;
}

/* Mobile Responsive */
@media(max-width: 768px) {
    .profile-box {
        padding: 25px 28px;
    }

    .form-grid {
        grid-template-columns: 1fr; /* 1 cột */
        gap: 22px;
    }

    .button-group {
        flex-direction: column;
    }
}


