:root {
    --primary-color: #007bff;
    /* Fresh Blue */
    --secondary-color: #ffc107;
    /* Yellow */
    --text-color: #333;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --white: #ffffff;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    padding-top: 70px;
    /* Offset for fixed header */
    line-height: 1.6;
    color: var(--text-color);
    overflow-x: hidden;
    background: #fdfdfd;
}

/* Header */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    margin-left: 20px;
    font-weight: 500;
    transition: 0.3s;
    font-size: 1rem;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.btn-cta {
    background: var(--primary-color);
    color: var(--white) !important;
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.btn-cta:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.4);
}

/* Custom Profile Button */
.btn-profile {
    display: inline-block;
    padding: 10px 25px;
    background-color: #ffffff;
    color: #000000 !important;
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-profile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(45deg, #ffd700, #000000);
    /* Yellow to Black gradient effect */
    z-index: -1;
    transition: width 0.3s ease;
    opacity: 0.1;
    /* Subtle tint initially or on hover? User said "background button yellow black effect" */
}

.btn-profile:hover {
    color: #000000 !important;
    border-color: #ffd700;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
    background: linear-gradient(45deg, #FFD700 0%, #000 100%);
    /* Yellow to black */
    -webkit-background-clip: text;
    /* Text color change effect ? Or background? */
    /* Re-reading request: "chữ màu đen, nền button trắng hiệu ứng nền nút màu vàng đen." 
       Let's interpret: Normal: Text Black, BG White. Hover: BG Yellow/Black gradient? Or fixed Yellow/Black bg? 
       "hiệu ứng nền nút màu vàng đen" implies the background changes or has that effect. */
    background: linear-gradient(135deg, #ffd700, #333);
    color: #fff !important;
    /* Usually dark bg needs light text, but user asked for black text? 
                               Wait, "chữ màu đen" might be for the default state. 
                               Let's try: Hover -> BG Yellow/Black, Text White (for contrast) or keep Black if yellow is dominant.
                               Let's go with a yellow dominant gradient for hover. */
    color: #000 !important;
}


/* Default Menu Toggle (Hidden on Desktop) */
.menu-toggle {
    display: none;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #e3f2fd 0%, #fffcf5 100%);
    padding: 40px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 800;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    color: #555;
    max-width: 700px;
    margin: 0 auto 30px;
}

/* Section Common */
.section {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.section-title p {
    color: #777;
    font-size: 1.1rem;
}

/* Featured Profiles & News Grid (Responsive) */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* New Asymmetric News Layout */
.news-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    /* 60% / 40% split roughly */
    gap: 30px;
}

.news-main {
    position: relative;
    /* Main card handles its own height */
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Featured Card Style */
.news-featured-card {
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    height: 100%;
    /* Fill column */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
}

.news-featured-card:hover {
    transform: translateY(-5px);
}

.news-featured-img {
    width: 100%;
    height: 350px;
    object-fit: cover;
}

.news-featured-content {
    padding: 25px;
    flex: 1;
}

/* List Item Style */
.news-list-item {
    display: flex;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: 0.3s;
    height: 100px;
    /* Fixed small height */
    align-items: center;
}

.news-list-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

.news-list-img {
    width: 120px;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}

.news-list-content {
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-list-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-list-desc {
    font-size: 0.85rem;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    /* Just one line for list items */
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

@media (max-width: 900px) {
    .news-wrapper {
        grid-template-columns: 1fr;
    }

    .news-featured-img {
        height: 250px;
    }
}

/* Template Carousel */
.template-swiper {
    width: 100%;
    padding-top: 20px;
    padding-bottom: 50px;
}

.swiper-slide {
    background-position: center;
    background-size: cover;
    /* Updated for 3-up view with center zoom */
    width: 100%;
    /* Let Swiper control width via slidesPerView */
    height: auto;
    transition: transform 0.3s ease;
    padding-bottom: 50px;
    /* Space for reflection/shadows if needed */
}

/* Specific sizing override if needed for coverflow effect to look good */
@media (min-width: 1024px) {
    .swiper-slide {
        /* If we want gaps, Swiper spaceBetween handles it, or we use padding */
    }
}

/* Ensure active slide is prominent (Swiper adds .swiper-slide-active) */
.swiper-slide-active .template-card {
    border: 2px solid var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.4);
}

.template-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: 0.3s;
}

.template-card img {
    display: block;
    width: 100%;
    height: 400px;
    /* Tall aspect ratio for templates */
    object-fit: cover;
}

.template-card h3 {
    margin: 15px 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .swiper-slide {
        width: 50%;
    }

    .template-card img {
        height: 350px;
    }
}

.profile-card,
.news-card {
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

.profile-card {
    text-align: center;
    padding: 40px 20px;
    align-items: center;
}

.profile-card:hover,
.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 4px solid var(--secondary-color);
}

/* Features Section Redesign */
.features-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.feature-block {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Subtle border */
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    /* Light contrast effect: Start clean */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Premium Dark contrast on Hover (or static if prefer strong contrast) 
   User asked for "hiệu ứng ánh sáng tương phản với nền trang". 
   Since page is light/white, a dark, glowing block is best.
*/
.feature-block {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    /* Dark Slate */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.feature-block:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.4);
    /* Primary color glow */
    border-color: rgba(79, 70, 229, 0.5);
}

/* Internal Glow */
.feature-block::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.4s, transform 0.4s;
    pointer-events: none;
}

.feature-block:hover::before {
    opacity: 1;
    transform: scale(1);
}

.feature-icon-box {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--secondary-color);
    /* Yellow standout */
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s;
}

.feature-block:hover .feature-icon-box {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.6);
}

.feature-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: white;
}

