:root {
    --accent-blue: #4A69FF;
    --background-light-gray: #F7F8FC;
    --container-white: #FFFFFF;
    --primary-text: #2c3e50;
    --secondary-text: #8a92a6;
    --border-color: #E9ECEF;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
    --hover-light: rgba(74, 105, 255, 0.05);
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--background-light-gray);
    color: var(--primary-text);
}

/* --- Sidebar Styling --- */
.sidebar.position-fixed {
    background-color: var(--container-white);
    border-right: 1px solid var(--border-color);
    width: 280px;
    height: 100vh;
    top: 0;
    left: 0;
    overflow-y: auto;
}
.offcanvas {
    background-color: var(--container-white);
    border-right: 1px solid var(--border-color);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}
#sidebarOffcanvas {
    width: 80vw;
    max-width: 320px;
}
.sidebar-title {
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--primary-text);
    padding: 1.1rem 0;
    margin-bottom: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}
.offcanvas-header .sidebar-title {
    padding: 0;
    margin-bottom: 0;
    border-bottom: none;
    text-align: left;
}
.sidebar .nav-link {
    position: relative; 
    overflow: hidden;   
    color: var(--secondary-text);
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    border-radius: 0.5rem;
    transition: all .2s ease-in-out;
    font-weight: 500;
}
.sidebar .nav-link:hover {
    color: var(--accent-blue);
    background-color: var(--hover-light);
}
.sidebar .nav-link.active {
    color: var(--accent-blue);
    font-weight: 600; 
    background-color: rgba(74, 105, 255, 0.1);
}
.sidebar .nav-link i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

/* --- Hiệu ứng Ripple --- */
.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(74, 105, 255, 0.15);
    transform: scale(0);
    animation: ripple-effect 0.6s linear;
    pointer-events: none;
}
@keyframes ripple-effect { to { transform: scale(4); opacity: 0; } }

/* --- Main Content & Header --- */
.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 0; 
}
main {
    flex: 1; 
    padding-top: 0;
}
.sticky-top-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background-color: var(--container-white);
    border-bottom: 1px solid var(--border-color);
}
.ripple-toggle {
    position: relative;
    overflow: hidden;
    border: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
}
.ripple-toggle .ripple {
    background-color: rgba(128, 128, 128, 0.2);
}
.header-brand {
    flex-grow: 1; 
    text-align: center;
}
.header-brand-content {
    display: inline-flex;
    align-items: center;
}
.header-logo-img {
    height: 50px;
    width: auto;
}
.header-user-avatar {
    width: 40px; 
    height: 40px; 
    border-radius: 50%;
    object-fit: cover;
    align-self: center; 
    cursor: pointer;
}

/* --- Dropdown Menu User Styling --- */
.dropdown-menu {
    border-radius: 0.75rem;
    border: none;
    box-shadow: var(--shadow-md);
    padding: 0.5rem;
    margin-top: 0.75rem !important;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    color: var(--primary-text);
    transition: all 0.2s ease-in-out;
}
.dropdown-item i {
    font-size: 1.2rem;
    color: var(--secondary-text);
    transition: color 0.2s ease-in-out;
}
.dropdown-item:hover, .dropdown-item:focus {
    background-color: rgba(74, 105, 255, 0.1);
    color: var(--accent-blue);
}
.dropdown-item:hover i, .dropdown-item:focus i {
    color: var(--accent-blue);
}
.dropdown-item.text-danger:hover, .dropdown-item.text-danger:focus {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--bs-danger);
}
.dropdown-item.text-danger:hover i, .dropdown-item.text-danger:focus i {
    color: var(--bs-danger);
}
.dropdown-divider {
    border-top: 1px solid var(--border-color);
}

