:root {
    --bg-dark: #050507;
    --bg-card: #101014;
    --bg-card-hover: #16161c;
    --primary: #3b82f6;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 999px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* Auth Screen */
.screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
}

.screen.active {
    display: flex;
}

.auth-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
}

.auth-content img {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.auth-content h1 {
    font-size: 28px;
    font-weight: 700;
}

.auth-content p {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 30px;
}

/* Dashboard */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-top: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.user-details {
    display: flex;
    flex-direction: column;
}

#user-name {
    font-weight: 600;
    font-size: 16px;
}

#user-plan.badge {
    font-size: 12px;
    color: var(--accent);
    background: rgba(6, 182, 212, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    align-self: flex-start;
}

.icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    color: var(--text-main);
    background: var(--bg-card-hover);
}

/* Traffic Card */
.traffic-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.traffic-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.circle-progress {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0%, var(--bg-dark) 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    position: relative;
    transition: background 0.5s ease;
}

.inner-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.traffic-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
}

.traffic-label {
    font-size: 12px;
    color: var(--text-muted);
}

.traffic-stats {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat .label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat .value {
    font-size: 16px;
    font-weight: 600;
}

/* Actions */
.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
}

.action-btn {
    padding: 16px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.action-btn:active {
    transform: scale(0.98);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.action-btn.secondary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
}

.action-btn .icon {
    font-size: 24px;
}

/* Section */
.section {
    margin-bottom: 30px;
}

.section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.apps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.2s;
}

.app-item:active {
    background: var(--bg-card-hover);
}

.app-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.app-icon.android { background: rgba(16, 185, 129, 0.1); }
.app-icon.apple { background: rgba(255, 255, 255, 0.1); }

.app-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.app-name {
    font-weight: 600;
    font-size: 14px;
}

.app-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.arrow {
    color: var(--text-muted);
}

/* Info List */
.info-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item .label {
    color: var(--text-muted);
    font-size: 14px;
}

.info-item .value {
    font-weight: 600;
    font-size: 14px;
}

.status-active {
    color: #10b981;
}

.links-row {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.links-row a {
    color: var(--text-muted);
    font-size: 12px;
    text-decoration: none;
}

/* Helpers */
.hidden {
    display: none !important;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: flex-end; /* Bottom sheet style */
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 600px;
    padding: 24px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 20px;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Plan Cards in Modal */
.plan-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan-card:hover, .plan-card.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.plan-info h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.plan-price {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
}

.plan-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-full {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: var(--primary);
    color: white;
    border: none;
    font-weight: 600;
    margin-top: 16px;
    cursor: pointer;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.current-sub-info {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 16px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.sub-status-badge {
    color: #10b981;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}
