:root {
    --bg: #050505;
    --panel: #121212;
    --panel-soft: #181818;
    --border: rgba(255, 255, 255, 0.08);
    --text-main: #f7f7f7;
    --text-muted: #929292;
    --primary: #33d4ab;
    --primary-glow: rgba(51, 212, 171, 0.5);
    --secondary: #b388ff;
    --accent-gradient: linear-gradient(90deg, #b388ff 0%, #33d4ab 100%);
    --font-main: 'Outfit', sans-serif;
    --font-alt: 'Inter', sans-serif;

    /* Feature Variables */
    --slider-bg: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
    --bg: #f4f1ea; /* Soft cream/off-white */
    --panel: rgba(255, 255, 255, 0.9);
    --panel-soft: #e9e4d9;
    --border: rgba(0, 0, 0, 0.05);
    --text-main: #4a4a4a;
    --text-muted: #7a7a7a;
    --primary: #0d9488;
    --secondary: #6366f1;
    --accent-gradient: linear-gradient(90deg, #6366f1 0%, #0d9488 100%);
    --slider-bg: #dcd7ca;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(179, 136, 255, 0.15), transparent 40%),
        radial-gradient(circle at bottom right, rgba(51, 212, 171, 0.15), transparent 45%),
        var(--bg);
    /* Use variable for background */
    color: var(--text-main);
    font-family: var(--font-main);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="light"] body {
    background: radial-gradient(circle at top left, rgba(124, 58, 237, 0.1), transparent 40%),
        radial-gradient(circle at bottom right, rgba(5, 150, 105, 0.1), transparent 45%),
        #f9fafb;
    /* Light background */
}

/* Container */
.container {
    width: 100%;
    max-width: 450px;
    padding: 40px 20px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: center;
}

/* Profile Card */
.profile-card {
    background: rgba(255, 255, 255, 0.03);
    /* Neutral glass */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 32px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.8s ease-out;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    transition: background 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
}

[data-theme="light"] .profile-card {
    background: rgba(255, 255, 255, 0.6);
    /* Frosty glass for light mode */
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
}

/* Enhancing the glass edge - Only in dark mode mostly, but adapted for light */
.profile-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 32px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(51, 212, 171, 0.3), rgba(179, 136, 255, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Avatar */
.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    z-index: 1;
}

/* Glow effect */
.avatar-container::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    z-index: -1;
    opacity: 0.6;
    filter: blur(15px);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--text-main);
    background: var(--panel);
}

/* Typography */
.nickname {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.badge {
    font-size: 1.2rem;
    background: var(--accent-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 400;
}

.handle {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 24px;
    font-family: var(--font-alt);
}

.handle a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.handle a:hover {
    color: var(--primary);
}

.bio {
    margin-bottom: 32px;
}

.bio p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 12px;
    color: var(--text-main);
}

.tags {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.sub-bio {
    font-size: 0.95rem !important;
    color: var(--secondary);
    font-weight: 600;
}

/* Links */
.links {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.link-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    position: relative;
}

.link-item > i:first-child {
    position: absolute;
    left: 24px;
}

[data-theme="light"] .link-item {
    background: white;
    border: 1px solid #e5e7eb;
    color: #111;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.link-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .link-item:hover {
    background: #f9fafb;
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.telegram-blue {
    background: rgba(36, 161, 222, 0.05);
    border-color: rgba(36, 161, 222, 0.2);
}

.telegram-blue:hover {
    background: rgba(36, 161, 222, 0.15);
    border-color: #24a1de;
    box-shadow: 0 0 20px rgba(36, 161, 222, 0.3);
    color: #fff;
}

[data-theme="light"] .telegram-blue {
    background: rgba(36, 161, 222, 0.05);
    border-color: rgba(36, 161, 222, 0.3);
    color: #0c4a6e;
}

[data-theme="light"] .telegram-blue:hover {
    color: #0c4a6e;
}

.telegram-blue i {
    color: #24a1de;
}

/* Burning Portfolio Button */
.portfolio-burning {
    background: rgba(51, 212, 171, 0.05);
    border-color: rgba(51, 212, 171, 0.2);
    position: relative;
    overflow: hidden;
    color: #a7f3d0;
}

[data-theme="light"] .portfolio-burning {
    color: #065f46;
    border-color: rgba(5, 150, 105, 0.3);
    background: rgba(240, 253, 244, 1);
}

.portfolio-burning::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(51, 212, 171, 0.2), transparent);
    transform: translateX(-100%);
    animation: sweep 3s infinite;
}

@keyframes sweep {
    100% {
        transform: translateX(100%);
    }
}

.portfolio-burning:hover {
    background: rgba(51, 212, 171, 0.15);
    border-color: #33d4ab;
    box-shadow: 0 0 20px rgba(51, 212, 171, 0.3), inset 0 0 15px rgba(51, 212, 171, 0.1);
    animation: shake 0.5s infinite linear;
}

@keyframes shake {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(1px, -1px);
    }

    50% {
        transform: translate(-1px, 1px);
    }

    75% {
        transform: translate(1px, 1px);
    }
}