.feature-desc {
    color: #cbd5e1;
    /* Light gray text */
    font-size: 1rem;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .features-container {
        grid-template-columns: 1fr;
    }
}

.news-thumb {
    height: 200px;
    position: relative;
    background: #eee;
}

.news-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.news-content {
    padding: 20px;
    flex: 1;
    text-align: left;
}

.news-time {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 10px;
}

/* Newsletter */
.newsletter {
    background: linear-gradient(to right, var(--primary-color), #00d2ff);
    color: var(--white);
    text-align: center;
    padding: 60px 20px;
    border-radius: 20px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.3);
}

.newsletter-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.newsletter-form input {
    padding: 15px 25px;
    border-radius: 50px;
    border: none;
    width: 350px;
    outline: none;
    font-size: 1rem;
}

.btn-sub {
    background: var(--secondary-color);
    color: #333;
    padding: 15px 35px;
    border-radius: 50px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.3s;
}

.btn-sub:hover {
    background: #ffdb58;
}

/* Footer */
footer {
    background: var(--dark-bg);
    color: #bbb;
    padding: 40px 20px 20px;
    margin-top: 30px;
    position: relative;
    overflow: hidden;
    background: #0f2027;
    /* Fallback */
    background: linear-gradient(to bottom, #000000, #0f2027, #203a43);
    /* Deep space look */
}

/* Footer Starry Sky */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    animation: twinkle var(--duration, 2s) infinite ease-in-out;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.shooting-star {
    position: absolute;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    animation: shoot 3s infinite linear;
    opacity: 0;
    transform: rotate(-30deg);
}

@keyframes shoot {
    0% {
        transform: translate(0, 0) rotate(-30deg);
        opacity: 1;
    }

    10% {
        opacity: 1;
    }

    20% {
        transform: translate(-300px, 300px) rotate(-30deg);
        opacity: 0;
    }

    100% {
        transform: translate(-300px, 300px) rotate(-30deg);
        opacity: 0;
    }
}

/* Banner Waves Canvas */
#banner-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.hero {
    position: relative;
    /* Ensure hero is relative for absolute canvas */
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    /* Darker tech background to confirm with waves */
    color: white;
    /* Switch text to white for dark bg */
}

.hero h1 {
    color: #fff;
    /* White text for header on dark bg */
    z-index: 2;
    position: relative;
}

.hero p {
    color: #ccc;
    z-index: 2;
    position: relative;
}

.hero .btn-cta,
.hero a {
    z-index: 2;
    position: relative;
}


.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-col h3 {
    color: var(--white);
    margin-bottom: 25px;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--secondary-color);
    display: inline-block;
    padding-bottom: 10px;
}

.footer-links a {
    display: block;
    color: #bbb;
    text-decoration: none;
    margin-bottom: 12px;
    transition: 0.2s;
}

.footer-links a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.copy {
    text-align: center;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    font-size: 0.9rem;
}

/* Chatbot */
.ai-widget {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
}

.ai-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #007bff, #00d2ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 123, 255, 0.5);
    transition: transform 0.3s;
    animation: float 3s ease-in-out infinite;
}

.ai-icon:hover {
    transform: scale(1.1);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.chat-window {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 320px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.chat-header {
    background: var(--primary-color);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.chat-body {
    height: 350px;
    padding: 15px;
    overflow-y: auto;
    background: #fafafa;
}

.chat-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
}

.chat-footer input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    font-size: 0.9rem;
}

.chat-msg {
    margin-bottom: 12px;
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.bot-msg {
    background: #e3f2fd;
    color: #333;
    border-top-left-radius: 0;
}

.user-msg {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 0;
}

/* Mobile Optimization: Hamburger & Drawer */
@media screen and (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
        position: relative;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    /* Hamburger Icon */
    .menu-toggle {
        display: block;
        font-size: 26px;
        cursor: pointer;
        color: var(--text-color);
        padding: 5px;
        transition: color 0.3s;
    }

    .menu-toggle:hover {
        color: var(--primary-color);
    }

    /* Mobile Menu Drawer */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
        border-top: 1px solid #f0f0f0;
        z-index: 999;
        /* Animation specifics */
        transform-origin: top center;
        animation: none;
    }

    .nav-menu.active {
        display: flex;
        animation: slideDown 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }

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

    .nav-menu a {
        margin: 0;
        padding: 15px 30px;
        font-size: 1.1rem;
        font-weight: 600;
        border-bottom: 1px solid #fafafa;
        display: block;
        width: 100%;
        box-sizing: border-box;
        text-align: left;
        color: var(--text-color);
    }

    .nav-menu a:hover {
        background-color: #f8f9fa;
        color: var(--primary-color);
        padding-left: 35px;
        /* Slight movement on hover */
    }

    .btn-cta {
        margin: 20px 30px;
        text-align: center;
        display: block;
        width: auto;
    }

    /* Stack other grids */
    .hero {
        padding: 30px 15px;
        text-align: center;
        /* Restore center alignment for mobile hero usually looks better, or stick to left if preferred */
    }

    .hero h1 {
        font-size: 2.2rem;
        margin-bottom: 10px;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .section {
        padding: 25px 15px;
    }

    .section-title {
        margin-bottom: 20px;
    }

    footer {
        padding: 30px 15px 15px;
    }

    .profile-grid,
    .news-grid,
    .footer-content {
        grid-template-columns: 1fr;
    }

    .newsletter-form input {
        width: 100%;
        margin-bottom: 10px;
    }

    .ai-widget {
        bottom: 20px;
        left: 20px;
    }

    .chat-window {
        width: 280px;
        left: 0;
        bottom: 70px;
    }
}