:root {
    --primary: #0B3C5D;
    --secondary: #1CA7A6;
    --accent: #00E5FF;
    --bg-light: #F5F9FC;
}

* {
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

body {
    margin: 0;
    background: var(--bg-light);
    color: #333;
}

/* ===== HEADER ===== */
header {
    position: sticky;
    top: 0;
    z-index: 1000;

    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 15px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;

    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(11, 60, 93, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

header img {
    height: 60px;
}

/* MENU DESKTOP */
nav {
    display: flex;
    align-items: center;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 28px;
    font-weight: 500;
    position: relative;
    padding-bottom: 4px;
}

nav a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent);
    transition: 0.3s;
}

nav a:hover::after {
    width: 100%;
}

nav a.active {
    color: var(--accent);
}

nav a.active::after {
    width: 100%;
}

/* MENU TOGGLE (MOBILE) */
.menu-toggle {
    display: none;
    font-size: 26px;
    color: white;
    cursor: pointer;
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 80px 40px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero h1 {
    font-size: 40px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    opacity: 0.95;
}

.hero .cta {
    margin-top: 30px;
}

.btn-primary {
    background: var(--accent);
    color: #003;
    padding: 14px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
}

/* ===== SECTION ===== */
.section {
    padding: 70px 40px;
}

.section h2 {
    text-align: center;
    font-size: 30px;
    margin-bottom: 40px;
    color: var(--primary);
}

/* ===== CARD ===== */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
}

.card {
    background: white;
    border-radius: 14px;
    padding: 30px;
    box-shadow: 0 12px 25px rgba(0,0,0,0.08);
    transition: 0.3s;
}

.card:hover {
    transform: translateY(-6px);
}

/* ===== FOOTER ===== */
footer {
    background: var(--primary);
    color: #ccc;
    text-align: center;
    padding: 25px;
}

/* ===== CHAT ICON ===== */
#chatbot-icon {
    position: fixed;
    bottom: 100px;
    left: 20px;
    background: linear-gradient(135deg,#0B3C5D,#1CA7A6);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,.25);
    z-index: 9999;
}

/* ===== CHAT BOX ===== */
#chatbot-box {
    position: fixed;
    bottom: 170px;
    left: 20px;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,.25);
    overflow: hidden;
    z-index: 9999;
}

.chat-header {
    background: linear-gradient(135deg,#0B3C5D,#1CA7A6);
    color: white;
    padding: 12px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

.chat-close {
    cursor: pointer;
}

#chat-log {
    padding: 15px;
    height: 260px;
    overflow-y: auto;
}

#chat-input {
    width: 100%;
    border: none;
    padding: 12px;
    border-top: 1px solid #eee;
}

#chatbot-box button {
    width: 100%;
    background: #1CA7A6;
    color: white;
    border: none;
    padding: 12px;
}

.btn-cta {
    margin-left: 30px;
    background: var(--accent);
    color: #003 !important;
    padding: 10px 22px;
    border-radius: 30px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0,229,255,.35);
    transition: 0.3s;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0,229,255,.45);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 120%;
    left: 0;
    background: white;
    border-radius: 14px;
    min-width: 220px;
    box-shadow: 0 20px 40px rgba(0,0,0,.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.3s;
    overflow: hidden;
    z-index: 1000;
}

.dropdown-menu a {
    display: block;
    padding: 14px 18px;
    color: var(--primary);
    margin: 0;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ===== HERO SAAS ===== */
.hero-saas {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 120px 40px 100px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,.15);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    margin-bottom: 20px;
}

