:root {
    /* Liquid Glass Effect Variables */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    --progress-bg: rgba(255, 255, 255, 0.1);

    /* Colors */
    --accent: #4d8bf5;
    /* Modern bright blue */
    --accent-glow: rgba(77, 139, 245, 0.5);
    --text-main: #ffffff;
    --text-muted: #a0a8b9;

    /* Background gradients */
    --bg-base: #0a0e17;
    --orb-1: #1a365d;
    --orb-2: #4d8bf5;

    --neutral-btn-bg: rgba(255, 255, 255, 0.1);
}

/* Enforced Light Theme styling */
[data-theme="light"] {
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.9);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.08);

    --progress-bg: rgba(0, 0, 0, 0.08);

    --accent: #2e6bd8;
    --accent-glow: rgba(46, 107, 216, 0.3);
    --text-main: #111827;
    --text-muted: #6b7280;

    --bg-base: #fafafa;
    --orb-1: #e0e7ff;
    --orb-2: #bfdbfe;

    --neutral-btn-bg: rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

img,
svg {
    pointer-events: none;
    -webkit-user-drag: none;
}

html {
    overflow-x: hidden;
    overscroll-behavior-x: none;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    overflow: hidden;
    overflow-x: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
    transition: background-color 0.5s ease, color 0.5s ease;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-x: none;
}

/* Background Animations */
.bg-orb-1,
.bg-orb-2 {
    position: absolute;
    z-index: 0;
    opacity: 0.7;
    will-change: transform;
    pointer-events: none;
}

.bg-orb-1 {
    top: -20%;
    left: -20%;
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, var(--orb-1) 0%, transparent 70%);
    animation: float 25s infinite alternate ease-in-out;
}

.bg-orb-2 {
    bottom: -20%;
    right: -20%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, var(--orb-2) 0%, transparent 70%);
    animation: float 30s infinite alternate ease-in-out reverse;
}

@keyframes float {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    100% {
        transform: translate3d(8%, 12%, 0) scale(1.05);
    }
}

/* App Container */
#app {
    position: relative;
    z-index: 1;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}

/* Bottom Navbar (Floating Profile) */
.bottom-nav {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateZ(0) !important;
    width: 90%;
    max-width: 320px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 40px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    background: rgba(10, 14, 23, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(40px) !important;
    -webkit-backdrop-filter: blur(40px) !important;
}

[data-theme="light"] .bottom-nav {
    background: rgba(255, 255, 255, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
}

.nav-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 100%;
    overflow: hidden;
}

.avatar-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: none;
    box-shadow: none;
    flex-shrink: 0;
}

.nav-info {
    flex-grow: 1;
    min-width: 0;
    /* Important for text truncation */
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

/* Glassmorphism */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Views Visibility */
.view {
    display: none;
    opacity: 0;
    overflow-y: auto;
    height: 100%;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.view.active,
.tab-content.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeInSmooth 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.hidden {
    display: none !important;
}

@keyframes fadeInSmooth {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Section Header */
.section-header {
    padding: 0px 20px 10px;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 5px;
}

.content-body {
    padding: 0 20px 100px;
    /* Increased bottom padding to prevent navbar overlap */
    flex: 1;
}

/* Loader */
.loader {
    width: 40px;
    height: 40px;
    border: 4px solid var(--progress-bg);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    border-radius: 20px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-main);
}

.btn:active {
    transform: scale(0.97);
}

.glass-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.primary-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.primary-btn:hover {
    box-shadow: 0 8px 25px var(--accent-glow);
    filter: brightness(1.1);
}

.wide {
    width: 100%;
}

/* Liquid Glass effect */
.active-liquid {
    position: relative;
    overflow: hidden;
}

.active-liquid::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    animation: liquidShine 3s infinite;
}

@keyframes liquidShine {
    0% {
        left: -100%;
    }

    20% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

/* CSS Wavy Ribbon */
.ribbon-wrapper {
    position: relative;
    display: inline-block;
    margin-top: 5px;
}

.wavy-ribbon-text {
    position: relative;
    z-index: 2;
    color: var(--text-muted);
    font-size: 15px;
    padding-bottom: 6px;
}

.wavy-ribbon-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 4px;
    background: radial-gradient(circle at 50% 100%, var(--accent) 30%, transparent 31%) 0 0,
        radial-gradient(circle at 50% 0%, transparent 30%, var(--accent) 31%) 5px 2px;
    background-size: 10px 4px;
    background-repeat: repeat-x;
    opacity: 0.8;
}

/* Profile / Subscription Section */
.subscription-card {
    padding: 24px;
    border-radius: 24px;
    margin-bottom: 20px;
    position: relative;
}

.sub-status {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
}

.sub-status .dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Queued Subscription styles */
.queued-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    padding: 16px;
    border-radius: 20px;
    margin-top: -10px;
    margin-bottom: 20px;
}

