/* =======================================================
   UNIMATCH - GLOBAL CSS 
   Hệ thống Style chuẩn hóa - Tối ưu hóa UI/UX
======================================================== */

/* 1. KHAI BÁO BIẾN (CSS VARIABLES) */
:root {
    /* Bảng màu chính (Brand Colors) */
    --primary-color: #0d6efd;
    --primary-gradient: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    --success-color: #198754;
    --danger-color: #dc3545;
    --bg-main: #f8f9fa;
    --bg-chat: #f4f6f9;

    /* Màu Text */
    --text-dark: #212529;
    --text-muted: #6c757d;

    /* Thiết lập UI & Hiệu ứng */
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --box-shadow-app: 0 8px 24px rgba(0, 0, 0, 0.06);
    --box-shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.12);
    --transition-speed: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* =======================================================
   2. CÀI ĐẶT CƠ BẢN & UI COMPONENTS CHUNG
   (Áp dụng cho mọi trang)
======================================================== */
html {
    scroll-behavior: smooth;
    /* Cuộn trang mượt mà */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Thêm vào file style.css */
body {
    padding-top: 76px;
    /* Khoảng trống đẩy nội dung xuống không bị Navbar đè lên */
}

/* Đổi màu khi hover vào các link trên navbar */
.navbar-nav .nav-link:hover {
    color: #0d6efd !important;
}

.navbar-nav .nav-link.active {
    color: #0d6efd !important;
    font-weight: bold;
}

/* Thẻ Card dùng chung (Cho form, thông tin, bảng tin) */
.card,
.feature-box,
.listing-card {
    background: #ffffff;
    border: 1px solid #f0f2f5;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-app) !important;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed), border-color var(--transition-speed);
}

/* Gộp chung hiệu ứng Hover nổi khối (Nảy lên) cho các thẻ */
.feature-box:hover,
.listing-card:hover,
.profile-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--box-shadow-hover) !important;
    border-color: rgba(13, 110, 253, 0.2);
}

/* Tùy chỉnh Nút bấm sinh động hơn */
.btn {
    border-radius: 50rem;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: var(--primary-gradient);
    /* Màu nút xanh bóng bẩy hơn */
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(13, 110, 253, 0.25);
}