.hero-saas h1 {
    font-size: 44px;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-saas h1 span {
    color: var(--accent);
}

.hero-saas p {
    font-size: 18px;
    opacity: 0.95;
    max-width: 520px;
}

.hero-actions {
    margin-top: 30px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-primary-lg {
    background: var(--accent);
    color: #003;
    padding: 16px 34px;
    border-radius: 40px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(0,229,255,.4);
    transition: 0.3s;
}

.btn-primary-lg:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(0,229,255,.55);
}

.btn-secondary-lg {
    border: 2px solid rgba(255,255,255,.6);
    color: white;
    padding: 14px 32px;
    border-radius: 40px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s;
}

.btn-secondary-lg:hover {
    background: rgba(255,255,255,.15);
}

.hero-trust {
    margin-top: 25px;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 14px;
    opacity: 0.9;
}

/* ===== CONTACT PAGE ===== */
.contact-wrapper {
    max-width: 1100px;
    margin: auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
}

.contact-form {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.contact-form h2 {
    margin-bottom: 10px;
    color: var(--primary);
}

.form-note {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 15px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary);
}

.contact-info h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

.contact-info ul {
    padding-left: 18px;
    line-height: 1.8;
}

.contact-box {
    margin-top: 25px;
    background: var(--bg-light);
    padding: 20px;
    border-radius: 14px;
    font-size: 15px;
}

/* ===== PROJECTS ===== */
.project-grid {
    max-width: 1100px;
    margin: auto;
}

.project-card {
    position: relative;
}

.project-tag {
    position: absolute;
    top: 18px;
    right: 18px;
    background: var(--accent);
    color: #003;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
}

.project-card ul {
    padding-left: 18px;
    line-height: 1.6;
    margin: 15px 0;
}

.project-meta {
    font-size: 14px;
    color: #555;
    margin-top: 10px;
}

.hero-visual {
    max-width: 520px;
    width: 100%;
    position: relative;
}

.hero-swiper {
    width: 100%;
}

.hero-swiper .swiper-slide {
    position: relative;
    display: flex;
    justify-content: center;
}

.hero-swiper img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Caption */
.slide-caption {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    padding: 18px;
    border-radius: 16px;
    color: #fff;
    animation: fadeUp 0.6s ease;
}

.slide-caption h3 {
    font-size: 20px;
    margin-bottom: 6px;
}

.slide-caption p {
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.btn-slide {
    display: inline-block;
    padding: 8px 16px;
    background: #4f46e5;
    color: #fff;
    border-radius: 999px;
    font-size: 14px;
    text-decoration: none;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Pagination */
.hero-swiper .swiper-pagination-bullet {
    background: #ddd;
    opacity: 1;
}
.hero-swiper .swiper-pagination-bullet-active {
    background: #4f46e5;
}

/* Navigation */
.hero-swiper .swiper-button-next,
.hero-swiper .swiper-button-prev {
    color: #fff;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-visual {
        margin-top: 30px;
    }

    .slide-caption {
        font-size: 13px;
        padding: 14px;
    }
}

@media (max-width: 768px) {
    .slide-caption {
        font-size: 13px;
        padding: 14px;
    }

    .hero-visual {
        margin-top: 30px;
    }

    .hero-saas {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 100px 20px 80px;
    }

    .hero-saas p {
        margin: 0 auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-visual img {
        margin: 40px auto 0;
        max-width: 360px;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

/* MOBILE MENU FIX */
@media (max-width: 480px) {
    .slide-caption {
        font-size: 13px;
        padding: 14px;
    }

    .hero-visual {
        margin-top: 30px;
    }

    header {
        padding: 14px 20px;
    }

    header.scrolled {
        background: rgba(11, 60, 93, 0.85);
    }

    .menu-toggle {
        display: block;
        z-index: 1001;
    }

    nav {
        display: none; /* 🔥 DÒNG QUAN TRỌNG NHẤT */
        position: absolute;
        top: 80px;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        width: 92%;
        background: white;
        border-radius: 18px;
        box-shadow: 0 25px 50px rgba(0,0,0,.25);
        flex-direction: column;
        padding: 15px 0;
        opacity: 0;
        visibility: hidden;
        transition: all 0.35s ease;
    }

    nav.active {
        display: flex; /* 🔥 BẮT BUỘC */
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    nav a {
        color: var(--primary);
        margin: 10px 0;
        font-size: 16px;
        font-weight: 600;
        padding: 12px 0;
        width: 100%;
        text-align: center;
        transition: background 0.2s;
    }

    nav a:hover {
        background: var(--bg-light);
    }

    nav a.active {
        color: var(--accent);
    }

    nav a.active::after {
        width: 100%;
    }

    .hero {
        padding: 50px 20px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero-saas h1 {
        font-size: 30px;
    }

    .hero-saas p {
        font-size: 16px;
    }

    .section {
        padding: 50px 20px;
    }

    #chatbot-box {
        width: 95%;
        right: 2.5%;
        bottom: 150px;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        background: transparent;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    .btn-cta {
        margin: 12px auto 0;
        display: inline-block;
    }
}

/* ===== FIX HERO FULL WIDTH MOBILE (FINAL) ===== */
@media (max-width: 768px) {

    body {
        overflow-x: hidden;
    }

    .hero-saas {
        width: 100%;
        padding: 0;
        margin: 0;
        display: block;
    }

    .hero-content {
        padding: 90px 20px 30px;
        text-align: center;
    }

    .hero-visual {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .hero-swiper {
        width: 100%;
        height: auto;
    }
    .hero-swiper img {
        width: 100%;
        height: auto;
        object-fit: contain; /* 🔥 QUAN TRỌNG */
    }
}

