/* General Styles */
body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: #212121;
    color: #fff;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header Styles */
header {
    background: url('../images/header-bg.jpg') no-repeat center center/cover;
    color: #fff;
    width: 100%;
    padding: 50px 20px 0px 20px;
    position: relative;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: background 0.3s, box-shadow 0.3s;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 3.5em;
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: fadeIn 1s ease-in-out;
    color: #fff;
}

header p {
    font-size: 1.5em;
    margin: 0 10px 40px 10px;
    animation: fadeIn 1.5s ease-in-out;
    color: #fff;
}

nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    animation: fadeIn 2s ease-in-out;
}

nav ul li {
    display: inline;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.3em;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background 0.3s;
}

nav ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Section Styles */
.section {
    width: 100%;
    padding: 60px 20px;
    text-align: center;
    background: #212121;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
}

.section:hover {
    background-color: #222222;
}

/* About Section */
#about h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.8em;
    margin-bottom: 15px;
    animation: slideInLeft 1s ease-in-out;
    color: #fff;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    animation: slideInRight 1s ease-in-out;
    font-size: 1em;
    line-height: 1.6;
    background: #1f1f1f;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.about-content h2 {
    color: #ddd;
}

.about-content p {
    margin: 20px;
    font-size: 1.1em;
    color: #ddd;
    text-align: justify;
}

.profile-image {
    width: 260px; /* Điều chỉnh kích thước */
    height: auto; /* Đảm bảo tỉ lệ khung hình bảo toàn */
    float:inline-start;
    margin: 20px; /* Tạo khoảng cách giữa hình ảnh và nội dung */
    border-radius: 10px; /* Bo tròn góc */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Hiệu ứng bóng */
}

/* Projects Section */
#projects {
    text-align: center;
    background-color: #212121;
    padding: 60px 20px;
}

#projects h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.8em;
    margin-bottom: 20px;
    color: #fff;
}

.project-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.project {
    position: relative;
    background: #252525;
    border-radius: 10px;
    padding: 30px;
    width: 450px;
    height: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    cursor: pointer;
    animation: fadeInUp 1s ease-in-out;
    overflow: hidden; /* Ensure content is clipped to bounds */
}

.project img {
    width: 100%;
    height: 60%;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: transform 0.3s;
}

.project:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

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

.project h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8em;
    margin-bottom: 10px;
    color: #ddd;
    transition: opacity 0.3s;
    opacity: 1;
}

.project p {
    font-size: 1.1em;
    color: #ddd;
}

/* Overlay for description */
.project .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.9) 90%);
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    justify-content: center;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    box-sizing: border-box;
}

.project:hover .overlay {
    opacity: 1;
}

.project:hover h3 {
    opacity: 0;
}

.project .overlay p {
    font-size: 1.1em;
    margin-top: 350px;
    text-align: justify;
}

/* Popup Modal */
.popup {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    padding-top: 60px;
}

.popup-content {
    background-color: #171717;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 900px;
    border-radius: 10px;
    text-align: justify;
}

.popup-content h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2em;
    margin-bottom: 15px;
    text-align: center;
    color: #fff;
}

.popup-content img {
    width: 70%;
    display: block;
    border-radius: 10px;
    margin: 15px auto;
    transition: transform 0.3s;
}

.popup-content iframe {
    display: block;
    border-radius: 10px;
    margin: 15px auto;
    transition: transform 0.3s;
}

.popup-content li {
    margin-bottom: 15px;
}

.popup-content .project-links {
    margin-bottom: 15px;
}

.project-link a {
    color: #fff; /* Màu liên kết */
    text-decoration: none; /* Bỏ gạch chân */
    transition: color 0.3s; /* Hiệu ứng chuyển đổi màu khi hover */
}

.project-link a:hover {
    color: #00bcd4; /* Màu khi hover */
}


.popup-content p {
    font-size: 1.1em;
    color: #ddd;
    line-height: 1.6;
}

.popup-content p strong {
    color: #fff;
    font-weight: bold;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: left;
    align-items: center;
    gap: 20px;
}

.project-link img {
    width: 30px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

/* Skills Section */
#skills h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.8em;
    margin-bottom: 20px;
    animation: slideInLeft 1s ease-in-out;
    color: #fff;
}

.skills-container {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center; /* Căn chỉnh các biểu tượng theo chiều dọc */
    flex-wrap: wrap;
    background: #1f1f1f;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.skills-container ul {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 30px;
}

.skills-container ul li img {
    width: 50px; /* Thiết lập kích thước cố định cho tất cả các biểu tượng */
    height: 50px;
    object-fit: contain; /* Giữ nguyên tỷ lệ của biểu tượng */
}

.skills-container ul li {
    position: relative; /* Đảm bảo phần tử con có thể được định vị tuyệt đối */
}

.skills-container ul li .icon-description {
    display: none; /* Mặc định ẩn mô tả alt */
    position: absolute;
    bottom: -20px; /* Điều chỉnh vị trí mô tả alt */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
}

.skills-container ul li:hover .icon-description {
    display: block; /* Hiển thị mô tả alt khi hover */
}

/* Contact Section */
#contact h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.8em;
    margin-bottom: 20px;
    animation: slideInLeft 1s ease-in-out;
    color: #fff;
}

#contact {
    text-align: center;
}

.contact-info {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    background: #1f1f1f;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.contact-item {
    display: flex;
    align-items: center;
}

.contact-item img {
    width: 30px; /* Kích thước biểu tượng */
    height: 30px;
    margin-right: 10px; /* Khoảng cách giữa biểu tượng và liên kết */
}

.contact-item a {
    color: #fff; /* Màu liên kết */
    text-decoration: none; /* Bỏ gạch chân */
    transition: color 0.3s; /* Hiệu ứng chuyển đổi màu khi hover */
}

.contact-item a:hover {
    color: #00bcd4; /* Màu khi hover */
}

/* Footer Styles */
footer {
    background: #111;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    width: 100%;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.1);
}

footer p {
    margin: 0;
    font-size: 1em;
    font-family: 'Montserrat', sans-serif;
    animation: fadeIn 2s ease-in-out;
}

/* Scroll to Top Button */
#scrollToTopBtn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    display: none;
    background: #333;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.3s;
}

#scrollToTopBtn:hover {
    background: #555;
    transform: scale(1.05);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