/* --- CSS CHUNG --- */
.section-title {
    color: var(--primary-text);
    font-weight: 600;
}
.card {
    border: none;
    box-shadow: var(--shadow-sm);
    border-radius: 0.75rem;
}
.list-group-item {
    border: none !important;
}
.list-group-item:first-child {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}
.list-group-item:last-child {
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
}
.list-group-item-action:hover {
    background-color: var(--hover-light);
}
.list-group-item-action strong {
    color: var(--primary-text);
    transition: color 0.2s ease-in-out;
}
.list-group-item-action:hover strong {
    color: var(--accent-blue);
}
.btn-primary {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    font-weight: 500;
}
.btn-outline-primary {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    font-weight: 500;
}
.btn-outline-primary:hover {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* --- CSS TRANG INDEX.PHP --- */
.carousel {
    overflow: hidden; 
}
.carousel-item {
    aspect-ratio: 16 / 9;
}
.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.carousel-caption {
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    bottom: 0; left: 0; right: 0; padding-bottom: 2rem;
}
.carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.utility-icon-list {
    color: var(--accent-blue);
    background-color: rgba(74, 105, 255, 0.1);
    padding: 0.5rem;
    border-radius: 50%;
}
.support-form-card .form-label {
    font-weight: 500;
    color: var(--secondary-text);
}
.support-form-card .form-control {
    background-color: var(--background-light-gray);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}
.support-form-card .form-control:focus {
    background-color: var(--container-white);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 0.25rem rgba(74, 105, 255, 0.25);
}
.support-form-card .btn-primary {
    background-color: var(--accent-blue);
    border: none;
    font-weight: 500;
    padding: 0.75rem;
}
.featured-post-card a {
    text-decoration: none;
    color: var(--primary-text);
}
.featured-post-card a:hover {
    color: var(--accent-blue);
}

/* --- CSS CHO FORM ĐĂNG NHẬP/ĐĂNG KÝ --- */
body.auth-body {
    background-color: var(--background-light-gray);
}
.auth-container {
    display: flex;
    min-height: 100vh;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
    padding-left: 1rem;
    padding-right: 1rem;
}
.auth-card {
    border: none;
    border-radius: 0.75rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
}
.auth-logo {
    height: 60px;
    width: auto;
}
.auth-card .btn-primary {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}
.auth-card a:hover {
    text-decoration: underline !important;
}
.input-group-text {
    background-color: var(--background-light-gray);
    border: 1px solid var(--border-color);
    border-right: none;
    color: var(--secondary-text);
}
.form-control {
    border-left: none;
}
.form-control:focus {
    border-color: #86b7fe;
    box-shadow: none;
    border-left: none;
}
.input-group:focus-within .input-group-text {
    border-color: #86b7fe;
    color: var(--accent-blue);
}

/* --- FOOTER --- */
.site-footer {
    background-color: var(--container-white);
    color: var(--secondary-text);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}
.footer-logo-img {
    height: 40px;
    width: auto;
    filter: none;
}
.footer-heading {
    color: var(--primary-text);
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}
.footer-links li {
    margin-bottom: 0.75rem;
}
.footer-links a {
    text-decoration: none;
    color: var(--secondary-text);
    transition: color 0.2s ease-in-out;
}
.footer-links a:hover {
    color: var(--accent-blue);
}
.footer-socials .social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--background-light-gray);
    color: var(--primary-text);
    text-decoration: none;
    margin-right: 0.5rem;
    transition: all 0.2s ease-in-out;
}
.footer-socials .social-icon:hover {
    background-color: var(--accent-blue);
    color: var(--container-white);
}
.footer-copyright {
    border-top: 1px solid var(--border-color);
}

/* --- PROFILE PAGE STYLES --- */
.profile-card {
    border-radius: 0.75rem;
}
.profile-avatar {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid var(--container-white);
    box-shadow: var(--shadow-md);
}
.profile-info-details p {
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.profile-info-details strong {
    color: var(--primary-text);
}


@media (min-width: 992px) {
    .main-content {
        margin-left: 280px;
    }
}
/* --- CSS MỚI CHO TRANG CÀI ĐẶT --- */
.settings-card .list-group-item {
    padding: 1.25rem 1.5rem;
}
.settings-card h6 {
    font-weight: 600;
    color: var(--primary-text);
}
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
}
.modal-header, .modal-footer {
    border: none;
}
/* --- CSS CHO TRANG LỊCH SỬ (TIMELINE) --- */
.timeline-group {
    position: relative;
    padding-left: 1.0rem;
    border-left: 2px solid var(--border-color);
}
.timeline-group:last-of-type {
    border-left: 2px solid transparent;
}
.timeline-date {
    position: sticky;
    top: 80px;
    background-color: var(--background-light-gray);
    padding: 0.5rem 0;
    margin-left: -2.5rem;
    padding-left: 2.5rem;
    font-weight: 600;
    color: var(--primary-text);
    z-index: 10;
}
.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}
.timeline-group .timeline-item:last-child {
    padding-bottom: 2rem;
}
.timeline-icon {
    position: absolute;
    left: -1rem;
    top: 0.15rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--accent-blue);
    color: var(--container-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.timeline-content {
    padding-left: 1.5rem; /* Thêm padding trái cho nội dung */
}
.timeline-content p {
    margin-bottom: 0.25rem;
}
.timeline-content p a {
    color: var(--primary-text);
    font-weight: 500;
}
.timeline-content p a:hover {
    color: var(--accent-blue);
}
.timeline-content small {
    display: flex;
    align-items: center;
}
.btn-group .btn-outline-primary {
    border-color: var(--border-color);
    color: var(--secondary-text);
}
.btn-group .btn-outline-primary.active, .btn-group .btn-outline-primary:hover {
    background-color: var(--accent-blue);
    color: var(--container-white);
    border-color: var(--accent-blue);
}

/* --- Responsive --- */
@media (min-width: 992px) {
    .main-content {
        margin-left: 280px;
    }
}