body.mode-1 {
    background: #111;
    color: #fff;
    font-family: 'Press Start 2P', Arial, sans-serif;
    overflow-x: hidden;
}
body.mode-2 {
    background: #f8f9fa;
    color: #222;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
}
.navbar {
    background: rgba(20,20,20,0.95);
    border-bottom: 1px solid #333;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    padding: 0.5rem 0;
}
.brand {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 2px;
    color: #00e6e6;
    font-family: 'Press Start 2P', Arial, sans-serif;
}
.nav {
    flex-direction: row !important;
    gap: 0.5rem;
}
.navbar-nav {
    gap: 0.5rem;
    text-align: center;
}
.nav-link {
    color: inherit !important;
    font-weight: 600;
    font-size: 15px;
    padding: 0.25rem 0.7rem !important;
    position: relative;
    transition: color 0.3s;
}
.nav-link::after {
    content: "";
    display: block;
    width: 0;
    height: 2px;
    background: #00e6e6;
    transition: width 0.3s;
    position: absolute;
    left: 0;
    bottom: -2px;
}
.nav-link:hover {
    color: #00e6e6 !important;
}
.nav-link:hover::after {
    width: 100%;
}
.nav-link.active {
    color: #00e6e6 !important;
    text-shadow: 0 0 6px #00e6e6;
}
.section {
    min-height: 100vh;
    padding: 32px 0 24px 0;
    margin-top: 0 !important;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(.77,0,.18,1), transform 0.8s cubic-bezier(.77,0,.18,1);
    scroll-margin-top: 100px;
}
.section.visible {
    opacity: 1;
    transform: translateY(0);
}
.section-content {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 30px 24px;
    max-width: 900px;
    margin: 0 auto;
}
.section-content1 {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 1px 24px;
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: hidden; /* Ngăn carousel tràn ra ngoài */
}
.animated-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh; /* Thay vw bằng % để tránh tràn */
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(120deg, #00e6e6 0%, #222 100%);
    opacity: 0.18;
    animation: gradientMove 12s ease-in-out infinite alternate;
}
@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: 2px;
    color: #00e6e6;
    opacity: 1;
}
.section-title.animated-title {
    animation: fadeInScale 1.2s cubic-bezier(.77,0,.18,1);
}
@keyframes fadeInScale {
    0% { transform: scale(0.5) rotate(-8deg); opacity: 0; }
    50% { transform: scale(1.08) rotate(2deg); opacity: 1; }
    70% { transform: scale(0.97) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.skills-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 32px;
    justify-items: center;
    align-items: center;
    margin-top: 32px;
}
.skill-card {
    background: rgba(40,40,40,0.95);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12), 0 0 0 #00e6e6;
    border: 1px solid #222;
    padding: 24px 12px;
    min-height: 140px;
    width: 100%;
    max-width: 210px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.3s, border-color 0.3s;
    position: relative;
    overflow: hidden;
    text-align: center;
}
.skill-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    border: 2px solid #00e6e6;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1;
    animation: neonBorder 2.5s infinite;
}
.skill-card:hover {
    transform: translateY(-8px) scale(1.07);
    box-shadow: 0 6px 24px #00e6e6a0;
    border-color: #00e6e6;
}
.skill-card:hover::before {
    opacity: 1;
}
@keyframes neonBorder {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.7; }
}
.skill-card img {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    object-fit: contain;
}
.skill-card div {
    font-size: 1.1rem;
    color: #fff;
    font-family: Arial, sans-serif;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-top: 0;
}
.project-card {
    background: rgba(40,40,40,0.95);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    border: 1px solid #222;
    padding: 16px;
    transition: transform 0.3s, box-shadow 0.3s;
}
.project-card:hover {
    transform: translateY(-8px) scale(1.04);
    box-shadow: 0 6px 24px #00e6e6a0;
    border-color: #00e6e6;
}
.project-card img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.particle {
    position: fixed;
    border-radius: 50%;
    opacity: 0.25;
    pointer-events: none;
    z-index: 1;
    animation: floatParticle 16s linear infinite;
}
@keyframes floatParticle {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-60px) scale(1.2); }
    100% { transform: translateY(0) scale(1); }
}
.mode-btn {
    background: #222;
    color: #fff;
    border-radius: 8px;
    border: none;
    padding: 8px 18px;
    font-weight: 600;
    transition: 0.3s;
    animation: pulseBtn 2.2s infinite;
}
@keyframes pulseBtn {
    0% { box-shadow: 0 0 0 0 #00e6e6; }
    70% { box-shadow: 0 0 0 12px rgba(0,230,230,0); }
    100% { box-shadow: 0 0 0 0 #00e6e6; }
}
.mode-btn:hover {
    background: #00e6e6;
    color: #222;
}
footer {
    background: transparent;
    text-align: center;
    padding: 24px 0 12px 0;
    font-size: 1rem;
    color: #888;
    border-top: 1px solid #222;
    margin-top: 40px;
}
.profile-navbar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 12px;
    cursor: pointer;
    border: 2px solid #00e6e6;
    box-shadow: 0 2px 8px #0004;
}
.about-text {
    font-size: 0.6rem;
    padding : 68px 68px 0 68px;

    line-height: 2.3;
    color: #fff;
    text-align: justify;
    font-weight: 400;

    max-width: 48%;
}
.about-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 5vw;
    line-height: 1.05;
    color: #fff;
    text-align: right;
    letter-spacing: 2px;
    font-weight: 900;
    margin-right: 20px;
    white-space: pre-line;
    text-shadow:
        0 2px 16px #000,
        0 0 0 #00e6e6;
    overflow: hidden;
    animation: neon-flicker 2.5s infinite;
}
@keyframes neon-flicker {
    0%, 100% { color: #00e6e6; text-shadow: 0 0, 8px #00e6e6, 0 2px 16px #000; }
    10% { color: #fff; text-shadow: 0 0 2px #00e6e6, 0 2px 16px #000; }
    20% { color: #00e6e6; text-shadow: 0 0 16px #00e6e6, 0 2px 16px #000; }
    30% { color: #fff; text-shadow: 0 0 4px #00e6e6, 0 2px 16px #000; }
    40% { color: #00e6e6; text-shadow: 0 0 12px #00e6e6, 0 2px 16px #000; }
    50% { color: #fff; text-shadow: 0 0 2px #00e6e6, 0 2px 16px #000; }
    60% { color: #00e6e6; text-shadow: 0 0 20px #00e6e6, 0 2px 16px #000; }
    70% { color: #fff; text-shadow: 0 0 2px #00e6e6, 0 2px 16px #000; }
    80% { color: #00e6e6; text-shadow: 0 0 10px #00e6e6, 0 2px 16px #000; }
    90% { color: #fff; text-shadow: 0 0 2px #00e6e6, 0 2px 16px #000; }
}
.timeline {
    position: relative;
    padding: 32px 0;
    max-width: 600px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 40px;
    top: 0;
    bottom: 0;
    width: 6px;
    background: linear-gradient(180deg, #00e6e6 0%, #222 100%);
    border-radius: 3px;
    box-shadow: 0 0 12px #00e6e6a0;
}
.timeline-item {
    position: relative;
    margin-bottom: 56px;
    min-height: 80px;
    display: flex;
    align-items: flex-start;
}
.timeline-dot {
    position: absolute;
    left: 28px;
    top: 0;
    width: 24px;
    height: 24px;
    background: #222;
    border-radius: 50%;
    border: 3px solid #00e6e6;
    box-shadow: 0 2px 12px #00e6e6a0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.timeline-icon img {
    display: block;
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 0 2px #00e6e6);
}
.timeline-content {
    margin-left: 80px;
    background: linear-gradient(90deg, rgba(0,230,230,0.09) 0%, rgba(40,40,40,0.97) 100%);
    border-radius: 16px;
    padding: 22px 28px;
    box-shadow: 0 4px 24px rgba(0,230,230,0.07);
    color: #fff;
    min-width: 220px;
    position: relative;
    transition: box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 110px;
    width: 100%;
    box-sizing: border-box;
}
.timeline-content:hover {
    box-shadow: 0 8px 32px #00e6e6a0;
    border: 1px solid #00e6e6;
}
.timeline-date {
    font-size: 1.08rem;
    color: #00e6e6;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 1px;
}
.timeline-title {
    font-size: 1.22rem;
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: 1px;
}
.timeline-school {
    font-size: 1.05rem;
    color: #b6e6e6;
    font-style: italic;
}
.project-list {
    margin-top: 24px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: start;
    align-items: start;
    position: relative;
    perspective: 1000px;
    overflow: hidden;
    width: 100%;
    height: 500px;
}
.project-card-simple {
    background: rgba(40,40,40,0.97);
    border-radius: 16px;
    box-shadow: 0 2px 16px #00e6e633;
    border: 1.5px solid #222;
    padding: 18px 12px 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 320px;
    max-width: 370px;
    min-height: 440px;
    transition: transform 0.6s ease, box-shadow 0.3s, border-color 0.3s;
    position: absolute;
    left: 50%;
    transform: translateX(-50%) rotateY(0deg) scale(1);
    opacity: 0.8;
    overflow: visible;
    margin-top: 30px;
}
.project-card-simple.active {
    transform: translateX(-50%) rotateY(0deg) scale(1.1);
    opacity: 1;
    z-index: 1;
    box-shadow: 0 6px 24px #00e6e6a0;
    border-color: #00e6e6;
}
.project-card-simple.prev {
    transform: translateX(-150%) rotateY(-30deg) scale(0.9);
    opacity: 0.5;
    cursor: pointer;
}
.project-card-simple.next {
    transform: translateX(50%) rotateY(30deg) scale(0.9);
    opacity: 0.5;
    cursor: pointer;
}
.project-card-simple > .project-title,
.project-card-simple > .project-desc,
.project-card-simple > .project-stack,
.project-card-simple > .project-features,
.project-card-simple > .project-links,
.project-card-simple > .project-role {
    width: 100%;
}
.project-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 1rem;
    color: #00e6e6;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
    letter-spacing: 1px;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-desc {
    font-size: 0.6rem;
    color: #fff;
    margin-bottom: 8px;
    text-align: start;
    min-height: 44px;
    display: flex;
    align-items: center;
}
.project-stack {
    display: flex;
    gap: 7px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 28px;
    align-items: center;
}
.project-stack img {
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 0 2px #00e6e6);
}
.project-features {
    list-style: disc inside;
    color: #b6e6e6;
    font-size: 0.6rem;
    margin-bottom: 8px;
    text-align: left;
    padding-left: 0;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.project-links {
    margin-bottom: 6px;
    text-align: center;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-role {
    font-size: 0.91rem;
    color: #fff;
    margin-top: 2px;
    text-align: center;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-role span {
    color: #00e6e6;
    font-weight: 600;
    font-size: 0.75rem;
}
.carousel-control-prev, .carousel-control-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 230, 230, 0.2);
    border: none;
    color: #00e6e6;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}
.carousel-control-prev:hover, .carousel-control-next:hover {
    background: rgba(0, 230, 230, 0.4);
}
.carousel-control-prev {
    left: 10px;
}
.carousel-control-next {
    right: 10px;
}

/* =================================
   RESPONSIVE STYLES
   ================================= */

/* --- Navbar Toggler Icon --- */
.navbar-toggler {
    border-color: rgba(0, 230, 230, 0.5);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 230, 230, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* --- About Section --- */
.section-about {
    display: flex;
    align-items: center;
    min-height: 90vh;
}

/* ===================================================================
   1. Large devices (Desktops, < 1200px)
   =================================================================== */
@media (max-width: 1199.98px) {
    .project-card-simple {
        min-width: 300px; /* Giảm nhẹ kích thước */
        max-width: 350px;
        min-height: 430px; /* Điều chỉnh min-height thay vì height cố định */
    }
    .project-thumb {
        max-width: 98vw;
    }
}

/* ===================================================================
   2. Medium devices (Tablets, < 992px)
   =================================================================== */
@media (max-width: 991.98px) {
    /* --- General Section Layout --- */
    .section-about {
        min-height: auto;
        padding-top: 5rem;
        padding-bottom: 5rem;
        text-align: center;
    }
    
    /* --- About Section --- */
    .about-text {
        max-width: 70%;
        padding: 20px;
        margin: 0 auto; /* Căn giữa trên tablet */
    }
    .about-title {
        text-align: center;
        font-size: 10vw;
    }

    /* --- Skills Section --- */
    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* --- Project Carousel --- */
    .project-list {
        height: 470px; /* Giảm chiều cao carousel */
    }
    .project-card-simple {
        min-width: 280px;
        max-width: 320px;
        min-height: 420px;
        padding: 14px 10px; /* Giảm padding thẻ */
    }
    .project-title {
        font-size: 0.9rem; /* Giảm font tiêu đề */
    }
    .project-desc, .project-features {
        font-size: 0.6rem; /* Giảm font mô tả */
    }
    .project-card-simple.prev {
        transform: translateX(-130%) rotateY(-25deg) scale(0.85); /* Điều chỉnh vị trí */
    }
    .project-card-simple.next {
        transform: translateX(30%) rotateY(25deg) scale(0.85); /* Điều chỉnh vị trí */
    }
}

/* ===================================================================
   3. Small devices (Landscape Phones, < 768px)
   =================================================================== */
@media (max-width: 767.98px) {
    .brand {
        font-size: 22px;
    }
    .section-title {
        font-size: 1.6rem;
    }
    .section-content {
        padding: 24px 8px;
    }

    /* --- Project Carousel --- */
    .project-list {
        height: 452px; /* Giảm chiều cao hơn nữa */
    }
    .project-card-simple {
        min-width: 260px; /* Thu nhỏ thẻ hơn nữa */
        max-width: 280px;
        min-height: 390px;
        padding: 12px 8px;
    }
    .project-title {
        font-size: 0.7rem;
        min-height: 32px;
    }
    .project-desc, .project-features, .project-role, .project-role span {
        font-size: 0.5rem;
    }

}

/* ===================================================================
   4. Extra small devices (Portrait Phones, < 600px)
   =================================================================== */
@media (max-width: 599.98px) {

    /* --- Skills Section --- */
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    /* --- Timeline Section --- */
    .timeline { max-width: 98vw; }
    .timeline::before { left: 18px; width: 4px; }
    .timeline-dot { left: 6px; width: 18px; height: 18px; }
    .timeline-content { padding: 14px 12px; font-size: 0.97rem; margin-left: 54px; }
    .timeline-date, .timeline-title, .timeline-school { font-size: 0.97rem; }
    .timeline-title1 { font-size: 0.90rem; }
    
    /* --- Project Carousel --- */
    .project-list {
        height: 452px; /* Chiều cao cho màn hình nhỏ nhất */
    }
    .project-card-simple {
        min-width: 240px; /* Kích thước nhỏ nhất cho thẻ */
        max-width: 260px;
        min-height: 370px;

    }
    .project-title {
        font-size: 0.6rem;
    }
    .project-desc, .project-features, .project-role, .project-role span {
        font-size: 0.4rem; /* Font nhỏ nhất có thể đọc */
    }
    .project-features { min-height: 60px; }
}

/* --- Chatbot Animation --- */
#chatbase-bubble-button {
    position: relative; /* Cần thiết cho pseudo-element */
    transition: transform 0.3s ease-in-out;
}

/* Tạo hiệu ứng pulse bằng pseudo-element để tối ưu hiệu năng */
#chatbase-bubble-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%; /* Giả sử nút của bạn hình tròn */
    background-color: #00e6e6;
    animation: chatbot-pulse-optimized 2.5s infinite cubic-bezier(0.66, 0, 0, 1);
    z-index: -1; /* Đặt phía sau nút thật */
}

#chatbase-bubble-button:hover {
    /* Phóng to nhẹ khi di chuột qua và tạm dừng animation */
    transform: scale(1.1);
}

@keyframes chatbot-pulse-optimized {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* --- Chatbot Window Size --- */
/* Giảm kích thước cửa sổ chat để nhỏ gọn hơn */
#chatbase-bubble-window {
    max-width: 350px !important; /* Giảm chiều rộng tối đa */
    max-height: 80vh !important; /* Giới hạn chiều cao theo khung nhìn */
    height: 550px !important; /* Giảm chiều cao mặc định */
}

/* --- Profile Dropdown --- */
.navbar .dropdown-menu {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #00e6e6;
    box-shadow: 0 4px 24px #00e6e655;
    border-radius: 8px;
    margin-top: 12px !important;
}

.navbar .dropdown-item {
    color: #fff; /* Màu chữ mặc định */
    font-family: Arial, sans-serif; /* Giữ font Arial để dễ đọc */
    font-weight: 600; /* Chữ đậm hơn */
    transition: background-color 0.3s, color 0.3s, text-shadow 0.3s;
    text-shadow: 0 0 4px rgba(0, 230, 230, 0.4); /* Hiệu ứng phát sáng nhẹ */
    padding: 10px 15px; /* Điều chỉnh padding */
    display: flex; /* Để căn chỉnh icon và text */
    align-items: center;
}

.navbar .dropdown-item:hover {
    background-color: #00e6e6;
    color: #111;
    text-shadow: none; /* Bỏ hiệu ứng phát sáng khi hover để tăng độ tương phản */
}

.navbar .dropdown-item i {
    font-size: 1.1em; /* Kích thước icon lớn hơn một chút */
    color: #00e6e6; /* Màu neon cho icon */
    transition: color 0.3s;
}

.navbar .dropdown-item:hover i {
    color: #111; /* Đổi màu icon khi hover */
}

/* =================================
   Dropdown on Hover
   ================================= */
/* Hiển thị dropdown menu khi di chuột qua phần tử cha (.dropdown) */
.navbar .dropdown:hover .dropdown-menu {
    display: block;
}

/* (Tùy chọn) Ẩn mũi tên mặc định của dropdown nếu bạn không cần */
.navbar .dropdown-toggle::after { display: none; }