/* DÁN BỘ MÀU TỪ COLOR GENERATOR VÀO ĐÂY */
:root {
    --color-primary: #556B2F;
    --color-secondary: #374224;
    --color-accent: #D2B48C;
    --color-primary-light: #718e3f;
    --color-primary-dark: #39481f;
    --color-bg: #fafbf9;
    --color-bg-secondary: #ffffff;
    --color-bg-tertiary: #f5f6f3;
    --color-text: #1a1c17;
    --color-text-muted: #686e5e;
    --color-border: #e6e8e3;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-accent-text: #9b6927;

    --color-primary-rgb: 85, 107, 47;
    --color-secondary-rgb: 55, 66, 36;
    --color-accent-rgb: 210, 180, 140;
    --color-primary-light-rgb: 113, 142, 63;
    --color-primary-dark-rgb: 57, 72, 31;
    --color-accent-text-rgb: 155, 105, 39;
    
    --font-family-base: 'Be Vietnam Pro', sans-serif;
    --border-radius: 12px;
    --transition-smooth: 0.3s ease;
}

/* BASE STYLES & NEW CONTAINED LAYOUT */
body { 
    font-family: var(--font-family-base); 
    background: var(--color-bg); 
    color: var(--color-text); 
    line-height: 1.7; 
}
.main-container { 
    display: flex; 
    max-width: 1600px;
    margin: 0 auto;
    background: var(--color-bg);
}
.main-content { flex: 1; margin-left: 320px; }
.content-section { padding: 6rem 0; }
.section-container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.loading-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--color-bg); display: flex; align-items: center; justify-content: center; z-index: 9999; transition: opacity 0.5s ease-out; }
.loading-content .spinner-border { color: var(--color-warning) !important; }

/* SIDEBAR */
.sidebar { 
    width: 320px; 
    background: var(--color-bg-secondary); 
    border-right: 1px solid var(--color-border); 
    position: fixed; 
    height: 100vh; 
    display: flex; 
    flex-direction: column; 
    padding: 1.5rem; 
    transition: var(--transition-smooth);
    overflow-y: auto;
}
.sidebar-header { 
    border-bottom: 1px solid var(--color-border); 
    padding-bottom: 1.5rem; 
    flex-shrink: 0; 
}
.profile-section { text-align: center; }
.profile-img-container { position: relative; display: inline-block; }
.profile-img { width: 100px; height: 100px; border-radius: 50%; border: 3px solid var(--color-primary); object-fit: cover; }
.status-dot { position: absolute; bottom: 8px; right: 8px; width: 15px; height: 15px; background: var(--color-success); border: 2px solid var(--color-bg-secondary); border-radius: 50%; }
.profile-name { font-size: 1.2rem; font-weight: 700; margin-top: 0.75rem; }
.profile-slogan { font-size: 0.9rem; color: var(--color-accent-text); font-weight: 500; }
.contact-cards { display: flex; flex-direction: column; /*gap: 0.5rem;*/ margin-top: 1.5rem; }
.contact-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem; }
.contact-card i {
    color: var(--color-primary);
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}
.contact-text { text-align: left; }
.contact-text small {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: block;
}
.contact-text a, .contact-text span {
    font-size: 0.9rem;
    color: var(--color-text);
    text-decoration: none;
    word-break: break-all;
}
.download-cv-btn { display: flex; align-items: center; justify-content: center; gap: 0.5rem; text-align: center; background: var(--color-primary); color: white; padding: 0.75rem; margin-top: 1.5rem; border-radius: 8px; font-weight: 600; text-decoration: none; transition: var(--transition-smooth); }
.download-cv-btn:hover { background: var(--color-primary-dark); }
.sidebar-menu { 
    list-style: none; 
    margin: 1.5rem 0;
    padding: 0; 
}
.nav-item { display: flex; align-items: center; padding: 0.75rem; color: var(--color-text-muted); text-decoration: none; border-radius: 8px; transition: var(--transition-smooth); }
.nav-item:hover, .nav-item.active { background: rgba(var(--color-primary-rgb), 0.1); color: var(--color-text); }
.nav-icon { width: 32px; text-align: center; font-size: 1.1rem; }
.nav-text { margin-left: 0.75rem; }
.scroll-progress { 
    margin-top: auto; 
    padding-top: 1.5rem;
    flex-shrink: 0; 
}
.progress-track { width: 100%; height: 4px; background: var(--color-border); }
.progress-fill { height: 100%; background: var(--color-primary); width: 0%; }

