/* ========== WALLET PAGE STYLES ========== */

/* CSS Variables (matching your system) */
:root {
  --primary: #FF6B35;
  --primary-light: #FF8C5A;
  --primary-dark: #E05A2B;
  --primary-extra-light: #FFF3EF;
  
  --secondary: #4299E1;
  --secondary-light: #63B3ED;
  --secondary-dark: #3182CE;
  
  --success: #48BB78;
  --success-light: #68D391;
  --success-dark: #38A169;
  
  --warning: #F6AD55;
  --warning-light: #FBD38D;
  --warning-dark: #ED8936;
  
  --error: #F56565;
  --error-light: #FC8181;
  --error-dark: #E53E3E;
  
  --text-primary: #2D3748;
  --text-secondary: #4A5568;
  --text-tertiary: #718096;
  --text-quaternary: #A0AEC0;
  
  --background: #F7FAFC;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== LOADING SCREEN ========== */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  text-align: center;
  color: var(--text-primary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

/* ========== MAIN LAYOUT ========== */
.wallet-container {
  min-height: 100vh;
  background: var(--background);
  padding: 2rem 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ========== WALLET HEADER ========== */
.wallet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.wallet-title h1 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 2.5rem;
  font-weight: 700;
}

.wallet-title h1 i {
  color: var(--primary);
}

.wallet-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.wallet-actions {
  display: flex;
  gap: 1rem;
}

/* ========== BALANCE SECTION ========== */
.balance-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.balance-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { transform: translateX(-100%) translateY(-100%); }
  50% { transform: translateX(0%) translateY(0%); }
}

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

.balance-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  opacity: 0.9;
}

.balance-icon {
  font-size: 2rem;
  opacity: 0.8;
}

.balance-amount {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.balance-info {
  opacity: 0.8;
}

.balance-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-extra-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  flex-shrink: 0;
}

.stat-content h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ========== QUICK ACTIONS ========== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.action-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.action-btn:hover {
  background: var(--primary-extra-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.action-btn i {
  font-size: 1.2rem;
}

.action-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ========== CONTENT SECTIONS ========== */
.wallet-content {
  margin-top: 2rem;
}

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

.section-header h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
}

.section-header h2 i {
  color: var(--primary);
}

/* ========== TRANSACTIONS ========== */
.transactions-list {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

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

.transaction-item:hover {
  background: var(--background);
}

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

.transaction-icon.earning {
  background: rgba(72, 187, 120, 0.1);
  color: var(--success);
}

.transaction-icon.withdrawal {
  background: rgba(245, 101, 101, 0.1);
  color: var(--error);
}

.transaction-details {
  flex: 1;
}

.transaction-details h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.transaction-date {
  margin: 0 0 0.25rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.transaction-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.transaction-amount {
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.transaction-amount.earning {
  color: var(--success);
}

.transaction-amount.withdrawal {
  color: var(--error);
}

/* ========== WITHDRAWAL HISTORY ========== */
.withdrawal-list {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.withdrawal-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

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

.withdrawal-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.withdrawal-status.completed {
  background: rgba(72, 187, 120, 0.1);
  color: var(--success);
}

.withdrawal-status.pending {
  background: rgba(246, 173, 85, 0.1);
  color: var(--warning);
}

.withdrawal-details {
  flex: 1;
}

.withdrawal-details h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.withdrawal-details p {
  margin: 0 0 0.25rem 0;
  color: var(--text-secondary);
}

.withdrawal-details small {
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

/* ========== PAYMENT METHODS ========== */
.payment-methods-list {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.payment-method-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

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

.payment-method-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-extra-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  flex-shrink: 0;
}

.payment-method-details {
  flex: 1;
}

.payment-method-details h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.payment-method-details p {
  margin: 0 0 0.25rem 0;
  color: var(--text-secondary);
}

.payment-method-details small {
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

.payment-method-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ========== MODALS ========== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal.show .modal-content {
  transform: scale(1);
}

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

.modal-header h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
}

.modal-header h2 i {
  color: var(--primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--background);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--surface);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.amount-input-group {
  position: relative;
}

.currency-symbol {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: var(--text-secondary);
  z-index: 10;
}

.amount-input-group input {
  padding-left: 2rem;
}

.form-help {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

/* ========== PAYMENT METHOD OPTIONS ========== */
.payment-method-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.payment-option {
  background: var(--surface);
  border: 2px solid var(--border);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.payment-option:hover {
  border-color: var(--primary);
  background: var(--primary-extra-light);
}

.payment-option.selected {
  border-color: var(--primary);
  background: var(--primary-extra-light);
  color: var(--primary);
}

.payment-option i {
  font-size: 2rem;
}

.method-form {
  display: none;
}

.method-form.active {
  display: block;
}

/* ========== WITHDRAWAL INFO ========== */
.withdrawal-info {
  background: var(--background);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1.5rem 0;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-item i {
  color: var(--primary);
  font-size: 1rem;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
  line-height: 1.5;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--background);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: var(--error-dark);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.toast {
  background: var(--surface);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 300px;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--error);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast-icon {
  font-size: 1.2rem;
  color: var(--primary);
}

.toast.success .toast-icon {
  color: var(--success);
}

.toast.error .toast-icon {
  color: var(--error);
}

.toast.warning .toast-icon {
  color: var(--warning);
}

.toast-message {
  flex: 1;
  font-weight: 500;
}

.toast-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: var(--transition);
}

.toast-close:hover {
  background: var(--background);
  color: var(--text-primary);
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .wallet-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .wallet-title {
    text-align: center;
  }

  .wallet-actions {
    justify-content: center;
  }

  .balance-section {
    grid-template-columns: 1fr;
  }

  .balance-amount {
    font-size: 2.5rem;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .payment-method-options {
    grid-template-columns: 1fr;
  }

  .payment-method-actions {
    flex-direction: column;
  }

  .transaction-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .transaction-amount {
    align-self: flex-end;
  }

  .withdrawal-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .payment-method-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .payment-method-actions {
    align-self: stretch;
  }
}

@media (max-width: 480px) {
  .wallet-container {
    padding: 1rem 0;
  }

  .container {
    padding: 0 0.5rem;
  }

  .wallet-title h1 {
    font-size: 2rem;
  }

  .balance-amount {
    font-size: 2rem;
  }

  .modal-content {
    width: 95%;
  }

  .toast-container {
    right: 1rem;
    left: 1rem;
  }

  .toast {
    min-width: auto;
  }
}

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

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-up {
  animation: slideInUp 0.5s ease-out;
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus states for keyboard navigation */
.btn:focus,
.action-btn:focus,
.payment-option:focus,
input:focus,
select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: #000000;
    --text-tertiary: #000000;
  }
}
