/* =============================================
   InvestPro - Core Styles
   Mobile-First, Bootstrap 5 Extended
   ============================================= */

:root {
  --primary: #3b5bdb;
  --primary-dark: #2f4ac5;
  --primary-light: #eef2ff;
  --secondary: #495057;
  --success: #2f9e44;
  --warning: #f59f00;
  --danger: #e03131;
  --info: #1971c2;
  --light-bg: #f8f9fa;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --card-shadow-lg: 0 4px 24px rgba(59,91,219,0.15);
  --border-radius: 14px;
  --border-radius-lg: 20px;
  --bottomnav-height: 70px;
  --topbar-height: 60px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: var(--font); background: #f0f2f8; color: #1a1a2e; overflow-x: hidden; }

/* =============================================
   APP LAYOUT
   ============================================= */
.app-body { min-height: 100vh; background: #f0f2f8; }
.app-content { padding-top: calc(var(--topbar-height) + 8px); padding-bottom: calc(var(--bottomnav-height) + 32px) !important; min-height: 100vh; }

/* =============================================
   TOP BAR
   ============================================= */
.app-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--topbar-height);
  background: white;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.08);
}
.topbar-left, .topbar-right { display: flex; align-items: center; min-width: 80px; }
.topbar-right { justify-content: flex-end; }
.topbar-logo { display: flex; align-items: center; gap: 8px; }
.topbar-logo img { height: 32px; }
.topbar-logo span { font-weight: 700; font-size: 1.1rem; color: var(--primary); }
.topbar-title { font-weight: 700; font-size: 1.1rem; color: #1a1a2e; }
.topbar-back { color: #495057; font-size: 1.3rem; text-decoration: none; }
.topbar-icon { color: #495057; font-size: 1.3rem; text-decoration: none; position: relative; }
.notif-badge { position: absolute; top: -6px; right: -6px; font-size: 0.6rem; min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* =============================================
   BOTTOM NAVIGATION
   ============================================= */
.app-bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  height: var(--bottomnav-height);
  background: white;
  display: flex; align-items: center;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.1);
  border-top: 1px solid #eee;
}
.bottomnav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-decoration: none; color: #9ca3af; font-size: 0.7rem; padding: 8px 0;
  transition: color 0.2s;
}
.bottomnav-item i { font-size: 1.4rem; }
.bottomnav-item.active { color: var(--primary); }
.bottomnav-item.tool-btn { position: relative; }
.tool-icon {
  width: 56px; height: 56px; background: var(--primary);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin-top: -28px; box-shadow: 0 4px 16px rgba(59,91,219,0.4);
}
.tool-icon i { color: white; font-size: 1.6rem; }

/* =============================================
   AUTH PAGES
   ============================================= */
.auth-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3b5bdb 0%, #1a1a6e 100%);
  padding: 20px;
}
.auth-card {
  background: white; border-radius: var(--border-radius-lg);
  padding: 32px 24px; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo img { height: 60px; margin-bottom: 12px; }
.auth-logo h1 { font-size: 1.6rem; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.auth-logo p { color: #6c757d; font-size: 0.9rem; margin: 0; }
.auth-form .form-label { font-weight: 600; font-size: 0.85rem; color: #495057; margin-bottom: 6px; }
.auth-form .form-control { border-radius: 10px; border-color: #dee2e6; padding: 10px 14px; font-size: 0.95rem; }
.auth-form .input-group-text { background: #f8f9fa; border-color: #dee2e6; color: #6c757d; }
.btn-auth { border-radius: 12px; padding: 13px; font-weight: 700; font-size: 1rem; background: var(--primary); border: none; }
.btn-auth:hover { background: var(--primary-dark); }
.auth-footer { text-align: center; margin-top: 20px; color: #6c757d; font-size: 0.9rem; }

/* =============================================
   DASHBOARD
   ============================================= */
.dashboard-header {
  background: linear-gradient(135deg, var(--primary) 0%, #1a1a6e 100%);
  padding: 60px 20px 40px;
}
.balance-card { border-radius: var(--border-radius); box-shadow: var(--card-shadow-lg); }
.balance-card-gradient { background: linear-gradient(135deg, var(--primary) 0%, #1a1a6e 100%); border-radius: var(--border-radius); box-shadow: var(--card-shadow-lg); }
.balance-card .card-body { padding: 20px; }

.stat-card { border-radius: var(--border-radius); }
.stat-card .card-body { padding: 16px; }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 10px; }
.stat-value { font-size: 1.1rem; font-weight: 700; color: #1a1a2e; margin-bottom: 2px; }
.stat-label { font-size: 0.75rem; color: #9ca3af; }

.bg-primary-soft { background: #eef2ff; }
.bg-success-soft { background: #d3f9d8; }
.bg-danger-soft { background: #ffe3e3; }
.bg-warning-soft { background: #fff3cd; }
.bg-info-soft { background: #d0ebff; }
.bg-purple-soft { background: #f3d9fa; }
.text-purple { color: #7950f2; }

.section-title { font-weight: 700; font-size: 1rem; color: #1a1a2e; margin-bottom: 12px; }
.investment-card { border-radius: var(--border-radius); box-shadow: var(--card-shadow); }
.investment-card .card-body { padding: 14px; }

.quick-link { display: block; text-decoration: none; }
.quick-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin: 0 auto 6px; }
.quick-label { font-size: 0.75rem; color: #495057; font-weight: 500; }

/* =============================================
   DEPOSIT PAGE
   ============================================= */
.deposit-header { background: white; padding-top: calc(var(--topbar-height) + 8px) !important; }
.deposit-tabs { background: #f0f2f8; border-radius: 50px; }
.tab-btn { padding: 10px 20px; font-weight: 600; background: transparent; border: none; color: #6c757d; transition: all 0.2s; border-radius: 50px; cursor: pointer; }
.tab-btn.active { background: white; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.filter-scroll { -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-chip { white-space: nowrap; padding: 6px 16px; background: #f0f2f8; border: none; border-radius: 50px; font-size: 0.85rem; font-weight: 500; color: #495057; cursor: pointer; transition: all 0.2s; }
.filter-chip.active { background: var(--primary); color: white; }

.package-card { border-radius: var(--border-radius); box-shadow: var(--card-shadow); transition: transform 0.2s; }
.package-card:active { transform: scale(0.98); }
.rupee-icon { width: 44px; height: 44px; background: var(--primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 1.3rem; }
.package-badge { background: #e8f4fd; color: #1971c2; font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; display: inline-block; }

.wallet-address-box { background: #f8f9fa; border-radius: 10px; padding: 12px; }
.qr-preview { max-width: 180px; border-radius: 10px; }
.qr-modal-img { max-width: 220px; border-radius: 12px; border: 2px solid #dee2e6; }
.fab-search { position: fixed; bottom: 85px; right: 20px; width: 52px; height: 52px; background: var(--primary); border: none; border-radius: 50%; color: white; font-size: 1.3rem; box-shadow: 0 4px 16px rgba(59,91,219,0.4); z-index: 100; display: flex; align-items: center; justify-content: center; }

/* =============================================
   HISTORY PAGES
   ============================================= */
.history-tab { color: rgba(255,255,255,0.7); font-size: 0.95rem; position: relative; transition: color 0.2s; }
.history-tab.active { color: white; }
.history-tab.active::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 40px; height: 3px; background: white; border-radius: 2px; }
.history-card { border-radius: var(--border-radius); box-shadow: var(--card-shadow); }
.empty-state { padding: 60px 20px; }

/* =============================================
   TEAM PAGE
   ============================================= */
.team-header { background: linear-gradient(135deg, var(--primary) 0%, #1a1a6e 100%); }
.team-stat-card { border-radius: var(--border-radius); }
.commission-card { background: linear-gradient(135deg, var(--primary) 0%, #1a1a6e 100%); border-radius: var(--border-radius-lg); }
.text-white-75 { color: rgba(255,255,255,0.75) !important; }

.share-btn {
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; border: none; cursor: pointer; text-decoration: none; transition: transform 0.2s;
}
.share-btn:active { transform: scale(0.9); }
.share-btn.fb { background: #eef4ff; color: #1877f2; }
.share-btn.tg { background: #e3f2fd; color: #229ed9; }
.share-btn.wa { background: #e8f5e9; color: #25d366; }
.share-btn.qr { background: #f3e5f5; color: #7b1fa2; }
.share-btn.share { background: #fce4ec; color: #e91e63; }

.member-card { border-radius: 10px; }

/* =============================================
   ASSETS PAGE
   ============================================= */
.assets-header { background: linear-gradient(135deg, var(--primary) 0%, #1a1a6e 100%); }
.avatar-circle { position: relative; }
.avatar-placeholder { width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 1.1rem; border: 2px solid rgba(255,255,255,0.4); }
.balance-summary-card { background: linear-gradient(135deg, var(--primary) 0%, #1a1a6e 100%); border-radius: var(--border-radius); }

.btn-white { background: white; color: var(--primary); border: none; }
.btn-white:hover { background: #f0f2f8; }

/* =============================================
   ADMIN PANEL
   ============================================= */
.admin-sidebar { width: 260px; background: #1a1a2e; min-height: 100vh; position: fixed; left: 0; top: 0; z-index: 100; transition: transform 0.3s; }
.admin-sidebar.collapsed { transform: translateX(-260px); }
.admin-main { margin-left: 260px; min-height: 100vh; background: #f0f2f8; transition: margin 0.3s; }
.admin-main.expanded { margin-left: 0; }
.sidebar-brand { padding: 20px; background: rgba(255,255,255,0.05); }
.sidebar-brand h4 { color: white; font-weight: 800; margin: 0; }
.sidebar-nav { padding: 16px 0; }
.sidebar-nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; color: rgba(255,255,255,0.65); text-decoration: none;
  font-size: 0.9rem; font-weight: 500; transition: all 0.2s; border-left: 3px solid transparent;
}
.sidebar-nav-link:hover, .sidebar-nav-link.active { color: white; background: rgba(255,255,255,0.1); border-left-color: white; }
.sidebar-nav-link i { font-size: 1.1rem; width: 20px; }
.sidebar-section { padding: 12px 20px 6px; color: rgba(255,255,255,0.35); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.admin-topbar { background: white; height: 60px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.admin-content { padding: 24px; }
.admin-stat-card { border-radius: var(--border-radius); box-shadow: var(--card-shadow); border: none; }
.admin-stat-card .stat-icon-lg { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }

@media (max-width: 992px) {
  .admin-sidebar { transform: translateX(-260px); }
  .admin-sidebar.mobile-open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container-custom { position: fixed; top: 70px; right: 16px; z-index: 9999; }
.toast-custom {
  min-width: 280px; max-width: 340px; background: white; border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15); padding: 14px 16px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px; font-size: 0.9rem;
  animation: slideIn 0.3s ease; border-left: 4px solid var(--primary);
}
.toast-custom.success { border-color: var(--success); }
.toast-custom.error { border-color: var(--danger); }
.toast-custom.warning { border-color: var(--warning); }
.toast-custom-icon { font-size: 1.3rem; flex-shrink: 0; }
@keyframes slideIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100%); } }
.toast-custom.hiding { animation: slideOut 0.3s ease forwards; }

/* =============================================
   UTILITIES
   ============================================= */
.letter-spacing { letter-spacing: 6px; }
.rounded-pill-lg { border-radius: 50px; }
.fw-700 { font-weight: 700; }
.fs-tiny { font-size: 0.7rem; }
.text-muted-sm { color: #9ca3af; font-size: 0.8rem; }
.card { border-radius: var(--border-radius); }
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); }
.form-control, .form-select { border-radius: 10px; border-color: #dee2e6; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,91,219,0.15); }
.input-group .form-control { border-radius: 0; }
.input-group .form-control:first-child { border-radius: 10px 0 0 10px; }
.input-group .form-control:last-child { border-radius: 0 10px 10px 0; }
.badge { font-weight: 600; }
.spinner-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999; display: flex; align-items: center; justify-content: center; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 2px; }
