:root {
  --bg-main: #0f172a;
  --bg-secondary: #1e293b;
  --accent-primary: #10b981;
  /* Emerald 500 */
  --accent-hover: #34d399;
  /* Emerald 400 */
  --accent-danger: #ef4444;
  /* Red 500 */
  --text-main: #ffffff;
  --text-muted: #94a3b8;

  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.05);

  --sidebar-width: 280px;
  --header-height: 80px;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'IBM Plex Sans Condensed', sans-serif;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  background-image:
    radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(56, 189, 248, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  font-weight: 300;
  height: 100vh;
  overflow: hidden;
  line-height: 1.5;
}

/* Layout */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  position: relative;
  z-index: 50;
  transition: var(--transition);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.logo {
  height: 50px;
}

.close-sidebar-btn {
  display: none;
  /* Mobile only */
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

.user-mini-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--glass-highlight);
  border-radius: 1rem;
  margin-bottom: 2rem;
  border: 1px solid var(--glass-border);
}

.avatar-circle {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent-primary);
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.user-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

/* Navigation Links */
.nav-links {
  list-style: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-links li a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.05rem;
}

.nav-links li a:hover {
  background: var(--glass-highlight);
  color: var(--text-main);
}

.nav-links li.active a {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.sidebar-footer {
  margin-top: auto;
}

.logout-btn {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
  font-family: var(--font-heading);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: translateY(-2px);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.top-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(5px);
}

.menu-btn {
  display: none;
  /* Mobile only */
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  margin-right: 1rem;
}

.page-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.5px;
}

.balance-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.balance-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #FDE047 0%, #EAB308 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #422006;
  font-size: 0.9rem;
}

.balance-info {
  display: flex;
  flex-direction: column;
}

.balance-info span {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.balance-amount {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
}

.add-money-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent-primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.add-money-btn:hover {
  background: var(--accent-hover);
  transform: rotate(90deg);
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  position: relative;
}

/* Scrollbar Styling */
.content-area::-webkit-scrollbar {
  width: 8px;
}

.content-area::-webkit-scrollbar-track {
  background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Loading & Empty States */
.loading-container,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(16, 185, 129, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state img {
  width: 120px;
  opacity: 0.5;
  margin-bottom: 1rem;
  filter: grayscale(100%);
}

.hidden {
  display: none !important;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

input,
select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  color: white;
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

input:focus,
select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Buttons */
.btn-primary {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.full-width {
  width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: 100%;
    transition: left 0.3s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .close-sidebar-btn {
    display: block;
  }

  .menu-btn {
    display: block;
  }

  .top-header {
    padding: 0 1rem;
  }

  .content-area {
    padding: 1rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* =========================================
   WITHDRAW / TOPUP SPECIFIC STYLES
   ========================================= */

.withdraw-container {
  max-width: 1000px;
  margin: 0 auto;
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.payment-card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.payment-card:hover {
  transform: translateY(-4px);
  background: var(--glass-highlight);
  border-color: rgba(255, 255, 255, 0.2);
}

.payment-card.selected {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.payment-card.selected .check-icon {
  opacity: 1;
  transform: scale(1);
  top: 10px;
  right: 10px;
}

.payment-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 1rem;
  object-fit: contain;
}

.payment-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.payment-fee {
  font-size: 0.9rem;
  color: var(--accent-primary);
}

.check-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent-primary);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  opacity: 0;
  transform: scale(0);
  transition: var(--transition);
}

/* Withdraw Form */
.withdraw-form-container {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto;
  display: none;
  /* Hidden by default until method selected */
  animation: fadeIn 0.3s forwards;
}

.withdraw-form-container.active {
  display: block;
}

.selected-method-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.commission-alert {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-primary);
  padding: 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 500;
}

.amount-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.input-label-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Amount Buttons Grid */
.amount-buttons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.amount-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 1.5rem;
  border-radius: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.amount-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transform: translateX(-100%);
  transition: 0.5s;
}

.amount-btn:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.amount-btn:hover::before {
  transform: translateX(100%);
}

.amount-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

/* Responsive adjustments */
@media (max-width: 500px) {
  .amount-buttons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}