/* CSS Variables */
:root {
    --primary-color: #1E3A8A;
    --secondary-color: #22C55E;
    --accent-color: #0bf5f1;
    --text-color: #4B5563;
    --bg-color: #F9FAFB;
    --white: #FFFFFF;
    --light-gray: #f8fafc;
    --border-gray: #e0e7ff;

    --font-size-xs: clamp(12px, 2vw, 14px);
    --font-size-sm: clamp(14px, 2vw, 16px);
    --font-size-base: clamp(16px, 2.5vw, 18px);
    --font-size-lg: clamp(18px, 3vw, 22px);
    --font-size-xl: clamp(24px, 5vw, 36px);
    --font-size-2xl: clamp(24px, 6vw, 48px);

    --spacing-xs: clamp(8px, 1.5vw, 12px);
    --spacing-sm: clamp(16px, 3vw, 24px);
    --spacing-md: clamp(24px, 4vw, 40px);
    --spacing-lg: clamp(40px, 6vw, 60px);
    --spacing-xl: clamp(60px, 8vw, 80px);

    --border-radius: 8px;
    --border-radius-sm: 5px;
    --border-radius-lg: 12px;
    --border-radius-full: 50%;
    --border-radius-pill: 20px;

    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
    --box-shadow-nav: 0 2px 4px rgba(0, 0, 0, 0.1);

    --transition: all 0.3s ease;
    --transition-fast: all 0.2s ease;
}

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

/* Body */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-color);
    line-height: 1.6;
    width: 100%;
    overflow-x: hidden;
}

/* Container - Responsive */
.container {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 40px);
}

/* Skip to content for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--secondary-color);
    color: var(--white);
    padding: var(--spacing-xs);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    z-index: 1000;
    transition: var(--transition-fast);
}

.skip-link:focus {
    top: 6px;
}

/* ==================== NAVIGATION ==================== */
nav {
    background-color: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--box-shadow-nav);
    width: 100%;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem clamp(16px, 4vw, 40px);
    min-height: 80px;
    gap: 30px;
}

/* Logo */
.nav-brand1 img {
    display: none;
}

.nav-brand .logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
    transform: scale(1.8);
}

.nav-brand .logo:hover {
    transform: scale(1.05);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    font-size: 2rem;
    cursor: pointer;
    align-items: left;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-grow: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
}

nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--font-size-sm);
    white-space: nowrap;
    transition: var(--transition);
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

nav a:hover::after {
    width: 100%;
}

nav a:hover {
    color: var(--secondary-color);
}

/* CTA Button */
.nav-cta {
    background-color: var(--secondary-color) !important;
    color: var(--white) !important;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--font-size-sm);
    white-space: nowrap;
    transition: var(--transition);
    border: 2px solid var(--secondary-color);
    margin-left: auto;
}

.nav-cta::after {
    display: none;
}

.nav-cta:hover {
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    position: relative;
    padding-right: 20px;
}

.droptoggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* khoảng cách giữa chữ và dấu ▼ */
    font-weight: bold;
    color: #1d3c84;
    cursor: pointer;
}

.dropdown-icon {
    font-size: 12px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    padding: 10px 0;
    list-style: none;
    margin: 0;
    min-width: clamp(160px, 20vw, 200px);
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    border: 1px solid var(--border-gray);
}

.dropdown:hover .dropdown-menu,
.dropdown-toggle[aria-expanded="true"]+.dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    color: var(--primary-color);
    display: block;
    padding: 8px 16px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    word-break: break-word;
    font-size: var(--font-size-xs);
    transition: var(--transition);
}

.dropdown-menu li a:hover {
    background-color: var(--border-gray);
    border-radius: 4px;
    color: var(--secondary-color);
}

.dropdown-menu li a:focus {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* ==================== HERO SECTION ==================== */
.hero {
    background: linear-gradient(135deg, #561e8a 0%, #2291c5 100%);
    color: var(--white);
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-sm);
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.hero .container {
    width: 100%;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: var(--font-size-base);
    max-width: 600px;
    margin: 0 auto var(--spacing-md);
    line-height: 1.6;
    opacity: 0.95;
}

.cta-button {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: clamp(12px, 2vw, 16px) clamp(20px, 4vw, 32px);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    display: inline-block;
    font-size: var(--font-size-base);
    transition: var(--transition);
    border: 2px solid var(--secondary-color);
}

.cta-button:hover {
    background-color: transparent;
    border-color: var(--white);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==================== COMMON SECTION STYLES ==================== */
.section-common {
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.section-common h2 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-md);
    font-weight: 700;
    color: var(--primary-color);
    position: relative;
}

.section-common h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

.section-common p {
    font-size: var(--font-size-base);
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-color);
    line-height: 1.7;
}

/* Fix anchor scroll offset for sticky navbar */
#about,
#projects,
#process,
#experience {
    scroll-margin-top: clamp(80px, 12vw, 120px);
}

/* ==================== ABOUT SECTION ==================== */
.about {
    background-color: var(--white);
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg) 0 0 0;
}

.skill-item {
    background-color: var(--white);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-pill);
    font-size: var(--font-size-sm);
    color: var(--primary-color);
    border: 2px solid var(--secondary-color);
    transition: var(--transition);
    white-space: nowrap;
    cursor: pointer;
}

.skill-item:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