/* Tùy chỉnh Input Form */
.form-control {
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Trắc nghiệm (Radio Button) */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* =======================================================
   3. LOGIC CHUYỂN TRANG SPA & ANIMATIONS
======================================================== */
.page {
    display: none;
    animation: fadeIn var(--transition-speed);
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {

    /* Hiệu ứng nảy bong bóng cực xinh cho Chat & Tag */
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* =======================================================
   4. TRANG CHỦ (HOME PAGE)
======================================================== */
.hero-section {
    padding: 3rem 1rem;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(25, 135, 84, 0.05) 100%);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(13, 110, 253, 0.1);
}

.hero-badge {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 50rem;
}

.feature-box {
    padding: 1.5rem;
    text-align: center;
    height: 100%;
}

.feature-icon {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1rem auto;
}

.icon-primary {
    background: var(--primary-gradient);
    color: white;
}

.icon-success {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
    color: white;
}

.testimonial-box {
    background-color: #ffffff;
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
}

/* =======================================================
   5. TRANG BẢNG TIN (DASHBOARD)
======================================================== */
.search-bar-container {
    background: white;
    border-radius: 50rem;
    padding: 0.4rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.search-input {
    border: none !important;
    box-shadow: none !important;
    background: transparent;
}

/* Tabs Chuyển Đổi */
.nav-pills .nav-link {
    color: var(--text-muted);
    border-radius: 50rem;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
}

.nav-pills .nav-link.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.room-img {
    height: 180px;
    object-fit: cover;
    width: 100%;
    transition: transform 0.4s;
}

/* Cân chỉnh ảnh phòng có hiệu ứng zoom nhẹ khi hover */
.listing-card:hover .room-img {
    transform: scale(1.05);
}

.badge-kyc {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(25, 135, 84, 0.2);
}

/* Nút Thả tim */
.btn-favorite {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.2s;
}

.btn-favorite:active {
    transform: scale(0.8);
}

/* Bóp méo nhẹ khi click */
.btn-favorite.active {
    color: var(--danger-color);
    transform: scale(1.1);
}

/* =======================================================
   6. TRANG CHI TIẾT PHÒNG TRỌ (ROOM DETAIL)
======================================================== */
.main-room-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-app);
}

.thumb-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.thumb-img:hover,
.thumb-img.active {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    /* Nhấc nhẹ ảnh nhỏ thay vì phóng to gây lệch layout */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.sticky-sidebar {
    position: sticky;
    top: 20px;
}

.utility-icon {
    font-size: 1.5rem;
    margin-right: 10px;
}

/* =======================================================
   7. TRANG NHẮN TIN (CHAT INTERFACE)
======================================================== */
.chat-box-wrapper {
    height: calc(100vh - 120px);
    min-height: 550px;
    background: #ffffff;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.chat-sidebar {
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
}

.chat-main-area {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background-color: var(--bg-chat);
    display: flex;
    flex-direction: column;
}

/* Bong bóng chat - Thêm Animation popIn */
.msg-bubble {
    max-width: 75%;
    padding: 0.7rem 1.2rem;
    border-radius: 18px;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    word-wrap: break-word;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.msg-sent {
    background: var(--primary-gradient);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    /* Giật nhọn góc dưới */
}

.msg-received {
    background-color: #ffffff;
    color: var(--text-dark);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #e9ecef;
}

.chat-footer-input {
    padding: 1rem;
    background: #ffffff;
    border-top: 1px solid #e9ecef;
}

.chat-item-link {
    padding: 0.8rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: var(--border-radius-md);
}

.chat-item-link.active,
.chat-item-link:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* =======================================================
   8. TRANG HỒ SƠ CÁ NHÂN (USER PROFILE)
======================================================== */
.profile-avatar-lg {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    font-size: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem auto;
    box-shadow: 0 6px 15px rgba(13, 110, 253, 0.3);
}

.trait-tag {
    background-color: #ffffff;
    color: var(--text-dark);
    padding: 0.5rem 1rem;
    border-radius: 50rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
    margin: 0.25rem;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    cursor: default;
}

/* Tương tác sinh động khi trỏ chuột vào các đặc điểm tính cách */
.trait-tag:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
}

/* =======================================================
   10. TRANG ĐĂNG TIN (POST ROOM / LISTING)
======================================================== */
.upload-dropzone {
    border: 2px dashed #0d6efd;
    background-color: rgba(13, 110, 253, 0.02);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-dropzone:hover {
    background-color: rgba(13, 110, 253, 0.08);
    border-color: #0a58ca;
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Hiệu ứng nhấp nháy cho thông báo thành công */
.alert-custom {
    border-radius: var(--border-radius-md);
    border-left: 4px solid var(--success-color);
}

/* --------------------------------------
   TRẮC NGHIỆM LỐI SỐNG (MULTIPLE_CHOICE)
----------------------------------------- */
/* 1. Tùy chỉnh thanh cuộn cho hộp câu hỏi */
.custom-scroll-area {
    flex: 1;
    /* Hộp tự động co giãn lấp đầy khoảng trống */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 15px;
}

.custom-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll-area::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 10px;
}

.custom-scroll-area::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 10px;
}

.custom-scroll-area::-webkit-scrollbar-thumb:hover {
    background: #aab5df;
}

/* 2. Trang trí cho danh sách tiêu chí AI bên trái */
.ai-criteria-list li {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: #495057;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* 3. Giao diện trắc nghiệm chuyên nghiệp - Dạng Grid */
.quiz-choice {
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #ffffff;
    border: 2px solid #e9ecef !important;
}

.quiz-choice:hover {
    border-color: #b6d4fe !important;
    background-color: #f8f9fa;
}

.quiz-choice:has(input:checked) {
    border-color: #0d6efd !important;
    background-color: #f0f5ff;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.08);
}

.quiz-choice:has(input:checked) .choice-text {
    color: #0a58ca !important;
    font-weight: 700 !important;
}

/* Hiệu ứng cho tính năng ở trang chủ */
.feature-box {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.feature-box:hover {
    transform: translateY(-8px);
    border-color: #0d6efd;
    box-shadow: 0 10px 25px rgba(13, 110, 253, 0.15) !important;
}
/* Trang trí Footer */
.footer-links a {
    transition: all 0.3s ease;
}
.footer-links a:hover {
    color: #0d6efd !important; /* Màu xanh Primary */
    padding-left: 5px; /* Hiệu ứng đẩy chữ nhẹ sang phải */
    text-decoration: underline !important;
}
 /* Thêm hiệu ứng hover nhẹ cho tên người dùng ở Header */
        .hover-text-primary:hover {
            color: #0d6efd !important;
        }
        .chat-item-link {
            transition: all 0.2s ease;
        }
        .chat-item-link:hover {
            background-color: #f8f9fa;
        }