:root {
    /* Colors */
    --bg-gradient-start: #0a0a0a;
    --bg-gradient-end: #1a1a1a;
    --text-color: #e0e0e0;
    --secondary-text-color: #b0b0b0;
    --footer-color: #888888;
    
    /* Glass Effects */
    --card-bg: rgba(255, 255, 255, 0.15);
    --card-border: rgba(255, 255, 255, 0.1);
    --card-hover-bg: rgba(255, 255, 255, 0.25);
    --card-shadow: rgba(0, 0, 0, 0.2);
    --card-shine: rgba(255, 255, 255, 0.3);
    
    /* Skeleton */
    --skeleton-bg: rgba(255, 255, 255, 0.08);
    --shimmer-start: rgba(255, 255, 255, 0.05);
    --shimmer-mid: rgba(255, 255, 255, 0.15);
    
    /* Profile */
    --profile-shadow: rgba(255, 255, 255, 0.2);
}

body {
    margin: 0;
    padding: 70px 0 0 0;
    font-family: 'Poppins', sans-serif;
    background: transparent;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    background-size: 400% 400%;
    animation: gradient-animation 15s ease infinite alternate;
    z-index: -3;
}

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient-start);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loader {
    border: 8px solid #333333;
    border-top: 8px solid var(--text-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#brand-logo {
    position: fixed;
    top: 20px;
    left: 20px;
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-color);
    z-index: 100;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#language-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.lang-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-color);
    font-size: 0.9em;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    outline: none;
}

.lang-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.flag-icon {
    font-size: 1.2em;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-style: preserve-3d;
}

