/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #040d21;
    --bg-secondary: rgba(6, 15, 36, 0.4); /* Glassmorphism base */
    --bg-tertiary: rgba(10, 25, 47, 0.6); /* Glassmorphism elevated */
    --text-primary: #e6f1ff;
    --text-secondary: #8892b0;
    --accent-green: #64ffda;
    --accent-blue: #00f2fe;     /* Tương tự vòng hào quang */
    --accent-purple: #9d4edd;
    --accent-orange: #ffbb77;   /* Tương tự lõi sao già */
    --accent-red: #ff4b4b;
    --accent-pink: #f72585;
    --accent-cyan: #4facfe;     /* Cùng tone hào quang */
    --border-color: rgba(0, 242, 254, 0.15); /* Viền phát sáng nhẹ */
    --terminal-bg: rgba(4, 13, 33, 0.85);
    --terminal-text: #e6f1ff;
    --gradient-primary: linear-gradient(135deg, #0a2d57 0%, #00f2fe 100%);
    --gradient-secondary: linear-gradient(135deg, #ffbb77 0%, #f72585 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: radial-gradient(ellipse at bottom, #0a2d57 0%, #020813 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-attachment: fixed; /* Giúp background không cuộn theo content */
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Add subtle stardust pattern overlay */
    background-image: 
        radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.8), rgba(0,0,0,0)),
        radial-gradient(1px 1px at 40px 70px, rgba(255,255,255,0.6), rgba(0,0,0,0)),
        radial-gradient(1px 1px at 50px 160px, rgba(255,187,119,0.5), rgba(0,0,0,0)),
        radial-gradient(1px 1px at 90px 40px, rgba(0,242,254,0.6), rgba(0,0,0,0)),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.7), rgba(0,0,0,0));
    background-size: 200px 200px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    background: transparent;
    box-shadow: none;
    min-height: 100vh;
    border: none;
    position: relative;
    z-index: 1;
}

/* HUD Header Styles */
.terminal-header {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 242, 254, 0.1);
    backdrop-filter: blur(10px);
}

#canvas-container {
    position: absolute;
    top: -170px;
    right: -100px;
    left: auto;
    width: 800px;
    height: 800px;
    z-index: 100;
    pointer-events: none;
    /* Let clicks pass through to terminal buttons/text */
    opacity: 0.8;
    -webkit-mask-image: radial-gradient(circle at center, black 35%, transparent 70%);
    mask-image: radial-gradient(circle at center, black 35%, transparent 70%);
}

.terminal-header-content {
    position: relative;
    z-index: 1;
}

.terminal-bar {
    background: rgba(0, 242, 254, 0.05);
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Fira Code', monospace;
}

.terminal-title {
    color: var(--accent-blue);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

.terminal-content {
    padding: 2rem;
    background: transparent;
}

.terminal-line {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prompt {
    color: var(--accent-green);
    font-weight: bold;
    font-size: 1.1rem;
}

.command {
    color: var(--accent-blue);
    font-weight: 500;
}

.terminal-output {
    margin-left: 1rem;
    margin-bottom: 2rem;
}

.ascii-art {
    color: var(--accent-purple);
    font-size: 0.8rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.ascii-art pre {
    font-family: 'Fira Code', monospace;
    white-space: pre;
    overflow-x: auto;
}

.profile-info h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--accent-blue);
}

.profile-info h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.status-line {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 242, 254, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 242, 254, 0.2);
    font-size: 0.9rem;
    color: var(--text-secondary);
    backdrop-filter: blur(5px);
}

.status-item i {
    color: var(--accent-green);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.3rem 0;
}

.contact-item i {
    color: var(--accent-blue);
    width: 20px;
}

/* Main Content */
.main-content {
    padding: 2rem;
    background: transparent;
}

.section {
    margin-bottom: 3rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.section:hover {
    box-shadow: 0 8px 32px 0 rgba(0, 242, 254, 0.1);
    border-color: rgba(0, 242, 254, 0.3);
}

.section h3 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid var(--accent-blue);
    padding-bottom: 0.5rem;
}

.section h3 i {
    color: var(--accent-blue);
}

/* Holographic Code Skills Section */
.code-skills {
    background: rgba(0, 242, 254, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: inset 0 0 20px rgba(0, 242, 254, 0.05);
}

.code-header {
    background: rgba(4, 13, 33, 0.5);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 242, 254, 0.2);
}

.code-tabs {
    display: flex;
    gap: 0.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px 8px 0 0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.tab.active {
    background: rgba(0, 242, 254, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(0, 242, 254, 0.3);
    border-bottom: none;
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

.code-actions {
    display: flex;
    gap: 0.5rem;
}

.code-actions i {
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.code-actions i:hover {
    color: var(--accent-blue);
    background: var(--bg-primary);
}

.code-content {
    padding: 0;
    background: var(--terminal-bg);
}

.code-content pre {
    margin: 0;
    padding: 1.5rem;
    background: var(--terminal-bg);
    color: var(--terminal-text);
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-content code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Highlights Section */
.highlights {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    border-left: 5px solid var(--accent-blue);
    backdrop-filter: blur(8px);
}

.highlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.highlight-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 242, 254, 0.15);
    border-color: var(--accent-blue);
}

.highlight-item i {
    font-size: 1.5rem;
    color: #3498db;
    width: 30px;
}

/* Skills Section */
.skill-category {
    margin-bottom: 2rem;
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--accent-cyan);
    border-top: 1px solid rgba(255,255,255,0.02);
    backdrop-filter: blur(8px);
}

.skill-category h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.skill-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.skill-tag:hover::before {
    left: 100%;
}

.skill-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

/* Language-specific skill tag colors */
.skill-tag.python {
    border-left: 3px solid #3776ab;
}

.skill-tag.c {
    border-left: 3px solid #00599c;
}

.skill-tag.matlab {
    border-left: 3px solid #e16737;
}

.skill-tag.web {
    border-left: 3px solid #f7df1e;
}

.skill-tag.rust {
    border-left: 3px solid #ce422b;
}

/* Projects Section */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-tertiary);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
}

