:root {
    --bg-main: #0f1724;
    --bg-card: rgba(255, 255, 255, 0.04);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.5);
    --accent-green: #00c88c;
    --accent-blue: #4687ff;
    --accent-purple: #a050ff;
    --nav-bg: rgba(15, 23, 36, 0.85);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    user-select: none; /* Prevent selection in mobile app */
    -webkit-font-smoothing: antialiased;
}

#app {
    padding: 20px 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(70, 135, 255, 0.3);
}
.greeting {
    display: flex;
    flex-direction: column;
}
.greeting-text {
    font-size: 15px;
    font-weight: 600;
}
.plan-name {
    font-size: 12px;
    color: var(--accent-green);
    font-weight: 500;
    margin-top: 2px;
}
.menu-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.menu-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Status Card */
.status-card {
    background: linear-gradient(180deg, rgba(0, 200, 140, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(0, 200, 140, 0.2);
    border-radius: 24px;
    padding: 30px 20px 24px;
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}
.shield-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shield-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(0, 200, 140, 0.2);
    animation: pulse 2s infinite ease-out;
}
@keyframes pulse {
    0% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}
.shield-icon {
    position: relative;
    z-index: 2;
    background: var(--bg-main);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(0, 200, 140, 0.4);
    box-shadow: inset 0 0 20px rgba(0, 200, 140, 0.1);
}
.status-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin-bottom: 24px;
}
.stats-row {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 12px 0;
}
.stat-box {
    flex: 1;
    border-right: 1px solid var(--border-color);
}
.stat-box:last-child {
    border-right: none;
}
.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-green);
}
.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Section Title */
.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-muted);
}

/* Config Cards */
.config-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    transition: transform 0.1s;
}
.config-card:active {
    transform: scale(0.98);
}
.config-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}
.config-icon.vless {
    background: rgba(70, 135, 255, 0.15);
}
.config-icon.hysteria {
    background: rgba(160, 80, 255, 0.15);
}
.config-info {
    flex: 1;
}
.config-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}
.config-desc {
    font-size: 12px;
    color: var(--text-muted);
}
.copy-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.copy-btn:active {
    background: var(--accent-green);
    color: var(--bg-main);
}
.copy-btn.success {
    background: var(--accent-green);
    color: var(--bg-main);
}

/* Primary Button */
.btn-primary {
    background: var(--accent-blue);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    padding: 16px;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(70, 135, 255, 0.4);
}
.btn-primary:active {
    background: #3572df;
    transform: translateY(2px);
}

/* Bottom Nav */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 24px; /* extra safe area padding */
    z-index: 100;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    gap: 6px;
    width: 60px;
}
.nav-item.active {
    color: var(--accent-green);
}
.nav-item svg {
    opacity: 0.7;
}
.nav-item.active svg {
    opacity: 1;
}

/* Hide number input spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* Login Stats hover */
.login-stat {
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}
.login-stat:hover {
    transform: translateY(-3px);
    border-color: rgba(108, 99, 255, 0.45) !important;
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.15);
}
