/* ============================================================
   COIIN.X — App Pages (Dashboard, Tasks, Wallet, etc.)
   ============================================================ */

/* ── App Layout ──────────────────────────────────────────── */
.app-body {
  background: var(--bg-base);
  min-height: 100vh;
  padding-bottom: 80px; /* Bottom Nav space */
}

/* ── App Navbar ──────────────────────────────────────────── */
.app-navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(5,5,5,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.app-navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .app-navbar-inner {
    padding: 0 14px;
    gap: 10px;
  }
}

@media (max-width: 360px) {
  .app-navbar-inner {
    padding: 0 8px;
    gap: 6px;
  }
  .app-logo {
    font-size: 1.05rem !important;
  }
}

.app-logo {
  font-size: 1.2rem;
  font-weight: 900;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: 1px;
  white-space: nowrap;
}

.app-nav-links {
  display: flex;
  gap: var(--space-md);
}

.app-nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.app-nav-link:hover, .app-nav-link.active {
  color: var(--text-gold);
  background: var(--gold-glow);
}

.app-nav-actions {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Notification Button */
.notif-btn {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.05rem;
  transition: all var(--transition-fast);
  touch-action: manipulation;
  flex-shrink: 0;
}
.notif-btn:hover { border-color: var(--border-gold); color: var(--gold-light); }

.notif-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: #ff6b6b;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
}
.notif-badge:empty { display: none; }

/* User Menu */
.user-menu { position: relative; }

.user-avatar {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold-glow);
  border: 1.5px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: all var(--transition-fast);
  touch-action: manipulation;
  flex-shrink: 0;
}
.user-avatar:hover { box-shadow: var(--shadow-gold); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  background: #141414;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  min-width: 210px;
  max-width: min(280px, calc(100vw - 24px));
  box-sizing: border-box;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(200, 169, 74, 0.15);
  display: none;
  flex-direction: column;
  gap: var(--space-xs);
  z-index: 1050;
  animation: dropdownFade 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[dir="rtl"] .user-dropdown {
  left: 0;
  right: auto;
}

[dir="ltr"] .user-dropdown {
  right: 0;
  left: auto;
}

.user-dropdown.open { display: flex; }

.user-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding-bottom: var(--space-xs);
}

.user-dropdown a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 6px 8px;
  border-radius: 6px;
  transition: all var(--transition-fast);
}
.user-dropdown a:hover { background: var(--gold-glow); color: var(--text-gold); }

/* ── App Main ────────────────────────────────────────────── */
.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

/* ── Dashboard ───────────────────────────────────────────── */
.dash-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.dash-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: var(--space-xs);
}

.dash-subtitle { color: var(--text-secondary); font-size: 0.9rem; }

/* Stats Row */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.dash-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-smooth);
}
.dash-stat-card:hover { border-color: var(--border-gold); }
.dash-stat-icon { font-size: 1.5rem; margin-bottom: var(--space-sm); }
.dash-stat-value { font-size: 1.6rem; font-weight: 900; background: var(--gold-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.dash-stat-label { color: var(--text-secondary); font-size: 0.8rem; margin-top: 4px; }

/* Balance Card */
.balance-card { text-align: center; padding: var(--space-xl); }
.balance-label { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: var(--space-sm); }
.balance-amount { font-size: 2.8rem; font-weight: 900; background: var(--gold-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: var(--space-xs); }
.balance-held { color: var(--text-muted); font-size: 0.8rem; margin-bottom: var(--space-lg); }
.balance-actions { display: flex; gap: var(--space-sm); justify-content: center; flex-wrap: wrap; }

/* Grid */
.dash-grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }

/* Quick Actions */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
.quick-action-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all var(--transition-smooth);
}
.quick-action-item:hover { border-color: var(--border-gold); color: var(--text-gold); background: var(--gold-glow); }
.qa-icon { font-size: 1.2rem; }

/* Section */
.dash-section { margin-bottom: var(--space-xl); }
.dash-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); }
.dash-section-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.dash-view-all { color: var(--text-gold); font-size: 0.85rem; text-decoration: none; }
.dash-view-all:hover { opacity: 0.8; }