.lang-text {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.translating {
    opacity: 1;
    transform: translateX(-30px) scale(0.98);
    filter: blur(1px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.translation-complete {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0px);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-section.translating {
    animation: slideOutLeft 0.5s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

.card-section.translation-complete {
    animation: slideInRight 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideOutLeft {
    0% {
        transform: translateX(0) scale(1);
        opacity: 1;
        filter: blur(0px);
    }
    100% {
        transform: translateX(-60px) scale(0.95);
        opacity: 0.3;
        filter: blur(2px);
    }
}

@keyframes slideInRight {
    0% {
        transform: translateX(60px) scale(0.95);
        opacity: 0.3;
        filter: blur(2px);
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
        filter: blur(0px);
    }
}

.text-morphing {
    position: relative;
    overflow: hidden;
}

.text-morphing::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: textWave 0.8s ease-in-out;
}

@keyframes textWave {
    0% { left: -100%; }
    100% { left: 100%; }
}

.translation-ripple {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: rippleExpand 1.2s ease-out forwards;
    pointer-events: none;
    z-index: 999;
}

@keyframes rippleExpand {
    0% {
        width: 20px;
        height: 20px;
        opacity: 1;
    }
    100% {
        width: 800px;
        height: 800px;
        opacity: 0;
    }
}

.lang-button.morphing {
    transform: perspective(400px) rotateY(90deg);
    transition: transform 0.3s ease;
}

.lang-button.morphing-complete {
    transform: perspective(400px) rotateY(0deg);
    transition: transform 0.3s ease 0.1s;
}

.container {
    text-align: center;
    padding: 20px;
    max-width: 700px;
    width: 90%;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    position: relative;
    z-index: 1;
}

.container.loaded {
    opacity: 1;
    transform: translateY(0);
}

.profile-header {
    margin-bottom: 40px;
    padding-top: 20px;
    text-align: center;
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--text-color);
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 0 15px var(--profile-shadow);
    animation: avatar-glow 2s ease-in-out infinite alternate;
}

@keyframes avatar-glow {
    0% { box-shadow: 0 0 15px var(--profile-shadow); }
    50% { box-shadow: 0 0 25px var(--profile-shadow), 0 0 50px rgba(255, 255, 255, 0.1); }
    100% { box-shadow: 0 0 15px var(--profile-shadow); }
}

.name-and-cursor {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 5px;
}

.profile-header h1 {
    font-size: 3em;
    margin: 0;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-color);
    white-space: nowrap;
}

.profile-header .tagline {
    font-size: 1.2em;
    color: var(--secondary-text-color);
    margin-top: 0;
}

#typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 3em;
    background-color: var(--text-color);
    animation: blink-caret 0.75s step-end infinite;
    vertical-align: bottom;
    margin-left: 5px;
}

@keyframes blink-caret {
    from, to { background-color: transparent }
    50% { background-color: var(--text-color); }
}

.card-section {
    background: var(--card-bg);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 15px var(--card-shadow), 0 8px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
    text-align: left;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.card-section.animated {
    opacity: 1;
    transform: translateY(0);
}

.card-section h2 {
    font-size: 1.8em;
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--card-border);
    padding-bottom: 10px;
}

.about-me p {
    font-size: 1.1em;
    color: var(--secondary-text-color);
    line-height: 1.6;
    margin-bottom: 0;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.social-card {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 15px 20px;
    background: var(--card-bg);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 15px var(--card-shadow), 0 8px 30px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1em;
    font-weight: 400;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    padding: 1px;
    background: linear-gradient(45deg, #8e2de2, #4a00e0);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.social-card:hover::before {
    opacity: 1;
}

.social-card:hover {
    background: var(--card-hover-bg);
    border-color: transparent;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 20px var(--card-shadow), 0 12px 40px rgba(0, 0, 0, 0.2);
}

.social-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 0;
    height: 200%;
    background: linear-gradient(90deg, transparent, var(--card-shine), transparent);
    transform: rotate(35deg);
    transition: width 0.3s ease, left 0.3s ease;
    opacity: 0;
}

.social-card:hover::after {
    width: 100%;
    left: 100%;
    opacity: 1;
    transition: width 0.3s ease, left 0.3s ease 0.1s, opacity 0.3s ease;
}

.social-card .icon {
    font-size: 1.5em;
    margin-right: 15px;
    color: var(--text-color);
    transition: transform 0.3s ease;
}

.social-card:hover .icon {
    transform: scale(1.1);
}

/* Vùng grid hiển thị repo */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

/* Repo card */
.repo-card {
  display: block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 1.2rem;
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.repo-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

/* Tên repo */
.repo-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: .5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mô tả repo */
.repo-card p {
  font-size: 0.9rem;
  line-height: 1.4;
  opacity: 0.85;
  max-height: 3.8rem; /* khoảng 2 dòng */
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .75rem;
}

/* Meta thông tin repo */
.repo-meta {
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  opacity: 0.75;
}
.repo-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.github-more-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1em;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.github-more-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

footer {
    margin-top: 50px;
    font-size: 0.9em;
    color: var(--footer-color);
    padding-bottom: 20px;
}

.skeleton-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.skeleton-line {
    height: 1.2em;
    background: var(--skeleton-bg);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.long { width: 100%; }

.skeleton-wrapper.social-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.skeleton-card {
    height: 50px;
    background: var(--skeleton-bg);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.skeleton-line::after,
.skeleton-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--shimmer-start) 0%, var(--shimmer-mid) 50%, var(--shimmer-start) 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    to { left: 100%; }
}

.content-wrapper.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    #brand-logo {
        font-size: 1.3em;
        top: 15px;
        left: 15px;
        padding: 4px 8px;
    }
    
    #language-toggle {
        top: 15px;
        right: 15px;
    }
    
    .lang-button {
        padding: 6px 10px;
        font-size: 0.85em;
        gap: 6px;
    }
    
    .profile-header h1 {
        font-size: 2.5em;
    }

    .profile-header .tagline {
        font-size: 1.1em;
    }

    .card-section {
        padding: 20px;
        margin-bottom: 20px;
    }

    .card-section h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .about-me p {
        font-size: 1em;
    }

    .social-card {
        font-size: 1em;
        padding: 12px 15px;
    }

    .social-card .icon {
        font-size: 1.3em;
        margin-right: 10px;
    }
}

@media (max-width: 480px) {
    #brand-logo {
        font-size: 1.1em;
        top: 10px;
        left: 10px;
        padding: 3px 6px;
    }
    
    #language-toggle {
        top: 10px;
        right: 10px;
    }
    
    .lang-button {
        padding: 5px 8px;
        font-size: 0.8em;
        gap: 5px;
    }
    
    .flag-icon {
        font-size: 1em;
    }
    
    .profile-pic {
        width: 120px;
        height: 120px;
    }

    .profile-header h1 {
        font-size: 2em;
    }

    .profile-header .tagline {
        font-size: 1em;
    }

    .card-section {
        padding: 15px;
    }

    .card-section h2 {
        font-size: 1.3em;
    }

    .about-me p {
        font-size: 0.95em;
    }

    .social-grid {
        grid-template-columns: 1fr; /* Stack cards on very small screens */
    }

    .social-card {
        font-size: 0.95em;
    }

    .social-card .icon {
        font-size: 1.2em;
    }
}