.project-card.featured::before {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
    height: 6px;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 242, 254, 0.15);
    border-color: var(--accent-blue);
}

.project-card.featured {
    border: 2px solid var(--accent-green);
    box-shadow: 0 5px 20px rgba(126, 231, 135, 0.2);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-header h4 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
}

.project-role {
    background: linear-gradient(135deg, var(--accent-orange), #ff7e5f);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-details h5 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.project-details ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.project-details li {
    margin-bottom: 0.3rem;
    color: var(--text-secondary);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: linear-gradient(135deg, var(--accent-blue), #00f2fe);
    color: #040d21;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Fira Code', monospace;
}

/* Education Section */
.education-item {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 15px;
    border-left: 5px solid var(--accent-blue);
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.education-header h4 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
}

.education-location {
    color: var(--text-secondary);
    font-style: italic;
}

.education-degree {
    color: var(--accent-blue);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Footer */
.footer {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--accent-blue);
    transform: translateY(-2px);
    border-color: var(--accent-blue);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
    }

    .profile-section {
        flex-direction: column;
        text-align: center;
    }

    .profile-info h1 {
        font-size: 2rem;
    }

    .profile-info h2 {
        font-size: 1.2rem;
    }

    .main-content {
        padding: 1rem;
    }

    .section h3 {
        font-size: 1.5rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .education-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .social-links {
        flex-direction: column;
        align-items: center;
    }

    .highlight-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 0;
        box-shadow: none;
    }

    .header {
        padding: 1rem;
    }

    .main-content {
        padding: 0.5rem;
    }

    .project-card {
        padding: 1rem;
    }

    .skill-tags,
    .tech-tags {
        justify-content: center;
    }
}

/* New Elements Styles */
.tagline {
    color: var(--accent-cyan);
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-align: center;
}

.highlight {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(126, 231, 135, 0.3);
}

.wave {
    display: inline-block;
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(20deg);
    }

    75% {
        transform: rotate(-10deg);
    }
}

.cursor-blink {
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Achievements Section */
.achievements {
    background: transparent;
    border: 1px solid var(--accent-blue);
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.1);
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.achievement-card {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
}

.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 242, 254, 0.2);
    border-color: var(--accent-blue);
}

.achievement-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.achievement-content h4 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.achievement-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Personal Section */
.personal {
    background: transparent;
    border: 1px solid var(--accent-orange);
    box-shadow: 0 0 30px rgba(255, 187, 119, 0.1);
}

.personal-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.personal-item {
    background: var(--bg-tertiary);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.personal-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-secondary);
}

.personal-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(247, 37, 133, 0.2);
    border-color: var(--accent-pink);
}

.personal-item h4 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.personal-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section {
    animation: fadeInUp 0.6s ease-out;
}

.achievement-card {
    animation: slideInLeft 0.6s ease-out;
}

.personal-item {
    animation: slideInRight 0.6s ease-out;
}

/* Floating Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.achievement-icon {
    animation: float 3s ease-in-out infinite;
}

.achievement-icon:nth-child(2) {
    animation-delay: 0.5s;
}

.achievement-icon:nth-child(3) {
    animation-delay: 1s;
}

.achievement-icon:nth-child(4) {
    animation-delay: 1.5s;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 254, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 242, 254, 0.8);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

/* Shooting Stars Effect */
.shooting-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotateZ(45deg);
    pointer-events: none;
    z-index: 0;
}

.shooting-stars span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1),
                0 0 0 8px rgba(255, 255, 255, 0.1),
                0 0 20px rgba(255, 255, 255, 1);
    animation: shooting-star 3s linear infinite;
}

.shooting-stars span::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    height: 1px;
    background: linear-gradient(90deg, #fff, transparent);
}

@keyframes shooting-star {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        transform: translateX(-1500px);
        opacity: 0;
    }
}

.shooting-stars span:nth-child(1) {
    top: 10%;
    right: 0;
    left: auto;
    animation-delay: 0s;
    animation-duration: 2.5s;
}

.shooting-stars span:nth-child(2) {
    top: 30%;
    right: 80px;
    left: auto;
    animation-delay: 1.2s;
    animation-duration: 4s;
}

.shooting-stars span:nth-child(3) {
    top: 60%;
    right: 0;
    left: auto;
    animation-delay: 0.8s;
    animation-duration: 3s;
}

.shooting-stars span:nth-child(4) {
    top: 80%;
    right: 200px;
    left: auto;
    animation-delay: 2.5s;
    animation-duration: 5s;
}

.shooting-stars span:nth-child(5) {
    top: 50%;
    right: 0;
    left: auto;
    animation-delay: 3s;
    animation-duration: 2s;
}