/* Submission Row */
.sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  transition: all var(--transition-smooth);
}
.sub-row:hover { border-color: var(--border-gold); }
.sub-row-info { flex: 1; }
.sub-row-title { font-size: 0.875rem; font-weight: 600; margin-bottom: 2px; }
.sub-row-meta { font-size: 0.75rem; color: var(--text-muted); }
.sub-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.sub-row-reward { font-size: 0.85rem; font-weight: 700; color: var(--gold-primary); }

/* ── Tasks Page ──────────────────────────────────────────── */
.tasks-filters {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.filter-pill {
  padding: 7px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill:hover, .filter-pill.active {
  background: var(--gold-glow);
  border-color: var(--border-gold);
  color: var(--text-gold);
}

.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}

.task-card-full {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: all var(--transition-smooth);
  cursor: pointer;
}
.task-card-full:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.task-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-sm); }
.task-card-title { font-size: 1rem; font-weight: 700; line-height: 1.4; }
.task-card-desc { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.task-proof-type { color: var(--text-muted); font-size: 0.75rem; }

/* ── Task Detail Modal ────────────────────────────────────── */
.task-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.task-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), var(--shadow-gold);
}

.task-modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.task-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.task-modal-close:hover { background: rgba(255,80,80,0.1); color: #ff6b6b; }

.task-modal-body { padding: var(--space-lg); }
.task-modal-footer { padding: var(--space-lg); border-top: 1px solid var(--border-subtle); }

.task-modal-section-title { font-weight: 700; font-size: 0.9rem; margin-bottom: var(--space-sm); color: var(--text-gold); }
.task-modal-text { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.8; white-space: pre-line; }

/* Submit Proof */
.proof-upload-area {
  border: 2px dashed var(--border-gold);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: rgba(200,169,74,0.03);
}
.proof-upload-area:hover { background: var(--gold-glow); }
.proof-upload-area input { display: none; }

/* ── Wallet Page ─────────────────────────────────────────── */
.wallet-hero {
  background: linear-gradient(135deg, #1a1400, #0d0a00);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  margin-bottom: var(--space-xl);
  position: relative;
  overflow: hidden;
}

.wallet-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 50% 0%, rgba(200,169,74,0.1) 0%, transparent 70%);
}

.wallet-total-label { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: var(--space-sm); }
.wallet-total-amount { font-size: 3rem; font-weight: 900; background: var(--gold-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: var(--space-sm); }
.wallet-currency { color: var(--text-muted); font-size: 0.85rem; margin-bottom: var(--space-xl); }

.wallet-balances { display: flex; gap: var(--space-lg); justify-content: center; flex-wrap: wrap; margin-bottom: var(--space-xl); }
.wallet-balance-item { text-align: center; }
.wallet-balance-val { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); }
.wallet-balance-name { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* Ledger List */
.ledger-row {
  display: flex;
  align-items: center;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  gap: var(--space-md);
}
.ledger-row:last-child { border-bottom: none; }
.ledger-icon { font-size: 1.3rem; width: 36px; text-align: center; }
.ledger-info { flex: 1; }
.ledger-type { font-size: 0.875rem; font-weight: 600; }
.ledger-date { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.ledger-amount { font-size: 0.95rem; font-weight: 700; }
.ledger-credit { color: var(--success); }
.ledger-debit  { color: #ff6b6b; }

/* ── Bottom Navigation (Mobile) ──────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 300;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: none;
  justify-content: space-around;
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.bottom-nav-item span:first-child { font-size: 1.2rem; }

.bottom-nav-item:hover, .bottom-nav-item.active {
  color: var(--text-gold);
}

/* ── Withdraw Form ─────────────────────────────────────────  */
.withdraw-form-wrap {
  max-width: 560px;
  margin: 0 auto;
}

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: var(--space-md); }
.empty-state-title { font-size: 1.1rem; font-weight: 700; color: var(--text-secondary); margin-bottom: var(--space-sm); }

/* ── Notifications Center ────────────────────────────────── */
.notif-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.notif-filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.notif-filter-btn:hover,
.notif-filter-btn.active {
  background: var(--gold-glow);
  border-color: var(--border-gold);
  color: var(--text-gold);
}

.notifications-container {
  display: flex;
  flex-direction: column;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.2s ease;
  cursor: pointer;
  position: relative;
}

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

.notif-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.notif-item.unread {
  background: rgba(200, 169, 74, 0.04);
}

.notif-item.unread:hover {
  background: rgba(200, 169, 74, 0.08);
}

.notif-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.notif-item-content {
  flex: 1;
  min-width: 0;
}

.notif-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.notif-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.notif-item-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.notif-item-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
  flex-shrink: 0;
  margin-top: 6px;
}

/* ── Profile & Account ───────────────────────────────────── */
.profile-hero-card {
  padding: 24px;
}

.profile-hero-header {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gold-glow);
  border: 2px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: var(--shadow-gold);
  flex-shrink: 0;
}

