/* Base Design System for Giftcard & Crypto Trading App */

/* Color Variables */
:root {
  /* Primary Colors */
  --primary: #6200ee;
  --primary-dark: #3700b3;
  --primary-light: #bb86fc;
  
  /* Secondary Colors */
  --secondary: #03dac6;
  --secondary-dark: #018786;
  
  /* Accent Colors */
  --accent: #ff9e00;
  --accent-dark: #e68a00;
  
  /* Neutrals */
  --background: #f5f5f5;
  --surface: #ffffff;
  --error: #b00020;
  
  /* Text Colors */
  --text-primary: #212121;
  --text-secondary: #757575;
  --text-disabled: #9e9e9e;
  --text-on-primary: #ffffff;
  --text-on-secondary: #000000;
  
  /* Status Colors */
  --success: #4caf50;
  --warning: #ff9800;
  --info: #2196f3;
  --error: #f44336;
  
  /* Crypto-specific Colors */
  --bitcoin: #f7931a;
  --ethereum: #627eea;
  --usdt: #26a17b;
  
  /* Shadows */
  --shadow-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  --shadow-2: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
  --shadow-3: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-pill: 500px;
  
  /* Font Sizes */
  --font-xs: 12px;
  --font-sm: 14px;
  --font-md: 16px;
  --font-lg: 18px;
  --font-xl: 20px;
  --font-xxl: 24px;
  --font-xxxl: 32px;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  color: var(--text-primary);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}

/* Typography */
h1 {
  font-size: var(--font-xxxl);
  font-weight: 700;
  margin-bottom: var(--spacing-md);
}

/* Alert Messages */
.alert {
  padding: var(--spacing-md);
  margin: var(--spacing-md);
  border-radius: var(--radius-md);
  font-weight: 500;
  border: 1px solid transparent;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
  border-color: #ffeaa7;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-color: #bee5eb;
}

h2 {
  font-size: var(--font-xxl);
  font-weight: 700;
  margin-bottom: var(--spacing-md);
}

h3 {
  font-size: var(--font-xl);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

h4 {
  font-size: var(--font-lg);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

p {
  font-size: var(--font-md);
  line-height: 1.5;
  margin-bottom: var(--spacing-md);
}

.text-small {
  font-size: var(--font-sm);
}

.text-xs {
  font-size: var(--font-xs);
}

/* Layout */
.container {
  width: 100%;
  max-width: 480px; /* Mobile-first approach */
  margin: 0 auto;
  padding: var(--spacing-md);
}

.screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Cards */
.card {
  background-color: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  box-shadow: var(--shadow-1);
}

.card-elevated {
  box-shadow: var(--shadow-2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: var(--font-md);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  outline: none;
}

.btn-primary {
  background-color: #1e293b;
  color: white;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: #0f172a;
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--text-on-secondary);
}

.btn-secondary:hover, .btn-secondary:focus {
  background-color: var(--secondary-dark);
}

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

.btn-outline:hover, .btn-outline:focus {
  background-color: rgba(98, 0, 238, 0.1);
}

.btn-block {
  display: block;
  width: 100%;
}

/* Form Elements */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: var(--spacing-md);
  border: 1px solid #ddd;
  border-radius: var(--radius-md);
  font-size: var(--font-md);
  transition: border 0.3s ease;
}

.form-input:focus {
  border-color: var(--primary);
  outline: none;
}

/* Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--surface);
  display: flex;
  justify-content: space-around;
  padding: var(--spacing-sm) 0;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-sm);
  color: var(--text-secondary);
  text-decoration: none;
}

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

.nav-icon {
  font-size: 24px;
  margin-bottom: var(--spacing-xs);
}

.nav-text {
  font-size: var(--font-xs);
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
  background-color: var(--surface);
  box-shadow: var(--shadow-1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-title {
  font-size: var(--font-lg);
  font-weight: 600;
}

/* Lists */
.list {
  list-style: none;
}

.list-item {
  padding: var(--spacing-md);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
}

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

/* Utilities */
.flex {
  display: flex;
}

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

.justify-between {
  justify-content: space-between;
}

.align-center {
  align-items: center;
}

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

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }

/* Status badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--font-xs);
  font-weight: 500;
}

.badge-success {
  background-color: var(--success);
  color: white;
}

.badge-warning {
  background-color: var(--warning);
  color: white;
}

.badge-info {
  background-color: var(--info);
  color: white;
}

/* Crypto specific styles */
.crypto-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: var(--spacing-sm);
}

.giftcard-logo {
  width: 48px;
  height: 32px;
  object-fit: contain;
  margin-right: var(--spacing-sm);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Mobile-specific adjustments */
@media (max-width: 480px) {
  .container {
    padding: var(--spacing-sm);
  }
  
  h1 {
    font-size: var(--font-xxl);
  }
  
  h2 {
    font-size: var(--font-xl);
  }
}

/* Profile Avatar Styles */
.profile-avatar {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-2);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-avatar.fallback::before {
  content: '\f007';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  font-size: 48px;
  color: var(--text-on-primary);
}

.profile-avatar .edit-avatar {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 16px;
  box-shadow: var(--shadow-1);
  transition: all 0.3s ease;
}

.profile-avatar .edit-avatar:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

.profile-avatar .edit-avatar.loading {
  background: var(--info);
  pointer-events: none;
}

.profile-avatar .refresh-avatar {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  background: var(--secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 14px;
  box-shadow: var(--shadow-1);
  transition: all 0.3s ease;
}

.profile-avatar .refresh-avatar:hover {
  background: var(--secondary-dark);
  transform: scale(1.1);
}

.profile-avatar .verification-badge {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  box-shadow: var(--shadow-1);
}

.profile-avatar.updating {
  opacity: 0.7;
  pointer-events: none;
}

.profile-avatar.success {
  animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Profile Header Styles */
.profile-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.profile-name {
  font-size: var(--font-xxl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.profile-email {
  font-size: var(--font-md);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
}

.profile-phone,
.profile-location,
.profile-joined,
.profile-verified {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
}

/* Profile Stats */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
}

.stat-item {
  text-align: center;
  padding: var(--spacing-md);
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}

.stat-value {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

/* Transaction Stats */
.transaction-stats {
  margin: var(--spacing-lg) 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.stat-item-small {
  text-align: center;
  padding: var(--spacing-sm);
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
}

.stat-value-small {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--primary);
}

.stat-label-small {
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

.earnings-display {
  text-align: center;
  padding: var(--spacing-md);
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}

.earnings-label {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
}

.earnings-amount {
  font-size: var(--font-xxl);
  font-weight: 700;
  color: var(--success);
}