[data-theme="light"] .queued-card {
    background: rgba(0, 0, 0, 0.02);
    border: 1px dashed rgba(0, 0, 0, 0.2);
}

.queued-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 15px;
}

.queued-header svg {
    width: 18px;
    color: var(--text-muted);
}

.queued-desc {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.4;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.expiry {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
    margin-bottom: 20px;
}

.usage-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-header,
.stat-footer {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.progress-bar {
    height: 6px;
    background: var(--progress-bg);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar .fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.8s ease;
}

.dots-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.dots-bar .dot {
    flex: 1;
    height: 6px;
    background: var(--progress-bg);
    border-radius: 3px;
}

.dots-bar .dot.active {
    background: var(--accent);
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}

.setting-item:active {
    transform: scale(0.98);
}

.setting-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
}

.setting-info svg {
    width: 22px;
    color: var(--accent);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0;
    margin: 0;
}

.icon-btn svg {
    width: 20px;
}

/* Loading Screen */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.loading-card {
    text-align: center;
    padding: 50px 40px 40px;
    border-radius: 32px;
    max-width: 320px;
    width: 100%;
}

.loading-icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    position: absolute;
    inset: 0;
    border: 3px solid var(--progress-bg);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

.loading-shield {
    width: 36px;
    height: 36px;
    color: var(--accent);
    animation: shieldPulse 2.5s ease-in-out infinite;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

@keyframes shieldPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.loading-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.loading-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    min-height: 20px;
}

.loading-dots-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ld-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.3;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.ld-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ld-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {

    0%,
    80%,
    100% {
        transform: scale(0.7);
        opacity: 0.3;
    }

    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Animated Server Marquee */
.server-marquee-wrapper {
    width: 100%;
    margin-top: 36px;
    text-align: center;
    overflow: hidden;
    position: relative;
}

.server-marquee-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 18px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.7;
}

.server-marquee-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 18px;
    opacity: 0.6;
    letter-spacing: 0.5px;
}

.server-scroll-container {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    display: flex;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.server-scroll-track {
    display: flex;
    gap: 14px;
    padding: 10px 0;
    width: max-content;
    animation: infiniteScroll 18s linear infinite;
}

@keyframes infiniteScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - 7px));
    }
}

/* Server Pill Cards */
.server-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 100px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    white-space: nowrap;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.server-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(77, 139, 245, 0.18);
}

.server-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: serverPulse 2.5s ease-in-out infinite;
    box-shadow: 0 0 6px currentColor;
}

@keyframes serverPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.server-pill-flag {
    font-size: 20px;
    line-height: 1;
}

.server-pill-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.2px;
}

/* Special pill (bypass) */
.server-pill-special {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-color: rgba(168, 85, 247, 0.25);
}

[data-theme="light"] .server-pill-special {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(139, 92, 246, 0.06) 100%);
    border-color: rgba(168, 85, 247, 0.2);
}

.server-pill-special .server-pill-name {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Promotional Banner */
.promo-banner {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    margin: 0 auto 20px;
    width: 85%;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.promo-banner:active {
    transform: scale(0.97);
}

.promo-banner-image-wrapper {
    position: relative;
    width: 100%;
    max-height: 200px;
    overflow: hidden;
    border-radius: 24px;
}

.promo-banner-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 24px;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
}

.promo-banner-overlay {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: linear-gradient(135deg,
            rgba(77, 139, 245, 0.08) 0%,
            transparent 50%,
            rgba(77, 139, 245, 0.05) 100%);
    pointer-events: none;
}

.promo-banner-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

[data-theme="light"] .promo-banner-badge {
    background: rgba(0, 0, 0, 0.4);
}

/* Theme Toggle */
.theme-toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--glass-border);
    border-radius: 13px;
    transition: background 0.3s;
    cursor: pointer;
    overflow: hidden;
}

[data-theme="light"] .theme-toggle-switch {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .theme-toggle-switch {
    background: var(--accent);
}

.theme-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

[data-theme="dark"] .theme-slider {
    transform: translateX(24px);
}

.theme-icon {
    position: absolute;
    width: 14px;
    height: 14px;
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.3s;
}

.theme-icon-sun {
    color: #f59e0b;
    /* Amber/Orange */
    transform: scale(1);
    opacity: 1;
}

.theme-icon-moon {
    color: var(--accent);
    transform: scale(0);
    opacity: 0;
}

[data-theme="dark"] .theme-icon-sun {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
}

[data-theme="dark"] .theme-icon-moon {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

[data-theme="light"] .promo-banner {
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
}

[data-theme="light"] .promo-banner-badge {
    background: rgba(255, 255, 255, 0.7);
    color: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Banner shine animation */
.promo-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.12),
            transparent);
    transform: skewX(-20deg);
    animation: bannerShine 5s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes bannerShine {
    0% {
        left: -100%;
    }

    15% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}