/* ==================== PROJECTS SECTION ==================== */
.projects {
    background-color: var(--bg-color);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 40vw, 350px), 1fr));
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.project-card {
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: 1px solid transparent;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-lg);
    border-color: var(--secondary-color);
}

.project-card img {
    width: 100%;
    height: clamp(180px, 25vw, 220px);
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover img {
    transform: scale(1.05);
}

.project-card-content {
    padding: var(--spacing-sm);
}

.project-card h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xs);
    color: var(--primary-color);
    font-weight: 600;
}

.project-card p {
    font-size: var(--font-size-sm);
    color: var(--text-color);
    line-height: 1.6;
    text-align: left;
}

/* ==================== PROCESS SECTION ==================== */
.process {
    background-color: var(--white);
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(200px, 30vw, 250px), 1fr));
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.process-item {
    padding: var(--spacing-sm);
    text-align: center;
    transition: var(--transition);
    border-radius: var(--border-radius);
    background-color: transparent;
    border: 2px solid transparent;
}

.process-item:hover {
    transform: translateY(-5px);
    background-color: var(--light-gray);
    border-color: var(--secondary-color);
}

.process-item i {
    font-size: clamp(24px, 5vw, 40px);
    color: var(--secondary-color);
    margin-bottom: var(--spacing-sm);
    transition: var(--transition);
}

.process-item:hover i {
    transform: scale(1.1);
}

.process-item h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xs);
    color: var(--primary-color);
    font-weight: 600;
}

.process-item p {
    font-size: var(--font-size-sm);
    color: var(--text-color);
    line-height: 1.6;
}

/* ==================== EXPERIENCE SECTION ==================== */
.experience {
    background-color: var(--light-gray);
}

.timeline {
    max-width: clamp(800px, 80vw, 900px);
    margin: var(--spacing-md) auto 0;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--secondary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-item {
    margin: 0 0 var(--spacing-md) 0;
    position: relative;
    width: calc(50% - var(--spacing-sm));
    padding: var(--spacing-sm);
    text-align: right;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    margin-left: 0;
}

.timeline-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.timeline-item:nth-child(even) {
    margin-left: calc(50% + var(--spacing-sm));
    text-align: left;
}

/* Dots trên trục thời gian */
.timeline-item::before {
    content: '';
    position: absolute;
    width: clamp(12px, 2vw, 18px);
    height: clamp(12px, 2vw, 18px);
    background-color: var(--secondary-color);
    border-radius: var(--border-radius-full);
    top: clamp(20px, 4vw, 32px);
    right: calc(-1 * clamp(6px, 1vw, 9px) - var(--spacing-sm));
    border: 3px solid var(--white);
    box-shadow: var(--box-shadow);
    z-index: 2;
}

.timeline-item:nth-child(even)::before {
    left: calc(-1 * clamp(6px, 1vw, 9px) - var(--spacing-sm));
    right: auto;
}

.timeline-item h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xs);
    color: var(--primary-color);
    font-weight: 600;
}

.timeline-item p {
    font-size: var(--font-size-sm);
    color: var(--text-color);
    line-height: 1.5;
    margin: 0;
}

/* ==================== CONTACT SECTION ==================== */
.contact {
    padding: var(--spacing-lg) 0;
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    min-height: auto;
}

.contact h2 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

.contact h2::after {
    background-color: var(--white);
}

.contact p {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-md);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.social-links a {
    color: var(--white);
    font-size: clamp(20px, 4vw, 28px);
    text-decoration: none;
    transition: var(--transition);
    padding: var(--spacing-xs);
    border-radius: var(--border-radius);
}

.social-links a:hover {
    color: var(--secondary-color);
    transform: translateY(-3px);
    background-color: rgba(255, 255, 255, 0.1);
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 768px) {

    /* Container column layout */
    nav .container {
        position: relative;
        height: auto;
        padding: 1rem;
        display: flex;
        justify-content: center;
        align-items: center;

    }

    .nav-cta {
        display: none;
    }

    .nav-brand img {
        display: none;
    }

    /* Logo styling */
    .logo-1 {
        width: 120px;
        height: auto;
    }

    /* Hiển thị hamburger button */
    .hamburger {
        display: block;
        position: absolute;
        left: 20px;
        top: 10px;
        z-index: 11;
        font-size: 24px;
        cursor: pointer;
        margin-top: 15px;
    }

    /* Ẩn nav-links ban đầu */
    .nav-menu {
        display: none;
        width: 100%;
    }

    .nav-brand1 {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 300px;
        overflow: hidden;
    }

    .nav-brand1 img {
        max-height: 100%;
        width: auto;
        object-fit: contain;
        display: block;
        transform: scale(3.5);
        margin-top: 15px;
    }

    .nav-menu.active {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 70px;
        left: 0px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        background-color: #ffffff;
        align-items: flex-start;
        text-align: left;
        padding: 20px 20px;
        z-index: 9;
    }

    .nav-links a {
        padding: 10px 0;
        font-size: 16px;
    }

    /* Dropdown điều chỉnh cho mobile */
    .dropdown {
        position: relative;
    }

    .dropdown-menu {
        display: none;
        flex-direction: column;
        background-color: #f9f9f9;
        padding-left: 1rem;
        margin-top: 5px;
    }

    .dropdown:hover .dropdown-menu,
    .dropdown:focus-within .dropdown-menu {
        display: flex;
    }

    /* Logo bên phải (logo-2) ẩn trên mobile */
    .logo-2 {
        display: none;
    }
}