* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f4f4f4;
}

/* Sidebar Styles */
.sidebar {
    background: #2c3e50;
    color: white;
    padding: 2rem;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.profile-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: block;
    object-fit: cover;
    border: 3px solid #fff;
}

.basic-info {
    text-align: center;
    margin-bottom: 2rem;
}

.full-name {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.contact-info {
    font-size: 0.9rem;
}

.contact-info p {
    margin: 0.5rem 0;
}

/* Navigation Styles */
nav {
    background: #34495e;
    padding: 1rem;
    margin-bottom: 2rem;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background 0.3s;
}

nav a:hover {
    background: #2c3e50;
}

/* Main Content Styles */
.container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    animation: fadeIn 0.5s ease-out;
}

h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

/* Projects Section Styling */
#projects {
    margin-bottom: 2rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    background: #2a2a2a;
    padding: 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.project-card a {
    text-decoration: none;
}

.project-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.project-card p {
    color: #e0e0e0;
    font-size: 0.9rem;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #projects h2 {
        color: #fff;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        overflow-x: auto;
        gap: 1rem;
        padding: 1rem;
        scroll-snap-type: x mandatory;
    }

    .project-card {
        min-width: 250px;
        scroll-snap-align: start;
    }
}

/* Skills Section */
.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skill-item {
    background: rgba(0, 102, 204, 0.1);
    color: #0066cc;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin: 0.25rem;
    display: inline-block;
    transition: all 0.3s ease;
}

.skill-item:hover {
    background: rgba(0, 102, 204, 0.2);
    transform: translateY(-2px);
}

/* Contact Form */
.contact-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input, textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

textarea {
    resize: vertical;
}

.submit-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    width: 100%;
}

.submit-button:hover {
    background: #2980b9;
}

/* Menu Toggle Button (Mobile) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 20px;
    }

    .menu-toggle {
        display: block;
    }

    .sidebar.active {
        height: auto;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .profile-img {
        width: 150px;
        height: 150px;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        margin: 0.5rem 0;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 1rem;
    }

    section {
        padding: 1.5rem;
    }
}

@media screen and (min-width: 769px) {
    .sidebar {
        position: fixed;
        width: 300px;
        height: 100vh;
        left: 0;
        top: 0;
        overflow-y: auto;
    }

    .main-content {
        margin-left: 300px;
        padding: 20px;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    animation: fadeIn 0.5s ease-out;
}

/* Hover Effects */
input:focus, textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

/* Project Detail Page Styles */
.project-detail {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 2rem;
    transition: background-color 0.3s;
}

.back-button:hover {
    background-color: #e0e0e0;
}

.project-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.project-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.project-info h2 {
    margin: 1.5rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-info h2 i {
    color: #007bff;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.feature-list li i {
    color: #0066cc;
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #0056b3;
}

.btn i {
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .project-content {
        grid-template-columns: 1fr;
    }

    .project-links {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Dark mode support (if your portfolio has dark mode) */
@media (prefers-color-scheme: dark) {
    .back-button {
        background-color: #2a2a2a;
        color: #fff;
    }

    .back-button:hover {
        background-color: #3a3a3a;
    }

    .project-info h2 i {
        color: #4dabf7;
    }

    .feature-list li i {
        color: #40c057;
    }

    .btn {
        background-color: #4dabf7;
    }

    .btn:hover {
        background-color: #339af0;
    }

    .project-card {
        background: #2a2a2a;
        border-color: #404040;
    }

    .project-card:nth-child(1),
    .project-card:nth-child(2),
    .project-card:nth-child(3) {
        background: linear-gradient(135deg, #2a2a2a, #333);
    }

    .project-card a {
        color: #fff;
    }

    .project-card h3 {
        color: #fff;
    }

    .project-card p {
        color: #adb5bd;
    }

    .project-card:hover {
        box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    }
}

/* Project 1 */
.project-1 .btn {
    background: #0066cc;
}

.project-1 .btn:hover {
    background: #0099ff;
}

/* Project 2 */
.project-2 .btn {
    background: #003399;
}

.project-2 .btn:hover {
    background: #0052cc;
}

/* Project 3 */
.project-3 .btn {
    background: #001f66;
}

.project-3 .btn:hover {
    background: #003399;
}

/* Icons in project detail pages */
.project-1 .project-info h2 i {
    color: #0099ff;
}

.project-2 .project-info h2 i {
    color: #0052cc;
}

.project-3 .project-info h2 i {
    color: #003399;
}

/* Projects Grid Layout */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

/* Project Tech Tags */
.project-tech {
    margin-top: 1rem;
}

.project-tech .skill-item {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 15px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Section Title */
.section-title {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title h2 {
    font-size: 2rem;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.section-title h2 i {
    color: #0066cc;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .projects-grid {
        gap: 1rem;
        padding: 1rem;
    }
    
    .project-card {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        overflow-x: auto;
        gap: 1rem;
        padding: 1rem;
        scroll-snap-type: x mandatory;
    }

    .project-card {
        scroll-snap-align: start;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .section-title h2 {
        color: #fff;
    }
    
    .section-title h2 i {
        color: #0099ff;
    }
}

/* Section Headings - Unified color scheme */
section h2 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

section h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background: #2c3e50;
}

/* About section */
#about h2 {
    color: #1B2B4B;  /* Navy blue đậm */
}

#about h2::after {
    background: #1B2B4B;
}

/* Projects section */
#projects h2 {
    color: #233B6E;  /* Navy blue trung bình */
}

#projects h2::after {
    background: #233B6E;
}

/* Skills section */
#skills h2 {
    color: #2B4C8C;  /* Navy blue nhạt hơn */
}

#skills h2::after {
    background: #2B4C8C;
}

/* Contact section */
#contact h2 {
    color: #345DA7;  /* Navy blue sáng */
}

#contact h2::after {
    background: #345DA7;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    #about h2 {
        color: #4A6FA5;  /* Navy blue sáng hơn */
    }

    #projects h2 {
        color: #5B82B3;  /* Navy blue nhạt */
    }

    #skills h2 {
        color: #6B94C1;  /* Navy blue rất nhạt */
    }

    #contact h2 {
        color: #7BA6CF;  /* Navy blue pastel */
    }
}

/* Project Cards */
.project-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    section h2 {
        color: #a3c1d9;  /* Phiên bản sáng hơn của #2c3e50 */
    }

    section h2::after {
        background: #a3c1d9;
    }

    .project-card h3 {
        color: #a3c1d9;
    }
}

.container section h2 {
    color: #4A76C7;  /* Hoặc màu mà bạn muốn sử dụng */
    font-weight: bold;
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.education-date {
    color: #666;  /* màu xám nhạt hoặc màu khác tùy bạn chọn */
    font-size: 0.9em;
}

.education-item h3 {
    margin: 0;  /* loại bỏ margin mặc định */
}

.education-date, 
.education-item p {
    font-style: italic;
}

.info-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 25px;
    height: 25px;
    background-color: #333;  /* Màu tối để phù hợp với theme */
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.info-button:hover {
    background-color: #555;
    transform: scale(1.1);
}

.info-popup {
    position: fixed;
    bottom: 55px;
    right: 20px;
    background-color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: none;
    z-index: 1000;
    font-size: 14px;
    color: #333;
    border: 1px solid #eee;
}

.info-button:hover + .info-popup {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