/* HERO SECTION V3 */
.hero-section { min-height: 65vh; display: flex; align-items: center; justify-content: center; text-align: center; position: relative; overflow: hidden; }
.hero-grid-animation { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: linear-gradient(to right, var(--color-border) 1px, transparent 1px), linear-gradient(to bottom, var(--color-border) 1px, transparent 1px); background-size: 40px 40px; animation: pan-grid 20s linear infinite; opacity: 0.2; }
@keyframes pan-grid { from { background-position: 0 0; } to { background-position: -40px -40px; } }
.hero-container { position: relative; z-index: 1; }
.hero-title { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; }
.hero-tagline { font-size: clamp(1.2rem, 3vw, 1.5rem); color: var(--color-primary-light); font-weight: 500;}
.hero-subtitle { min-height: 2.2rem; font-size: clamp(1rem, 2.5vw, 1.2rem); color: var(--color-text-muted); }
.hero-cta-buttons { margin-top: 2rem; display: flex; justify-content: center; gap: 1rem; }
.btn-cta { padding: 0.8rem 2rem; border-radius: 50px; text-decoration: none; font-weight: 600; transition: var(--transition-smooth); border: 1px solid transparent; display: inline-flex; align-items: center; gap: 0.5rem; }
.btn-cta.primary { background: var(--color-primary); color: white; }
.btn-cta.primary:hover { background: var(--color-primary-dark); transform: translateY(-3px); box-shadow: 0 4px 15px rgba(var(--color-primary-rgb), 0.3); }
.btn-cta.secondary { background: rgba(var(--color-primary-rgb), 0.1) !important; color: var(--color-primary-light); border-color: var(--color-border); }
.btn-cta.secondary:hover { background: var(--color-primary) !important; color: white; border-color: var(--color-primary); }
.hero-philosophy {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    max-width: 650px;
    margin: 1.5rem auto 0;
    font-style: italic;
}

/* SECTIONS (COMPETENCIES, PROJECTS, CONTRIBUTIONS) */
#competencies, #experience, #projects, #testimonials, #contact { background-color: var(--color-bg-secondary); }
#competencies { background-color: var(--color-bg); }

.section-header { text-align: center; margin-bottom: 4rem; }
.section-number { display: inline-block; background: var(--color-secondary); color: white; padding: 0.25rem 0.75rem; border-radius: 50px; font-size: 0.8rem; }
.section-title { font-size: 2.5rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 1rem;}
.section-title i { color: var(--color-primary); }
.section-subtitle { font-size: 1.1rem; color: var(--color-text-muted); max-width: 600px; margin: 0.5rem auto 0; }
.subsection-header { margin-bottom: 2.5rem; display: flex; align-items: center; justify-content: center; }
.subsection-header:not(:first-child) { margin-top: 5rem; }
.subsection-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: inline-flex; /* Use inline-flex for centering */
    align-items: center;
    gap: 0.75rem;
}
.subsection-header h3 i {
    color: var(--color-primary);
}
.subsection-header p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    padding-left: calc(1.8rem + 0.75rem); /* Align with text above */
}
.competencies-grid, .contributions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.competency-card, .contribution-card { background: var(--color-bg-tertiary); padding: 2rem; border-radius: var(--border-radius); border: 1px solid var(--color-border); transition: var(--transition-smooth); display: flex; flex-direction: column; text-align: center; }
#skills .competency-card { background: var(--color-bg-secondary); } /* Override for skills section */
.competency-card:hover, .contribution-card:hover { transform: translateY(-10px); border-color: var(--color-primary); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.competency-card .icon, .contribution-card .icon { font-size: 2.5rem; color: var(--color-accent); margin-bottom: 1rem; }
.competency-card h3, .contribution-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.competency-card p, .contribution-card p { font-size: 0.95rem; color: var(--color-text-muted); flex-grow: 1;}
.contribution-card .impact { font-size: 0.9rem; color: var(--color-text-muted); font-style: italic; margin: 1rem 0; }
.contribution-card .btn-cta { margin-top: auto; background: transparent; border: 1px solid var(--color-border); color: var(--color-text);}
.contribution-card .btn-cta:hover { background: var(--color-accent); border-color: var(--color-accent); color: white; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; }
.project-card { background: var(--color-bg-secondary); border-radius: var(--border-radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; border: 1px solid var(--color-border); }
.project-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.2); border-color: var(--color-primary); }
.project-thumbnail-wrapper { position: relative; }
.project-card img { width: 100%; height: 220px; object-fit: cover; }
.project-card .role-tag { position: absolute; top: 1rem; left: 1rem; background: rgba(0,0,0,0.5); color: white; padding: 0.25rem 0.75rem; border-radius: 50px; font-size: 0.8rem; backdrop-filter: blur(4px); }
.project-content { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.project-card .hook-metric { font-size: 0.9rem; font-weight: 600; color: var(--color-accent-text); }
.project-card h3, .project-card .project-subtitle { margin-bottom: 0.5rem; }
.project-card-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.tech-tags-preview { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tech-tags-preview .tech-tag-sm { background: var(--color-bg); padding: 0.2rem 0.5rem; font-size: 0.75rem; border-radius: 4px; }
.skills-subheader {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-top: 3rem;
    margin-bottom: 2rem;
    position: relative;
}
.skills-subheader:first-of-type {
    margin-top: 0;
}
.skills-subheader::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--color-primary);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.competencies-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }

