@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
  --bg-base: #050507;
  --bg-surface: #111216;
  --bg-glass: rgba(20, 21, 26, 0.6);
  --gold-primary: #D4AF37;
  --gold-light: #F3E5AB;
  --gold-dark: #AA771C;
  --gold-gradient: linear-gradient(135deg, #AA771C 0%, #D4AF37 25%, #F3E5AB 50%, #D4AF37 75%, #AA771C 100%);
  --gold-gradient-hover: linear-gradient(135deg, #F3E5AB 0%, #D4AF37 25%, #AA771C 50%, #D4AF37 75%, #F3E5AB 100%);
  --gold-glow: 0 4px 20px rgba(212, 175, 55, 0.4);
  --gold-glow-intense: 0 0 30px rgba(212, 175, 55, 0.6);
  
  --platinum-gradient: linear-gradient(135deg, #888888 0%, #E5E4E2 25%, #FFFFFF 50%, #E5E4E2 75%, #B0B0B0 100%);
  --platinum-glow: 0 4px 20px rgba(229, 228, 226, 0.4);
  
  --text-main: #FFFFFF;
  --text-secondary: #A0A0B0;
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(212, 175, 55, 0.3);
  
  --success: #00E676;
  --success-bg: rgba(0, 230, 118, 0.1);
  --danger: #FF1744;
  --danger-bg: rgba(255, 23, 68, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  justify-content: center;
}

/* Mobile App Container Constraint for Desktop view */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--bg-base);
  position: relative;
  overflow-x: hidden;
  padding-bottom: 90px; /* Space for bottom nav */
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

/* Typography & Utilities */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
}

.gold-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  background-size: 200% auto;
  animation: shine 3s linear infinite;
}