/* Warning Button */
.warning-btn {
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(234, 179, 8, 0.4);
    color: #fef9c3;
}

[data-theme="light"] .warning-btn {
    color: #854d0e;
    border-color: rgba(234, 179, 8, 0.5);
    background: rgba(255, 251, 235, 1);
}

.warning-btn:hover {
    background: rgba(234, 179, 8, 0.3);
    border-color: #eab308;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.4);
    color: #fff;
}

[data-theme="light"] .warning-btn:hover {
    color: #854d0e;
}

.warning-btn i {
    color: #eab308;
}

/* Music Control Button */
.music-control {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.4);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="light"] .music-control {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    border-color: rgba(0, 0, 0, 0.1);
}

.music-control:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
    color: var(--primary);
    border-color: var(--primary);
}

.music-control.playing {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow), inset 0 0 10px var(--primary-glow);
    transform: scale(1.1);
}

.music-control i {
    font-size: 14px;
    position: absolute;
    transition: opacity 0.3s ease;
}

.music-control.playing i {
    opacity: 0;
}

/* Equalizer Animation */
.equalizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.music-control.playing .equalizer {
    opacity: 1;
}

.equalizer span {
    width: 4px;
    border-radius: 2px;
    background: var(--primary);
    animation: bounce 0.8s infinite ease-in-out;
}

.equalizer span:nth-child(1) {
    animation-delay: 0s;
    height: 8px;
}

.equalizer span:nth-child(2) {
    animation-delay: 0.2s;
    height: 16px;
}

.equalizer span:nth-child(3) {
    animation-delay: 0.4s;
    height: 12px;
}

@keyframes bounce {

    0%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(1.8);
    }
}

/* Toggle Switch */
.theme-switch-wrapper {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: rgba(255, 255, 255, 0.1);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border: 1px solid var(--border);
    border-radius: 34px;
}

[data-theme="light"] .slider {
    background-color: var(--slider-bg);
    border-color: rgba(0, 0, 0, 0.1);
}

.slider:before {
    background-color: var(--text-main);
    bottom: 4px;
    content: "";
    height: 24px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 24px;
    z-index: 5;
    border-radius: 50%;
}

[data-theme="light"] .slider:before {
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
    background-color: rgba(51, 212, 171, 0.2);
    border-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(26px);
    background-color: var(--primary);
}

.sun-icon, .moon-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    z-index: 1;
    transition: .4s;
}

.sun-icon {
    left: 8px;
    color: #f59e0b;
}

.moon-icon {
    right: 8px;
    color: #fcd34d;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 24px;
    text-align: center;
    max-width: 90%;
    width: 350px;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-main);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn {
    padding: 10px 24px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-yes {
    background: var(--primary);
    color: #050505;
}

[data-theme="light"] .btn-yes {
    color: #fff;
}

.btn-no {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border);
}

[data-theme="light"] .btn-no {
    background: #f3f4f6;
    color: #111;
    border-color: #d1d5db;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Dropdown */
.dropdown-wrapper {
    width: 100%;
}

.dropdown-btn {
    width: 100%;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#dropdownIcon {
    transition: transform 0.3s ease;
    position: absolute;
    right: 24px;
}

.dropdown-btn #dropdownIcon.rotate {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    animation: fadeInDropdown 0.3s ease;
}

.dropdown-content.show {
    display: flex;
}

.dropdown-content .link-item {
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.95rem;
    padding: 16px;
    justify-content: center;
}

[data-theme="light"] .dropdown-content .link-item {
    background: #f3f4f6;
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Music Info */
.music-info {
    position: absolute;
    top: 20px;
    left: 70px;
    /* Right next to the button */
    height: 40px;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    /* Hidden by default */
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9;
    pointer-events: none;
}

.music-control.playing~.music-info {
    width: 200px;
    /* Expanded width */
    opacity: 1;
    margin-left: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 0 15px;
    border: 1px solid var(--border);
}

.strikethrough-text {
    text-decoration: line-through;
    opacity: 0.6;
    font-weight: 400;
}

.link-item.close {
    justify-content: center;
    gap: 15px;
}

.track-name {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: var(--font-alt);
    animation: marquee 10s linear infinite;
    padding-left: 100%;
    /* Start from outside */
    display: inline-block;
}

/* Adjust marquee for light mode contrast */
[data-theme="light"] .track-name {
    color: var(--text-main);
    font-weight: 500;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Mobile adjustments for music info */
@media (max-width: 480px) {
    .music-control.playing~.music-info {
        width: 120px;
    }

    .profile-card {
        padding: 30px 20px;
    }

    .nickname {
        font-size: 1.6rem;
    }
}

/* Footer */
.footer {
    margin-top: 40px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-alt);
}