/* REFINED: Skills Section Layout - Final Version */
.skills-grid {
    /* The main container for the whole skills block */
    background-color: var(--color-bg-secondary);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);

    /* The two-column layout */
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 2.5rem; /* Gap between the columns */
}

.skill-group h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--color-text);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.75rem;
}

.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    /* This is NOT centered, allowing for natural left-alignment */
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: default;
    transition: var(--transition-smooth);
}
.skill-tag:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(var(--color-primary-rgb), 0.2);
}
.skill-tag i {
    color: var(--color-primary-light);
    transition: var(--transition-smooth);
}
.skill-tag:hover i {
    color: white;
}

/* EXPERIENCE TIMELINE V3 */
.experience-timeline { position: relative; max-width: 800px; margin: 0 auto; }
.experience-timeline::before { content: ''; position: absolute; left: 15px; top: 0; bottom: 0; width: 2px; background: var(--color-border); }
.timeline-item { position: relative; padding-left: 45px; padding-bottom: 3rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: 8px; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--color-primary); border: 3px solid var(--color-bg-secondary); }
.timeline-period { font-size: 0.85rem; color: var(--color-text-muted); }
.timeline-position { font-size: 1.2rem; font-weight: 600; }
.timeline-company { font-size: 1rem; color: var(--color-secondary); }
.timeline-achievements { list-style: none; padding: 0; margin-top: 0.75rem; }
.timeline-achievements li { position: relative; padding-left: 20px; font-size: 0.95rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.timeline-achievements li::before { content: '\f058'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: var(--color-success); position: absolute; left: 0; top: 2px; }

/* TESTIMONIALS SECTION */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.testimonial-card {
    background: var(--color-bg-secondary);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    text-align: left;
}
.testimonial-quote {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    font-style: italic;
    flex-grow: 1;
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1.5rem;
}
.testimonial-quote::before {
    content: '\f10d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--color-primary-light);
    font-size: 2rem;
    position: absolute;
    left: 0;
    top: -0.5rem;
    opacity: 0.5;
}
.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    text-decoration: none; /* Make author section a link */
    transition: var(--transition-smooth);
}
.testimonial-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}
.testimonial-author:hover {
    opacity: 0.8;
}
.testimonial-author-info .name {
    font-weight: 700;
    color: var(--color-text);
}
.testimonial-author-info .title {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* NEW: Contact Grid Section */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}
.contact-method-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition-smooth);
}
.contact-method-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
.contact-method-card .icon {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}
.contact-method-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.contact-method-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}
.contact-method-card .btn-cta-contact {
    display: inline-block;
    text-decoration: none;
    background: var(--color-primary-light);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition-smooth);
}
.contact-method-card .btn-cta-contact:hover {
    background: var(--color-primary-dark);
}

/* FOOTER */
.footer-section { background: var(--color-bg-tertiary); padding: 4rem 0 2rem; text-align: center; border-top: 1px solid var(--color-border); }
.footer-text h3 { font-size: 1.8rem; }
.footer-email { color: var(--color-primary-light); text-decoration: none; }
.social-links-footer { display: flex; justify-content: center; gap: 1rem; margin: 2rem 0; }
.social-links-footer .social-link { font-size: 1.5rem; color: var(--color-text-muted); text-decoration: none; }
.social-links-footer .social-link:hover { color: var(--color-primary); }
.footer-bottom { border-top: 1px solid var(--color-border); padding-top: 1.5rem; margin-top: 2rem; }

