﻿/* Áp dụng box-sizing cho toàn bộ trang */
* {
    box-sizing: border-box; /* Áp dụng box-sizing để padding và border không làm tràn phần tử */
}

/* Body styling */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden; /* Ngăn cuộn ngang */
    scroll-behavior: smooth;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: #f1f1f1;
    background-color: aliceblue;
}
/* Chỉnh sửa ảnh để có hình tròn và hiệu ứng */
#myImage {
    width: 80%; /* Điều chỉnh kích thước ảnh */
    height: auto; /* Điều chỉnh kích thước ảnh */
    object-fit: cover; /* Đảm bảo ảnh không bị kéo dãn */
    border: 5px solid var(--color, #0B486B); /* Thêm viền cho ảnh, có thể thay đổi màu theo --color */
    transition: transform 0.3s ease; /* Thêm hiệu ứng chuyển động khi hover */
}

    /* Hiệu ứng khi hover vào ảnh */
    #myImage:hover {
        transform: scale(1.1); /* Phóng to ảnh khi hover */
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* Thêm bóng mờ khi hover */
    }

/* Keyframes cho hiệu ứng quay vòng */

/* Media query cho màn hình điện thoại */
/* Media query cho màn hình điện thoại */
/* Media query cho màn hình điện thoại (dưới 768px) */
@media (max-width: 768px) {
  
    #home {
        display: flex;
        flex-direction: column; /* Đổi layout thành cột */
        height: auto;
    }

        /* Đảm bảo left và right chiếm 100% chiều rộng */
        #home .left, #home .right {
            width: 100%; /* Đảm bảo chúng chiếm 100% chiều rộng */
            margin-bottom: 20px; /* Giữ khoảng cách giữa các phần tử */
        }

    

    /* Thay đổi layout cho container của skills */
    .skillsContainer {
        display: flex;
        flex-direction: column; /* Đổi layout thành 1 cột */
        gap: 20px; /* Giữ khoảng cách giữa các phần */
        width: 100%; /* Đảm bảo container chiếm toàn bộ chiều rộng */
    }

    .codingSkills, .otherSkills {
        width: 100%; /* Các phần con chiếm toàn bộ chiều rộng */
        border: none; /* Loại bỏ border */
        padding: 20px;
        box-sizing: border-box;
    }

    /* Loại bỏ các border trái và phải của các phần trong skills */
    .codingSkills {
        border-right: none;
    }

    .otherSkills {
        border-left: none;
    }

    /* Timeline */
    .timeline {
        display: flex;
        flex-direction: column; /* Đặt các item theo cột */
        width: 100%;
        box-sizing: border-box;
        margin: 0;
    }

    .timeline-item {
        width: 100%; /* Mỗi item chiếm toàn bộ chiều rộng */
        box-sizing: border-box;
    }

    .timeline-content {
        box-sizing: border-box;
        background-color: #fff;
        border-radius: 8px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    /* Điều chỉnh font-size cho các phần timeline */
    .timeline-period, .timeline-institution, .timeline-major, .timeline-details {
        font-size: 14px;
    }

    /* Đảm bảo chữ của h1 không quá lớn */
    h1.display-4 {
        font-size: 1.2rem; /* Giảm kích thước chữ cho màn hình nhỏ */
        color: #3258C1; /* Đổi màu cho h1 */
    }

    /* Giảm kích thước chữ cho đoạn văn */
    .intro-text {
        font-size: 14px; /* Giảm kích thước chữ */
    }

    /* Ảnh */

    .typing-container {
        height: 30px; /* Điều chỉnh chiều cao của typing container */
    }
}

/* Media query cho màn hình nhỏ hơn 480px (như các điện thoại nhỏ) */
@media (max-width: 480px) {
    h1.display-4 {
        font-size: 35px; /* Giảm kích thước chữ cho các màn hình rất nhỏ */
    }

    .intro-text {
        font-size: 13px; /* Giảm kích thước chữ */
    }

    .left, .right {
        margin-bottom: 15px; /* Giảm khoảng cách giữa các phần tử */
    }

    .typing-container {
        margin-top: 10px;
    }

    /* Kích thước ảnh nhỏ hơn trên màn hình nhỏ */
    #myImage img {
        width: 120px;
        height: 120px;
        margin-top: 10px; /* Điều chỉnh vị trí ảnh */
    }

    /* Giảm kích thước các phần tử timeline */
    .timeline-period, .timeline-institution, .timeline-major, .timeline-details {
        font-size: 12px; /* Giảm kích thước chữ cho timeline */
    }
}


/* Keyframes cho hiệu ứng chuyển động */
@keyframes roter {
    from {
        transform: rotateY(0deg);
    }

    to {
        transform: rotateY(360deg);
    }
}

@keyframes rotateAnimation {
    0% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(180deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes wave-animation {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: 0 0;
    }
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blinkCaret {
    50% {
        border-color: transparent;
    }
}

/* Navbar styling */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #1e3a4f;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

    nav ul {
        display: flex;
        justify-content: center;
        margin: 0;
        padding: 15px;
        list-style: none;
    }

        nav ul li {
            margin: 0 10px;
        }

            nav ul li a {
                color: white;
                text-decoration: none;
                padding: 5px;
            }

    nav.navbar ul li a:hover {
        color: #fa6900;
    }

/* Home section layout */


/* Skills section */
.skillsContainer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    flex-wrap: wrap; /* Cho phép gói lại khi không đủ không gian */
}

.codingSkills, .otherSkills {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.codingSkills {
    border-right: 2px solid white;
}

.otherSkills {
    border-left: 2px solid white;
}

/* Styling for the typing effect */
.typing {
    font-size: 18px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    border-right: 3px solid #333;
    width: 0;
    animation: typing 4s steps(40) 1s forwards, blinkCaret 0.75s step-end infinite;
    margin: 10px 0;
}

.introText {
    margin-top: 20px;
}

/* Slide-in effect from the left */
.left {
    opacity: 0;
    animation: slideInLeft 1s ease-out forwards;
}

    .left h1, .left p, .left ul {
        opacity: 0;
        transform: translateX(-100px);
        animation: slideInLeft 1s ease-out forwards;
    }

    .left h1 {
        animation-delay: 0.5s;
    }

    .left p {
        animation-delay: 1s;
    }

    .left ul {
        animation-delay: 1.5s;
    }

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Additional styles for images */



/* List styling */
ul {
    list-style-type: none;
    padding-left: 0;
}

    ul li {
        margin-bottom: 10px;
    }

        ul li i {
            margin-right: 10px;
            color: #3258C1;
            font-size: 1.2rem;
        }

/* Home background color */
#home {
    background-color: #1E3A4F;
}

/* Education section */
#education {
    background-color: #091B2D;
}

/* Skills background color */
#skills {
    background-color: #1E3A4F;
}
