/* Performance Optimization */
body {
    transition: opacity ease-in 0.2s;
}

body[unresolved] {
    opacity: 0;
    display: block;
    overflow: hidden;
    position: relative;
}

/* CSS Variables */
:root {
    --primary-color: #ffffff;
    --accent-color: #B0B0FE;
    --glass-bg: rgba(255, 255, 255, 0.01);
    --glass-border: rgba(255, 255, 255, 0.15);
    --blur-amount: 15px;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body */
body {
    font-family: 'Inter', sans-serif;
    background-color: #000;
    color: var(--primary-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    perspective: 1000px;
}

/* Enter Screen */
#enter-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
    transition: opacity 1s ease, visibility 1s;
}

#enter-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.enter-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 2px;
    animation: pulse 2s infinite;
}

/* Background */
#bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    transform: scale(1.1);
    transition: transform 0.1s ease-out;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

/* Main Card */
.card {
    width: 650px;
    max-width: 90%;
    padding: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.02), 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
    display: none;
    align-items: center;
    gap: 35px;
    text-align: left;
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
    will-change: transform;
}

/* Bottom Info */
.bottom-info {
    position: absolute;
    bottom: 20px;
    width: calc(100% - 50px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    transform: translateZ(20px);
}

.view-count,
.location-info {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.6;
    transition: 0.3s;
    pointer-events: auto;
}

.view-count:hover,
.location-info:hover {
    opacity: 1;
}

.view-count i,
.location-info i {
    color: var(--accent-color);
    font-size: 0.9rem;
    filter: drop-shadow(0 0 5px var(--accent-color));
}

.view-count span,
.location-info span {
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: 0.5px;
    font-family: 'Poppins', sans-serif;
    color: rgba(255, 255, 255, 0.8);
}

/* Profile */
.profile-wrapper {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    transform: translateZ(30px);
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 25px rgba(0, 242, 234, 0.2);
}

/* Content */
.content-right {
    flex-grow: 1;
    position: relative;
    transform: translateZ(10px);
}

.name-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.username {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, var(--accent-color), #fff, #fff, var(--accent-color));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
    position: relative;
    display: inline-block;
}

/* Sparkles */
.sparkle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 2;
}

.sparkle {
    position: absolute;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 8px #fff, 0 0 12px var(--accent-color);
    animation: sparkle-anim 1.5s ease-out forwards;
}

/* Badges */
.badges {
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 5;
}

.badge-icon {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 0 6px rgba(0, 242, 234, 0.7));
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.badge-icon:hover {
    transform: translateY(-5px) scale(1.3);
    filter: drop-shadow(0 0 12px rgba(0, 242, 234, 1));
}

/* Mute Button */
#mute-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    backdrop-filter: blur(10px);
    transition: 0.3s;
}

/* Bio Text */
.bio-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    min-height: 1.2em;
    display: block;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
}

.cursor {
    display: inline-block;
    width: 2px;
    background-color: var(--accent-color);
    margin-left: 3px;
    animation: blink 0.7s infinite;
    vertical-align: middle;
}

/* Music Widget */
.music-widget {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.album-art {
    width: 40px;
    height: 40px;
    border-radius: 6px;
}

.album-art.playing {
    animation: spin 8s linear infinite;
}

.track-info {
    flex: 1;
}

.track-name {
    font-weight: 600;
    font-size: 0.85rem;
    display: block;
}

.artist-name {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Social Grid */
.social-grid {
    display: flex;
    gap: 12px;
}

.social-btn {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: 0.3s;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

@keyframes sparkle-anim {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(180deg) translateY(-15px);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 650px) {
    .card {
        flex-direction: column;
        text-align: center;
        width: 90%;
        padding: 30px;
        padding-bottom: 60px;
    }

    .name-container {
        justify-content: center;
        flex-wrap: wrap;
    }

    .social-grid {
        justify-content: center;
    }

    .bottom-info {
        bottom: 15px;
        left: 0;
        width: 100%;
        padding: 0 20px;
    }
}