/* MODAL V3 */
.modal {
    padding-right: 0 !important;
}
.modal.fade .modal-dialog {
    transition: transform .3s ease-out;
    transform: translate(0, -50px);
}
.modal.show .modal-dialog {
    transform: none;
}
.modal-content { 
    background: var(--color-bg-secondary); 
    border: 1px solid var(--color-border); 
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.modal-header { border-bottom-color: var(--color-border); flex-shrink: 0; }
.modal-title { font-size: 1.5rem; font-weight: 700; }
.btn-close { filter: invert(0.5) grayscale(1); }
.modal-body { 
    padding: 1.5rem 2rem; 
    overflow-y: auto;
}
.modal-content-grid { display: grid; grid-template-columns: 320px 1fr; gap: 2rem; }
.modal-sidebar .modal-thumbnail { width: 100%; border-radius: var(--border-radius); margin-bottom: 1.5rem; }
.modal-info-card { background: var(--color-bg); padding: 1rem; border-radius: var(--border-radius); margin-bottom: 1.5rem; }
.modal-info-card h6 { font-size: 0.9rem; font-weight: 600; color: var(--color-primary-light); }
.modal-summary-desc { font-size: 0.9rem; color: var(--color-text-muted); }
.tech-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tech-tag { background: var(--color-bg-secondary); border: 1px solid var(--color-border); padding: 0.25rem 0.75rem; border-radius: 5px; font-size: 0.8rem; }
.modal-links { display: flex; gap: 1rem; }
.modal-links a { flex: 1; text-align: center; padding: 0.75rem; border-radius: 8px; text-decoration: none; font-weight: 600; background: var(--color-primary); color: white; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;}
.modal-main .modal-section { margin-bottom: 2rem; }
.modal-main .modal-section:last-child { margin-bottom: 0; }
.modal-main .modal-section h6 { color: var(--color-accent-text); font-size: 1.1rem; }
.impact-dashboard { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.impact-card { background: var(--color-bg); padding: 1rem; border-radius: 8px; text-align: center; border: 1px solid var(--color-border); }
.impact-card .value { font-size: 1.5rem; font-weight: 700; color: var(--color-primary); }
.impact-card .label { font-size: 0.8rem; color: var(--color-text-muted); }
#modalChallengeSolution h5 { color: var(--color-primary-light); margin-top: 1.5rem; font-size: 1rem;}
#modalLessonsLearned { font-style: italic; color: var(--color-text-muted); background: var(--color-bg); padding: 1rem; border-left: 3px solid var(--color-primary); }
#modalCarousel .carousel-inner { border-radius: 8px; }
#modalCarousel .carousel-item img { height: 400px; object-fit: cover; }

/* SKILLS SECTION - TAG CLOUD */
.skills-tag-cloud {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.skill-group h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text);
    text-align: center;
}
.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}
.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: default;
    transition: var(--transition-smooth);
}
.skill-tag:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(var(--color-primary-rgb), 0.2);
}
.skill-tag i {
    color: var(--color-primary-light);
    transition: var(--transition-smooth);
}
.skill-tag:hover i {
    color: white;
}

/* RESPONSIVE & UTILITIES */
@media (max-width: 1200px) { 
    .main-content { 
        margin-left: 0;
        padding: 0 1rem;
    } 
    .sidebar { transform: translateX(-100%); z-index: 1050; } 
    .sidebar.active { transform: translateX(0); } 
    .main-container {max-width: 100%;}
    .section-container { padding: 0; }
}
@media (max-width: 992px) { 
    .competencies-grid, .contributions-grid, .modal-content-grid, .testimonials-grid { grid-template-columns: 1fr; } 
    .impact-dashboard { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } 
}
@media (max-width: 767px) {
    /* Make skills grid stack vertically on smaller screens */
    .skills-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 480px) {
    .section-title { font-size: 2rem; }
    .subsection-header h3 { font-size: 1.5rem; }
}
.mobile-nav-toggle { display: none; position: fixed; top: 1rem; right: 1rem; z-index: 1051; background: var(--color-primary); border: none; width: 45px; height: 45px; color: white; border-radius: 8px;}
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1040; backdrop-filter: blur(4px); }
.sidebar-overlay.active { display: block; }