/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Variables */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --light-color: #f4f4f4;
    --dark-color: #333;
    --max-width: 1200px;
}

/* Utilities */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.highlight {
    color: var(--primary-color);
}

/* Header & Navigation */
header {
    background-color: var(--secondary-color);
    color: #fff;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 5px;
    transition: all 0.3s ease;
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: var(--light-color);
    padding-top: 60px;
}

#hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

#hero p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.cta-button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #2980b9;
}

/* Sections */
section {
    padding: 80px 0;
}

section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
    position: relative;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background-color: var(--primary-color);
}

/* About Section */
.about-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-text, .about-image {
    flex: 1;
}

.profile-placeholder {
    width: 300px;
    height: 300px;
    background-color: #ddd;
    border-radius: 50%;
    margin: 0 auto;
}

/* Skills Section */
#skills {
    background-color: var(--light-color);
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.skill-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.skill-bar {
    width: 100%;
    height: 20px;
    background-color: #ddd;
    border-radius: 10px;
    margin-top: 10px;
    overflow: hidden;
}

.skill-level {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 10px;
    position: relative;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-image {
    height: 200px;
    background-color: #ddd;
}

.project-card h3 {
    padding: 15px 15px 0;
}

.project-card p {
    padding: 10px 15px;
}

.project-links {
    padding: 0 15px 15px;
}

.project-link {
    display: inline-block;
    padding: 5px 10px;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.project-link:hover {
    background-color: #2980b9;
}

/* Contact Section */
#contact {
    background-color: var(--light-color);
}

.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.contact-info, .contact-form {
    background-color: #fff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.submit-button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background-color: #2980b9;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: #fff;
    text-align: center;
    padding: 20px 0;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .nav-links {
        position: absolute;
        right: 0;
        height: 92vh;
        top: 8vh;
        background-color: var(--secondary-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 50%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        z-index: 1;
    }
    
    .nav-links li {
        margin: 20px 0;
    }
    
    .burger {
        display: block;
    }
    
    .nav-active {
        transform: translateX(0%);
    }

    .about-content {
        flex-direction: column;
    }

    .about-text, .about-image {
        width: 100%;
    }
}

/* Animation Class */
.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.toggle .line2 {
    opacity: 0;
}

.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Skill Level Animation */
@keyframes fillBar {
    from {
        width: 0;
    }
    to {
        width: var(--level);
    }
}

/* Canvas Item */
.canvas-item {
    position: absolute;
    min-width: 100px;
    min-height: 40px;
    padding: 8px;
    background-color: #fff;
    border: 1px solid #ccc;
    cursor: move;
    user-select: none;
}

.canvas-item.selected {
    border: 2px solid #007bff;
    z-index: 1000;
}

.canvas-item input,
.canvas-item textarea {
    pointer-events: none;
    width: 100%;
    border: 1px solid #ddd;
    padding: 5px;
}

.canvas-item.edit-mode {
    cursor: default;
}

.canvas-item.edit-mode input,
.canvas-item.edit-mode textarea {
    pointer-events: auto;
    cursor: text;
}

.canvas-item .drag-handle {
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-bottom: none;
    cursor: move;
    display: none;
}

.canvas-item.selected .drag-handle {
    display: block;
}

.canvas-item * {
    pointer-events: none;
}

.canvas-item .resize-handle {
    pointer-events: auto;
}

.canvas-item.dragging {
    opacity: 0.8;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.canvas-item:hover {
    outline: 1px dashed #007bff;
}

@media screen and (max-width: 768px) {
    .nav-links {
        position: fixed; /* Thay đổi từ absolute thành fixed */
        right: 0;
        height: 100vh; /* Thay đổi từ 92vh thành 100vh */
        top: 60px; /* Điều chỉnh từ 8vh thành giá trị cố định */
        background-color: var(--secondary-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 50%;
        transform: translateX(100%);
        transition: transform 0.3s ease-in; /* Giảm thời gian transition */
        z-index: 999; /* Tăng z-index */
        padding-top: 20px; /* Thêm padding */
    }
    
    /* Thêm style rõ ràng cho trạng thái active */
    .nav-active {
        transform: translateX(0%) !important;
        box-shadow: -5px 0px 15px rgba(0,0,0,0.2);
    }
}

/* Animation cho nav links */
@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}