/* Reset và Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #34009c;
    --secondary-color: #2e1aa1;
    --accent-color: #ebd827;
    --text-primary: #0f1721;
    --text-secondary: #3f598e;
    --bg-primary: #8a70ff;
    --bg-secondary: #f3f4f6;
    --border-color: #6a00e2;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-image: linear-gradient(135deg, #eef2f3 0%, #dbe5e7 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-block {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 768px) {
    .content-block:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }
}

/* --- NÂNG CẤP BẮT ĐẦU TẠI ĐÂY --- */

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0; /* Giữ padding bình thường */
    min-height: 50px; /* Đảm bảo thanh nav có đủ chiều cao tối thiểu */
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: flex-end; /* Đẩy menu qua phải */
    align-items: center;
    position: relative; /* Làm điểm neo cho logo */
    height: 100%;
}

/* CSS cho logo lớn, "gối" lên navbar */
.nav-logo {
    position: absolute; /* Tách logo ra khỏi luồng */
    left: 40px; /* Khoảng cách từ lề trái. Bạn có thể thay đổi số này */
    top: 3px; /* Đẩy logo xuống 5px từ đỉnh navbar, tạo hiệu ứng gối lên */
    z-index: 1001; /* Đảm bảo logo luôn nằm trên cùng */
    transition: transform 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.1);
}

.nav-logo img {
    height: 110px; /* Chiều cao mới của logo, to hơn chiều cao navbar */
    width: auto;
    display: block;
    /* Sử dụng drop-shadow để tạo bóng cho ảnh PNG trong suốt, đẹp hơn box-shadow */
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

/* --- KẾT THÚC NÂNG CẤP --- */


.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.4s ease;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    color: white;
    padding-top: 100px; /* Tăng padding để nội dung không bị che */
    background-image: url('https://images.pexels.com/photos/924824/pexels-photo-924824.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.9) 100%);
    z-index: 1;
}

.hero-container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.highlight {
    color: var(--accent-color);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    border: 2px solid var(--accent-color);
}

.btn-primary:hover {
    background-color: #d97706;
    border-color: #d97706;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 7px 20px rgba(0,0,0,0.25);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--primary-color);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 7px 20px rgba(255,255,255,0.2);
}

.profile-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transform: perspective(1000px) rotateY(-10deg);
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-card:hover {
    transform: perspective(1000px) rotateY(0deg);
}

.profile-avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto;
    overflow: hidden;
    border: 5px solid var(--accent-color);
    box-shadow: 0 0 20px var(--accent-color);
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.profile-avatar:hover img {
    transform: scale(1.1);
}

.about, .skills, .projects, .contact {
    padding: 50px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.skill-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.skill-card-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 12px;
}

.skill-card-text h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.skill-card-text p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    height: 200px;
    overflow: hidden;
}
.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease-out;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.btn-project {
    flex-grow: 1;
    text-align: center;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-project i {
    margin-right: 8px;
}

.btn-live {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-live:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-github {
    background-color: #333;
    color: white;
    border-color: #333;
}

.btn-github:hover {
    background-color: #000;
    border-color: #000;
    transform: translateY(-2px);
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contact-text p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.contact-form {
    padding: 0;
    box-shadow: none;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.form-result {
    margin-top: 1rem;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    display: none;
}

/* Footer */
.footer {
    background-color: var(--text-primary);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 50px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-block {
        padding: 1.5rem;
    }

    .hero-container,
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-title { font-size: 2.5rem; }
    .hero-buttons { justify-content: center; }
    .profile-card { transform: perspective(1000px) rotateY(0deg); margin: 0 auto; }
    
    .nav-menu { 
        display: none; 
    }

    .nav-container {
        justify-content: center;
    }

    /* Nâng cấp responsive cho logo */
    .nav-logo {
        position: static; /* Trả logo về luồng bình thường */
        margin-top: 0; /* Reset margin */
    }

    .nav-logo img {
        height: 60px; /* Giảm kích thước logo trên mobile */
    }
    
    .navbar {
        padding: 1rem 0;
        min-height: auto;
    }

    .skills-grid, .projects-grid { grid-template-columns: 1fr; }
    
    .skill-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    .project-buttons {
        flex-direction: column;
    }
}