.profile-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.badge-role {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--gold-glow);
  color: var(--text-gold);
  border: 1px solid var(--border-gold);
  font-weight: 600;
}

.badge-verified {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(0, 230, 118, 0.12);
  color: var(--success);
  border: 1px solid rgba(0, 230, 118, 0.3);
  font-weight: 600;
}

.profile-email {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 4px 0;
}

.profile-meta {
  font-size: 0.8rem;
}

.profile-tier-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.profile-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.profile-progress-fill {
  height: 100%;
  background: var(--gold-gradient);
  border-radius: 99px;
}

/* ── Responsive Viewports ─────────────────────────────────── */
@media (max-width: 768px) {
  .dash-stats-row { grid-template-columns: 1fr 1fr; }
  .dash-grid-2col { grid-template-columns: 1fr; }
  .app-nav-links  { display: none; }
  .bottom-nav     { display: flex; }
  .tasks-grid     { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
  .profile-hero-header {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  .profile-hero-info .d-flex {
    justify-content: center;
  }
  .profile-avatar-large {
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .dash-stats-row { grid-template-columns: 1fr; }
  .app-main       { padding: 16px 12px; }
  .bottom-nav-item { padding: 4px 6px; }
  .bottom-nav-item span:first-child { font-size: 1.1rem; }
  .bottom-nav-item span:last-child { font-size: 0.6rem; }
  .notif-item { padding: 12px 14px; gap: 10px; }
  .notif-item-icon { width: 34px; height: 34px; font-size: 1rem; }
}

@media (max-width: 360px) {
  .app-main { padding: 12px 8px; }
  .bottom-nav { padding: 6px 0 max(6px, env(safe-area-inset-bottom)); }
  .bottom-nav-item span:last-child { display: none; }
  .bottom-nav-item span:first-child { font-size: 1.35rem; }
}

/* ── VIP Non-Subscriber Notice Card ────────────────────────── */
.vip-upgrade-notice-card {
  background: linear-gradient(135deg, rgba(240, 216, 120, 0.14) 0%, rgba(20, 18, 10, 0.95) 50%, rgba(12, 12, 12, 0.98) 100%);
  border: 1.5px solid var(--border-gold, #C8A94A);
  border-radius: var(--radius-lg, 16px);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  box-shadow: 0 8px 24px rgba(200, 169, 74, 0.15), inset 0 1px 0 rgba(240, 216, 120, 0.2);
  animation: fadeInDown 0.35s ease-out;
  position: relative;
  overflow: hidden;
}
.vip-upgrade-notice-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 140px;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(240, 216, 120, 0.2) 0%, transparent 70%);
  pointer-events: none;
}
.vip-notice-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}
.vip-notice-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(240, 216, 120, 0.18);
  border: 1px solid var(--border-gold, #C8A94A);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(240, 216, 120, 0.2);
}
.vip-notice-content {
  flex: 1;
}
.vip-notice-title {
  color: var(--gold-primary, #F0D878);
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.vip-notice-text {
  color: #FFFFFF;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
}
.vip-notice-btn {
  white-space: nowrap;
  font-weight: 800;
  padding: 9px 18px;
  border-radius: 10px;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .vip-upgrade-notice-card {
    flex-direction: column;
    align-items: stretch;
    text-align: right;
    gap: 14px;
    padding: 14px 16px;
  }
  .vip-notice-btn {
    width: 100%;
    text-align: center;
  }
}


