:root {
    --primary-glow: rgba(255, 174, 0, 0.4);
    --accent-color: #ffae00;
    --bg-dark: #070707;
    --card-dark: rgba(25, 25, 25, 0.7);
    --card-gold: linear-gradient(90deg, rgba(255, 174, 0, 0.6) 0%, rgba(255, 215, 0, 0.4) 100%);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-white: #ffffff;
    --text-gray: rgba(255, 255, 255, 0.75);
    --glass-blur: 15px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Be Vietnam Pro', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* Particle Canvas */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

body {
    background: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Optimization */
.background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5) contrast(1.2);
    transform: scale(1.1);
    animation: bgPan 20s ease-in-out infinite alternate;
}

@keyframes bgPan {
    0% {
        transform: scale(1.1) translate(0, 0);
    }

    100% {
        transform: scale(1.2) translate(-2%, -2%);
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0.8) 100%);
    backdrop-filter: blur(2px);
    z-index: -1;
}

/* Container */
.profile-container {
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-height: 100vh;
    animation: fadeInContent 1.2s ease-out;
}

.main-content-wrapper {
    width: 100%;
    margin: auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Improvements */
.profile-header {
    text-align: center;
    margin-bottom: 30px;
    width: 100%;
}

.avatar-wrapper {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0 auto 15px;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-color);
    padding: 4px;
    box-shadow: 0 0 40px var(--primary-glow);
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: avatarPulse 3s infinite;
}

@keyframes avatarPulse {
    0% {
        box-shadow: 0 0 20px var(--primary-glow);
    }

    50% {
        box-shadow: 0 0 50px var(--primary-glow), 0 0 20px var(--accent-color);
    }

    100% {
        box-shadow: 0 0 20px var(--primary-glow);
    }
}

.avatar:hover {
    transform: rotate(5deg) scale(1.1);
}

.status-dot {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    background: #00ff88;
    border-radius: 50%;
    border: 4px solid #070707;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
    animation: statusBlink 2s infinite;
}

@keyframes statusBlink {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.name {
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.verified-icon {
    width: 20px;
    height: 20px;
    color: #fff;
    background: #0095f6;
    border-radius: 50%;
    padding: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

@keyframes rotateVerified {

    0%,
    90% {
        transform: rotate(0);
    }

    100% {
        transform: rotate(360deg);
    }
}

.bio {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.4;
    max-width: 380px;
    margin: 0 auto;
    font-weight: 400;
}

/* Link Group Styling - Closer to Reference */
.link-groups {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.link-card {
    background: var(--card-dark);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    padding: 18px 24px;
    border-radius: 20px;
    color: var(--text-white);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.link-card::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: 0.5s;
}

.link-card:hover::before {
    left: 100%;
}

/* Specific button styles as per image */
#link-zalo,
#link-shop {
    background: var(--card-gold);
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 10px 20px rgba(255, 174, 0, 0.1);
}

.link-card:hover {
    transform: scale(1.03);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

#link-zalo:hover,
#link-shop:hover {
    border-color: #fff;
    box-shadow: 0 15px 40px rgba(255, 174, 0, 0.4);
}

.link-content {
    display: flex;
    align-items: center;
    gap: 18px;
    font-weight: 600;
    font-size: 1rem;
}

.link-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-color);
    transition: transform 0.3s;
}

.link-card:hover .link-icon {
    transform: scale(1.2) rotate(-10deg);
}

#link-zalo .link-icon,
#link-shop .link-icon {
    color: #fff;
}

.arrow {
    width: 18px;
    opacity: 0.4;
    transition: all 0.3s;
}

.link-card:hover .arrow {
    opacity: 1;
    transform: translateX(5px);
    color: #fff;
}

/* Footer & Copyright - Premium Upgrade */
.social-footer {
    width: 100%;
    text-align: center;
    padding: 40px 0 20px;
    margin-top: auto;
    position: relative;
}

.copyright {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #fff, var(--accent-color), #fff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
    text-shadow: 0 0 20px rgba(255, 174, 0, 0.2);
    display: inline-block;
    cursor: default;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.copyright:hover {
    filter: brightness(1.2);
    letter-spacing: 3px;
    transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Mobile Settings Toggle (FAB) */
.settings-fab {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    color: #000;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.settings-fab.visible {
    display: flex;
}

/* Modal High Fidelity Design */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 15px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #111111;
    border: 1px solid #333;
    padding: 30px;
    border-radius: 30px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.1rem;
}

#close-settings {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form Styles */
.input-group {
    margin-bottom: 12px;
}

.input-group label {
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: block;
    color: var(--accent-color);
}

.input-group input {
    width: 100%;
    padding: 14px;
    background: #222;
    border: 1px solid #444;
    border-radius: 15px;
    color: #fff;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--accent-color);
    outline: none;
}

.save-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent-color);
    color: #000;
    font-weight: 800;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    text-transform: uppercase;
}

/* Music Player */
.music-player {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
}

.music-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--card-gold);
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.music-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 40px rgba(255, 174, 0, 0.4);
}

.music-btn i {
    font-size: 24px;
    z-index: 2;
}

.music-wave {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    opacity: 0;
    transition: 0.3s;
}

.music-wave.active {
    opacity: 1;
}

.music-wave span {
    width: 3px;
    height: 15px;
    background: #fff;
    border-radius: 3px;
    animation: musicWave 1s ease-in-out infinite;
}

.music-wave span:nth-child(2) {
    animation-delay: 0.2s;
    height: 25px;
}

.music-wave span:nth-child(3) {
    animation-delay: 0.4s;
    height: 18px;
}

@keyframes musicWave {

    0%,
    100% {
        transform: scaleY(0.5);
    }

    50% {
        transform: scaleY(1.2);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Fixes */
@media (max-width: 480px) {
    .profile-container {
        padding: 20px 15px;
    }

    .avatar-wrapper {
        width: 115px;
        height: 115px;
    }

    .name {
        font-size: 1.5rem;
    }

    .link-card {
        padding: 16px 20px;
    }
}

@media (min-width: 768px) {
    .profile-container {
        padding-top: 40px;
    }

    .link-groups {
        gap: 18px;
    }
}