/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Unbounded', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background: #000000;
  color: #ffffff;
  overflow: hidden;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ===== Screens ===== */
.screen {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 80px;
}

.screen.active {
  display: block;
}

.screen-content {
  padding: 24px 16px;
}

.screen-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
  color: #ffffff;
}

/* ===== Card ===== */
.card {
  background: #1a1a1a;
  border: 3px solid #808080;
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s ease;
}

.card:hover {
  transform: scale(0.97);
}

/* ===== Home Screen ===== */
.logo-section {
  text-align: center;
  margin-bottom: 32px;
  padding-top: 16px;
}

.logo {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 2px;
}

.subtitle {
  font-size: 14px;
  font-weight: 300;
  color: #808080;
  margin-top: 4px;
}

/* Status Card */
.status-card {
  margin-bottom: 32px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #808080;
  transition: all 0.3s ease;
}

.status-dot.active {
  background: #4ade80;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.5);
}

.status-text {
  font-size: 16px;
  font-weight: 500;
}

.plan-info {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #333;
}

.plan-name {
  font-size: 14px;
  font-weight: 500;
  color: #f5f5f5;
}

.plan-expire {
  font-size: 14px;
  color: #808080;
}

/* Connect Button */
.connect-section {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.connect-btn {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 3px solid #808080;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.connect-btn:hover {
  transform: scale(0.95);
  box-shadow: 0 4px 24px rgba(255, 255, 255, 0.1);
}

.connect-btn:active {
  transform: scale(0.9);
}

.connect-btn.active {
  border-color: #4ade80;
  box-shadow: 0 0 32px rgba(74, 222, 128, 0.2);
}

.connect-icon {
  width: 48px;
  height: 48px;
}

.connect-text {
  font-size: 12px;
  font-weight: 500;
  font-family: 'Unbounded', sans-serif;
}

/* Traffic Card */
.traffic-card {
  margin-bottom: 16px;
}

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

.traffic-label {
  font-size: 14px;
  font-weight: 500;
  color: #f5f5f5;
}

.traffic-value {
  font-size: 14px;
  color: #808080;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: #ffffff;
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

.traffic-details {
  display: flex;
  justify-content: space-between;
}

.traffic-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.traffic-item-label {
  font-size: 12px;
  color: #808080;
}

.traffic-item-value {
  font-size: 14px;
  font-weight: 500;
}

/* ===== Stats Screen ===== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  text-align: center;
  padding: 20px 12px;
}

.stat-icon {
  margin-bottom: 12px;
}

.stat-icon svg {
  width: 28px;
  height: 28px;
  color: #f5f5f5;
}

.stat-value {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: #808080;
}

/* Usage Chart */
.usage-chart {
  padding: 20px;
}

.chart-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
}

.chart-bar-container {
  display: flex;
  justify-content: center;
  gap: 48px;
  height: 160px;
  align-items: flex-end;
}

.chart-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 60px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar-fill {
  width: 100%;
  background: #ffffff;
  border-radius: 6px 6px 0 0;
  transition: height 0.5s ease;
  min-height: 4px;
}

.chart-bar-label {
  font-size: 11px;
  color: #808080;
  white-space: nowrap;
}

/* ===== Plans Screen ===== */
.plans-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plan-card {
  background: #1a1a1a;
  border: 3px solid #808080;
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
}

.plan-card:hover {
  transform: scale(0.97);
}

.plan-card.popular {
  border-color: #ffffff;
}

.plan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.plan-card-name {
  font-size: 20px;
  font-weight: 600;
}

.plan-card-badge {
  font-size: 10px;
  font-weight: 500;
  background: #ffffff;
  color: #000000;
  padding: 4px 10px;
  border-radius: 20px;
}

.plan-card-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.plan-card-feature {
  font-size: 14px;
  color: #f5f5f5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-card-feature::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #808080;
  border-radius: 50%;
  flex-shrink: 0;
}

.plan-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.plan-card-price {
  font-size: 28px;
  font-weight: 700;
}

.plan-card-price span {
  font-size: 14px;
  font-weight: 400;
  color: #808080;
}

.plan-card-btn {
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Unbounded', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.plan-card-btn:hover {
  transform: scale(0.95);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.plan-card-btn:active {
  transform: scale(0.9);
}

/* ===== Profile Screen ===== */
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #333;
  border: 2px solid #808080;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  flex-shrink: 0;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-name {
  font-size: 18px;
  font-weight: 600;
}

.profile-username {
  font-size: 14px;
  color: #808080;
}

/* Settings List */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
}

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-item-left svg {
  width: 22px;
  height: 22px;
  color: #f5f5f5;
  flex-shrink: 0;
}

.settings-item-left span {
  font-size: 14px;
  font-weight: 400;
}

.settings-item-value {
  font-size: 14px;
  color: #808080;
}

.chevron {
  width: 18px;
  height: 18px;
  color: #808080;
}

/* ===== Bottom Navbar ===== */
.navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #1a1a1a;
  border-top: 2px solid #808080;
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #808080;
  cursor: pointer;
  padding: 8px 12px;
  transition: all 0.3s ease;
}

.nav-item:hover {
  transform: scale(0.95);
}

.nav-item.active {
  color: #ffffff;
}

.nav-item svg {
  width: 24px;
  height: 24px;
}

