/* ============================================================
   Likat × Salla App — RTL Arabic Design
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:     #5B4FE9;
  --primary-dk:  #4338CA;
  --primary-lt:  #EEF2FF;
  --success:     #10B981;
  --success-lt:  #D1FAE5;
  --warning:     #F59E0B;
  --warning-lt:  #FEF3C7;
  --danger:      #EF4444;
  --danger-lt:   #FEE2E2;
  --gray-50:     #F9FAFB;
  --gray-100:    #F3F4F6;
  --gray-200:    #E5E7EB;
  --gray-400:    #9CA3AF;
  --gray-600:    #4B5563;
  --gray-800:    #1F2937;
  --white:       #FFFFFF;
  --radius:      12px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow:      0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.14);
  --transition:  0.2s cubic-bezier(0.4,0,0.2,1);
}

html { direction: rtl; font-size: 15px; }

body {
  font-family: 'Cairo', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Layout ───────────────────────────────────────────────── */
.app-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  padding: 24px;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-100);
}

.card-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: var(--primary-lt);
}

.card-title { font-size: 1.1rem; font-weight: 700; color: var(--gray-800); }
.card-subtitle { font-size: 0.82rem; color: var(--gray-400); }

/* ── Top Bar ──────────────────────────────────────────────── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%);
  color: white;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.top-bar .logo { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.5px; }
.top-bar .logo span { opacity: 0.7; margin: 0 6px; }
.top-bar .store-badge {
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ── Balance Card ─────────────────────────────────────────── */
.balance-card {
  background: linear-gradient(135deg, #5B4FE9 0%, #8B5CF6 100%);
  color: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.balance-card::after {
  content: '';
  position: absolute;
  top: -40px; left: -40px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.balance-label { font-size: 0.82rem; opacity: 0.8; margin-bottom: 6px; }
.balance-amount { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.balance-currency { font-size: 1rem; opacity: 0.8; margin-right: 6px; }
.balance-refresh {
  position: absolute;
  top: 16px; left: 16px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  font-size: 0.82rem;
  transition: var(--transition);
}
.balance-refresh:hover { background: rgba(255,255,255,0.25); }

/* ── Status Badge ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-success { background: var(--success-lt); color: var(--success); }
.badge-warning { background: var(--warning-lt); color: var(--warning); }
.badge-danger  { background: var(--danger-lt);  color: var(--danger);  }
.badge-primary { background: var(--primary-lt); color: var(--primary); }

/* ── Form Elements ────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
  direction: ltr;
  text-align: right;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,79,233,0.12);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 6px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dk); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

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

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #0EA271; }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-block { width: 100%; }

/* ── Service Cards ────────────────────────────────────────── */
.service-grid { display: grid; gap: 12px; }

.service-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.service-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,79,233,0.08);
  transform: translateY(-1px);
}

.service-card.selected {
  border-color: var(--primary);
  background: var(--primary-lt);
}

.service-card .service-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--gray-800);
}

.service-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.meta-chip {
  background: var(--gray-100);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.76rem;
  color: var(--gray-600);
}

.service-category {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}

.service-check {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}

.service-card.selected .service-check {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: var(--success-lt); color: #065F46; }
.alert-danger   { background: var(--danger-lt);  color: #991B1B; }
.alert-warning  { background: var(--warning-lt); color: #92400E; }
.alert-info     { background: var(--primary-lt); color: #3730A3; }

/* ── Loading ──────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-dark {
  border-color: rgba(0,0,0,0.1);
  border-top-color: var(--primary);
}

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
  color: var(--gray-400);
}

/* ── Section Header ───────────────────────────────────────── */
.section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-400);
  margin-bottom: 12px;
}

/* ── Divider ──────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--gray-100); margin: 16px 0; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Hidden ───────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .app-container { padding: 12px 10px; }
  .card { padding: 16px; }
  .balance-amount { font-size: 1.8rem; }
}