.platinum-text {
  background: var(--platinum-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

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

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Glassmorphism Panels */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Buttons */
.btn {
  display: block;
  width: 100%;
  padding: 1rem;
  border-radius: 14px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-gold {
  background: var(--gold-gradient);
  color: var(--bg-base);
  box-shadow: var(--gold-glow);
  background-size: 200% auto;
}

.btn-gold:hover, .btn-gold:active {
  background-position: right center;
  transform: translateY(-2px);
  box-shadow: var(--gold-glow-intense);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-glass);
}

.btn-outline:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

/* Form Inputs */
.form-group {
  margin-bottom: 1.2rem;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 1rem 1.2rem;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
  background: rgba(212, 175, 55, 0.02);
}

/* Floating Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 440px;
  height: 70px;
  background: rgba(15, 15, 20, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 35px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
}

.nav-item i {
  font-size: 1.3rem;
  margin-bottom: 4px;
  transition: all 0.3s ease;
}

.nav-item span {
  font-size: 0.65rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-item.active {
  color: var(--gold-primary);
}

.nav-item.active i {
  transform: translateY(-4px);
  text-shadow: var(--gold-glow);
}

.nav-item.active span {
  opacity: 1;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--gold-primary);
  border-radius: 50%;
  box-shadow: var(--gold-glow);
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  position: sticky;
  top: 0;
  background: rgba(5, 5, 7, 0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: all 0.3s;
}

.hamburger span:nth-child(2) { width: 18px; }

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold-gradient);
  padding: 2px;
  position: relative;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-base);
}

/* Balance Card */
.balance-card {
  margin: 0 1.5rem;
  padding: 1.5rem;
  border-radius: 24px;
  background: url('https://www.transparenttextures.com/patterns/carbon-fibre.png'), linear-gradient(135deg, #1A1A1A 0%, #0A0A0A 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.05);
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent 0%, rgba(212, 175, 55, 0.1) 25%, transparent 50%);
  animation: rotate 10s linear infinite;
  pointer-events: none;
}

.balance-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

.balance-amount {
  font-size: 2.5rem;
  font-weight: 800;
  position: relative;
  z-index: 2;
  letter-spacing: -1px;
}

.balance-currency {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gold-primary);
  vertical-align: super;
}

.card-chip {
  width: 40px;
  height: 30px;
  background: linear-gradient(135deg, #e5e4e2, #b0b0b0);
  border-radius: 6px;
  position: relative;
  z-index: 2;
  opacity: 0.8;
}

/* Animations */
@keyframes shine {
  to { background-position: 200% center; }
}

@keyframes rotate {
  100% { transform: rotate(360deg); }
}

/* Platinum Ticket UI */
.ticket-premium {
  background: url('https://www.transparenttextures.com/patterns/brushed-alum.png'), var(--platinum-gradient);
  border-radius: 16px;
  padding: 2px;
  position: relative;
  box-shadow: var(--platinum-glow);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.ticket-inner {
  background: rgba(10, 10, 12, 0.95);
  border-radius: 14px;
  padding: 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed rgba(255,255,255,0.2);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.ticket-logo {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 2px;
}

.ticket-price {
  background: rgba(255,255,255,0.1);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
}

.ticket-body {
  display: flex;
  justify-content: space-between;
}

.ticket-barcode {
  width: 100%;
  height: 40px;
  background: repeating-linear-gradient(
    90deg,
    #fff,
    #fff 2px,
    transparent 2px,
    transparent 4px,
    #fff 4px,
    #fff 5px,
    transparent 5px,
    transparent 8px
  );
  opacity: 0.5;
  margin-top: 1rem;
}

/* Bottom Sheet */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  padding: 2rem;
  z-index: 2000;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
  border-top: 1px solid var(--border-gold);
}

.bottom-sheet.open {
  transform: translateX(-50%) translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  margin: 0 auto 1.5rem auto;
}

.sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Dashboard Sections */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2rem 1.5rem 1rem 1.5rem;
}

.section-title h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.view-all {
  color: var(--gold-primary);
  font-size: 0.85rem;
  text-decoration: none;
}

/* Active Lottery Card */
.active-lottery-card {
  margin: 0 1.5rem;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.active-lottery-card img {
  width: 100%;
  height: auto;
  display: block;
}

.lottery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
}

.countdown-timer {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.time-box {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 8px;
  border-radius: 8px;
  text-align: center;
  min-width: 50px;
  backdrop-filter: blur(5px);
}

.time-box span {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold-primary);
  text-shadow: 0 0 10px rgba(212,175,55,0.5);
}

.time-box label {
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Country Select */
.country-select-wrapper {
  display: flex;
  gap: 10px;
}

.country-select {
  width: 100px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  border-radius: 12px;
  padding: 0 10px;
  outline: none;
}

/* Referral Tree */
.tree-node {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  position: relative;
  margin: 0 auto;
  width: fit-content;
  min-width: 120px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.tree-node.root {
  border-color: var(--gold-primary);
  box-shadow: var(--gold-glow);
}

.tree-level {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
  position: relative;
}

.tree-level::before {
  content: '';
  position: absolute;
  top: -2rem;
  left: 50%;
  width: 2px;
  height: 2rem;
  background: rgba(255,255,255,0.1);
}

.tree-level .tree-node::before {
  content: '';
  position: absolute;
  top: -1rem;
  left: 50%;
  width: 2px;
  height: 1rem;
  background: rgba(255,255,255,0.1);
}

.tree-line-horizontal {
  position: absolute;
  top: -1rem;
  left: 25%;
  width: 50%;
  height: 2px;
  background: rgba(255,255,255,0.1);
}

/* Wallet History */
.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-glass);
}

.tx-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tx-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.tx-icon.income { background: var(--success-bg); color: var(--success); }
.tx-icon.expense { background: var(--danger-bg); color: var(--danger); }

.tx-amount.income { color: var(--success); }
.tx-amount.expense { color: var(--text-main); }

/* Sidebar Navigation */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: var(--bg-surface);
  z-index: 3000;
  transition: left 0.3s ease;
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
}

.sidebar.active {
  left: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.sidebar-close {
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 5px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 1.1rem;
  padding: 12px 15px;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-primary);
}