.nav-item span {
  font-size: 10px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: flex-end;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 100%;
  background: #1a1a1a;
  border-top: 3px solid #808080;
  border-radius: 24px 24px 0 0;
  padding: 24px 16px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: #808080;
  border-radius: 2px;
  margin: 0 auto 20px;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.modal-text {
  font-size: 14px;
  color: #f5f5f5;
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-btn {
  width: 100%;
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 16px;
  font-weight: 500;
  font-family: 'Unbounded', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-btn:hover {
  transform: scale(0.98);
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-btn-secondary {
  background: transparent;
  color: #ffffff;
  border: 2px solid #808080;
}

/* ===== Points Screen ===== */
.points-balance {
  text-align: center;
  margin-bottom: 24px;
  padding: 24px;
}

.points-balance-label {
  font-size: 14px;
  color: #808080;
  margin-bottom: 8px;
}

.points-balance-value {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
}

.referral-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.referral-label {
  font-size: 12px;
  color: #808080;
}

.referral-code {
  font-size: 14px;
  font-weight: 500;
  color: #f5f5f5;
  background: #333;
  padding: 4px 10px;
  border-radius: 8px;
}

.referral-copy-btn {
  font-size: 12px;
  font-family: 'Unbounded', sans-serif;
  background: transparent;
  color: #f5f5f5;
  border: 1px solid #808080;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.referral-copy-btn:active {
  transform: scale(0.95);
}

.missions-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

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

.mission-card {
  background: #1a1a1a;
  border: 2px solid #808080;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.mission-card:hover {
  transform: scale(0.98);
}

.mission-card.completed {
  border-color: #4ade80;
  opacity: 0.7;
}

.mission-info {
  flex: 1;
}

.mission-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.mission-desc {
  font-size: 12px;
  color: #808080;
}

.mission-reward {
  font-size: 16px;
  font-weight: 600;
  color: #f5f5f5;
  white-space: nowrap;
  margin-left: 12px;
}

.mission-btn {
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Unbounded', sans-serif;
  cursor: pointer;
  margin-left: 12px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.mission-btn:active {
  transform: scale(0.95);
}

.mission-btn.done {
  background: #333;
  color: #808080;
  cursor: default;
}

/* ===== Admin Screen ===== */
.admin-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.admin-section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-user-card {
  background: #1a1a1a;
  border: 2px solid #808080;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-user-info {
  flex: 1;
}

.admin-user-name {
  font-size: 14px;
  font-weight: 500;
}

.admin-user-details {
  font-size: 11px;
  color: #808080;
  margin-top: 2px;
}

.admin-user-actions {
  display: flex;
  gap: 6px;
}

.admin-btn {
  background: transparent;
  color: #f5f5f5;
  border: 1px solid #808080;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-family: 'Unbounded', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-btn:active {
  transform: scale(0.95);
}

.admin-btn.danger {
  border-color: #ef4444;
  color: #ef4444;
}

/* Admin nav item */
.nav-item.admin-nav {
  display: none;
}

.nav-item.admin-nav.visible {
  display: flex;
}

/* ===== Config Section (Home) ===== */
.config-section {
  margin-top: 16px;
}

.config-card {
  padding: 20px;
}

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

.config-title {
  font-size: 16px;
  font-weight: 600;
}

.config-protocol {
  font-size: 12px;
  font-weight: 500;
  background: #333;
  color: #f5f5f5;
  padding: 4px 10px;
  border-radius: 8px;
}

.config-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.config-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.config-field-label {
  font-size: 12px;
  color: #808080;
  font-weight: 400;
}

.config-field-value {
  font-size: 13px;
  font-weight: 500;
  color: #f5f5f5;
  background: #262626;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  max-width: 60%;
  text-align: right;
  word-break: break-all;
}

.config-field-value:active {
  opacity: 0.6;
}

.config-field-value.password {
  font-size: 11px;
}

.config-qr-section {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

.config-qr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.config-qr-img {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  border: 2px solid #333;
}

.config-qr-label {
  font-size: 10px;
  color: #808080;
}

.config-copy-btn {
  width: 100%;
  background: #262626;
  color: #f5f5f5;
  border: 2px solid #808080;
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Unbounded', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.config-copy-btn:active {
  transform: scale(0.97);
}

/* Config Modal */
.config-modal {
  max-height: 80vh;
  overflow-y: auto;
}

.modal-html-content {
  font-size: 14px;
  color: #f5f5f5;
  line-height: 1.8;
  margin-bottom: 20px;
}

.modal-html-content code {
  background: #262626;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-family: monospace;
  word-break: break-all;
}

.modal-html-content b {
  font-size: 16px;
}

.modal-qr-img {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  border: 2px solid #333;
  display: block;
  margin: 8px auto;
}

.modal-qr-caption {
  font-size: 12px;
  color: #808080;
  display: block;
  text-align: center;
}

.sub-url-code {
  display: block;
  margin-top: 4px;
  padding: 8px !important;
  font-size: 11px !important;
  line-height: 1.4;
}

/* ===== Scrollbar ===== */
.screen::-webkit-scrollbar {
  width: 0;
}

/* ===== Loading ===== */
.loading {
  display: flex;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #333;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen.active .screen-content {
  animation: fadeIn 0.3s ease;
}
