* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-bg: #0f0f1e;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #b4b4b4;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
}

/* Light Theme */
body.light-theme {
    --dark-bg: #f5f7fa;
    --card-bg: rgba(0, 0, 0, 0.03);
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--dark-bg);
    background-image: url('https://cdn.khanhphandev.dpdns.org/assets/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
}

.logo-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.logo-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 20px;
}

.loading-progress {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 2px;
    animation: loading 5s ease-in-out forwards;
}

@keyframes loading {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    animation: fadeInOut 1.5s ease-in-out infinite;
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

body.light-theme .sun-icon {
    display: block;
}

body.light-theme .moon-icon {
    display: none;
}

/* Music Player */
.music-player {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.music-player:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.music-player.playing {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
}

.music-player svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.play-icon {
    display: block;
}

.pause-icon {
    display: none;
}

.music-player.playing .play-icon {
    display: none;
}

.music-player.playing .pause-icon {
    display: block;
}

.container {
    width: 100%;
    max-width: 680px;
    animation: fadeIn 0.8s ease-out;
    position: relative;
    z-index: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 32px;
    padding: 48px 32px;
    text-align: center;
    box-shadow:
        0 8px 32px 0 rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset,
        0 20px 60px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

body.light-theme .profile-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 8px 32px 0 rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.4) inset,
        0 20px 60px rgba(0, 0, 0, 0.1);
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: var(--primary-gradient);
    opacity: 0.1;
    z-index: 0;
}

/* Avatar Styles */
.avatar-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 24px;
    z-index: 1;
}

.avatar-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: var(--primary-gradient);
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.6;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.avatar {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    background: var(--primary-gradient);
}

.avatar:hover {
    transform: scale(1.05);
}

/* Text Styles */
.name {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.username {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Typing Bio Animation */
.bio-typing {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 32px;
    min-height: 28px;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

#typedText {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cursor {
    color: var(--text-primary);
    animation: blink 1s infinite;
    font-weight: 300;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Social Links */
.links-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
    position: relative;
    z-index: 1;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: slideIn 0.5s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.social-link::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 ease;
}

.social-link:hover::before {
    left: 100%;
}

.social-link:hover {
    transform: translateY(-4px) scale(1.02);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.social-link:active {
    transform: translateY(-2px) scale(1.01);
}

.icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.social-link:hover .icon {
    opacity: 1;
    transform: scale(1.1) rotate(5deg);
}

/* Specific social media colors on hover - Màu đậm hơn */
#facebook-link:hover {
    background: linear-gradient(135deg, rgba(24, 119, 242, 0.4) 0%, rgba(24, 119, 242, 0.15) 100%);
    border-color: rgba(24, 119, 242, 0.5);
}

#instagram-link:hover {
    background: linear-gradient(135deg, rgba(225, 48, 108, 0.4) 0%, rgba(193, 53, 132, 0.15) 100%);
    border-color: rgba(225, 48, 108, 0.5);
}

#discord-link:hover {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.4) 0%, rgba(88, 101, 242, 0.15) 100%);
    border-color: rgba(88, 101, 242, 0.5);
}

#github-link:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-color: rgba(255, 255, 255, 0.4);
}

#linkedin-link:hover {
    background: linear-gradient(135deg, rgba(10, 102, 194, 0.4) 0%, rgba(10, 102, 194, 0.15) 100%);
    border-color: rgba(10, 102, 194, 0.5);
}

/* Footer */
.footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 14px;
    position: relative;
    z-index: 1;
}

/* Responsive Design */
@media (max-width: 480px) {

    .theme-toggle,
    .music-player {
        width: 44px;
        height: 44px;
    }

    .theme-toggle {
        top: 16px;
        right: 16px;
    }

    .music-player {
        bottom: 16px;
        right: 16px;
    }

    .profile-card {
        padding: 32px 24px;
        border-radius: 24px;
    }

    .avatar-wrapper {
        width: 120px;
        height: 120px;
    }

    .avatar {
        width: 120px;
        height: 120px;
    }

    .name {
        font-size: 28px;
    }

    .username {
        font-size: 16px;
    }

    .bio-typing {
        font-size: 16px;
    }

    .social-link {
        padding: 16px 20px;
        font-size: 15px;
    }
}

/* Accessibility */
.social-link:focus,
.theme-toggle:focus,
.music-player:focus {
    outline: 2px solid rgba(102, 126, 234, 0.8);
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
}