/* 
 * ATHAR - Digital Sanctuary Design System 
 * Theme: Athar Professional (Digital Spirituality / Modern Zen)
 */

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

:root {
  /* ── Colors: Deep Dark Mode ── */
  --bg-deep: #0a0f1a;
  --bg-subtle: #0f172a;
  --bg-surface: #1e293b;

  /* ── Colors: Accents ── */
  --accent-primary: #10b981;
  /* Emerald Green */
  --accent-glow: rgba(16, 185, 129, 0.4);
  --accent-gold: #f59e0b;
  /* Golden Amber */
  --accent-gold-glow: rgba(245, 158, 11, 0.4);

  /* ── Colors: Text ── */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;

  /* ── Glassmorphism ── */
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-highlight: rgba(255, 255, 255, 0.03);
  --backdrop-blur: 16px;

  /* ── Spacing & Layout ── */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 24px;
  /* Updated for cards */

  --header-height: 70px;
  --nav-height: 80px;

  /* ── Fonts ── */
  --font-heading: 'Readex Pro', sans-serif;
  --font-body: 'Readex Pro', sans-serif;
  --font-quran: 'Amiri', serif;
}

/* ── Reset & Base ── */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  /* Subtle Grain & Gradient Background */
  background-image:
    radial-gradient(circle at 50% -20%, rgba(16, 185, 129, 0.1) 0%, transparent 60%),
    radial-gradient(circle at 0% 100%, rgba(15, 23, 42, 0.5) 0%, transparent 40%);
  background-attachment: fixed;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

/* ── Layout ── */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px 100px 20px;
  min-height: 100vh;
  position: relative;
}

/* ── Header ── */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-height);
  padding-top: 10px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.app-logo img {
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.2));
}

.header-stats {
  display: flex;
  gap: 8px;
}

.stat-badge {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 6px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* ── Welcome Banner (Premium Glow) ── */
.welcome-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.welcome-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
  pointer-events: none;
  animation: pulseGlow 10s infinite alternate;
}

@keyframes pulseGlow {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(5%, 5%) scale(1.1);
  }
}

.welcome-emoji {
  margin-bottom: 12px;
}

.welcome-text {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.welcome-text span {
  color: var(--accent-primary);
  font-weight: 700;
  text-shadow: 0 0 10px var(--accent-glow);
}

.welcome-sub {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 15px;
}

/* Progress Bar in Banner */
.level-progress-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  width: 80%;
  margin: 0 auto;
}

.level-progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent-primary), #34d399);
  box-shadow: 0 0 8px var(--accent-glow);
  transition: width 1s ease-out;
}

/* ── Feed Cards (Stitch Style) ── */
.feed-card {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  position: relative;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.2, 0, 0.2, 1);
}

.feed-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.1);
}

.card-type-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-type-badge.ayah {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-primary);
}

.card-type-badge.hadith {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-gold);
}

.card-type-badge.reflection {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}

/* Ayah Card Special Styling */
.feed-card.ayah-card {
  text-align: center;
  /* Islamic Pattern Background */
  background-image:
    linear-gradient(rgba(30, 41, 59, 0.95), rgba(30, 41, 59, 0.95)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l15 30-15 30-15-30z' fill='%2310b981' fill-opacity='0.03'/%3E%3C/svg%3E");
}

.feed-card.ayah-card .card-content {
  font-family: var(--font-quran);
  font-size: 28px;
  line-height: 2;
  color: var(--accent-gold);
  text-align: center;
  margin-top: 32px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-content {
  font-size: 19px;
  line-height: 1.6;
  font-weight: 500;
  margin-top: 28px;
  margin-bottom: 20px;
  color: var(--text-primary);
  text-align: right;
}

.card-source {
  font-size: 13px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  font-weight: 500;
}

.card-prompt {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

/* ── Interactions ── */
.card-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.card-option-btn {
  flex: 1;
  min-width: 130px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-option-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.card-option-btn.selected {
  background: var(--accent-primary);
  color: #0d1117;
  border-color: var(--accent-primary);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: scale(1.02);
}

/* ── Floating Intent Toast ── */
.intent-prompt {
  margin-top: 24px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.5) 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  animation: slideUpFade 0.5s ease-out;
  position: relative;
  overflow: hidden;
}

.intent-prompt::after {
  content: '✨';
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 20px;
  opacity: 0.5;
  animation: sparkle 2s infinite alternate;
}

@keyframes sparkle {
  0% {
    transform: scale(1) rotate(0);
    opacity: 0.3;
  }

  100% {
    transform: scale(1.2) rotate(15deg);
    opacity: 0.7;
  }
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.intent-prompt-label {
  font-size: 11px;
  color: var(--accent-primary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 800;
}

.intent-prompt-text {
  font-size: 17px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 20px;
  font-style: italic;
}

.intent-actions {
  display: flex;
  gap: 12px;
}

.btn-intent-accept {
  flex: 2;
  padding: 12px;
  background: var(--accent-primary);
  color: #0d1117;
  font-weight: 800;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 4px 15px var(--accent-glow);
  transition: all 0.2s;
}

.btn-intent-accept:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.btn-intent-skip {
  flex: 1;
  padding: 12px;
  background: transparent;
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 14px;
}

/* ── Floating Capsule Bottom Nav (Stitch Style) ── */
.bottom-nav {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  height: 72px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  border-radius: 36px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: 25%;
  height: 100%;
}

.nav-item .icon {
  font-size: 26px;
  display: flex;
  margin-bottom: 2px;
}

.nav-img {
  width: 28px;
  height: 28px;
  opacity: 0.6;
  filter: grayscale(1);
  transition: all 0.4s;
}

.nav-item .label {
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  height: 0;
  transition: all 0.3s;
}

.nav-item.active {
  color: #fff;
}

.nav-item.active .nav-img {
  opacity: 1;
  filter: grayscale(0) drop-shadow(0 0 8px var(--accent-primary));
  transform: translateY(-8px) scale(1.2);
}

.nav-item.active .label {
  opacity: 1;
  height: auto;
  transform: translateY(-4px);
}

/* ── XP Toast ── */
.xp-toast {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-gold), #fbbf24);
  color: #000;
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 0 25px var(--accent-gold-glow);
  z-index: 200;
  pointer-events: none;
}

/* ── Infinite Scroll Crescent Moon Loader ── */
.infinite-scroll-loader {
  padding: 40px 0;
  text-align: center;
}

.crescent-loader {
  font-size: 24px;
  color: var(--accent-primary);
  display: inline-block;
  animation: rotateMoon 2s linear infinite;
  text-shadow: 0 0 10px var(--accent-glow);
}

@keyframes rotateMoon {
  from {
    transform: rotate(0);
  }

  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  margin-top: 12px;
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 500;
}

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

  to {
    opacity: 1;
  }
}

/* Progress & Challenges Page Adaptations */
.progress-card,
.challenge-card {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.btn-join-challenge {
  border-radius: 12px;
  font-weight: 800;
  box-shadow: 0 6px 15px var(--accent-glow);
}

/* ── Profile Specifics (Stitch Design) ── */
.profile-header {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 40px;
}

.avatar-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 20px auto;
}

.avatar-ring {
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent-primary);
  border-right-color: var(--accent-gold);
  animation: rotateRing 8s linear infinite;
  box-shadow: inset 0 0 15px rgba(16, 185, 129, 0.2);
}

@keyframes rotateRing {
  from {
    transform: rotate(0);
  }

  to {
    transform: rotate(360deg);
  }
}

.avatar-main {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-subtle));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  border: 2px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  position: relative;
}

.level-badge-float {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--accent-primary);
  color: #0d1117;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 10px;
  border: 2px solid var(--bg-deep);
}

.stats-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 32px;
}

.stat-card {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  padding: 18px 8px;
  border-radius: var(--radius-md);
  text-align: center;
  transition: all 0.3s;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.1);
}

.stat-card-value {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  line-height: 1.2;
}

.stat-card-label {
  display: block;
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 6px;
  font-weight: 700;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.badge-item {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--glass-border);
  transition: all 0.3s;
}

.badge-item:hover:not(.locked) {
  background: rgba(255, 255, 255, 0.06);
  transform: scale(1.05);
}

.badge-item.locked {
  filter: grayscale(1);
  opacity: 0.3;
}

.badge-icon {
  font-size: 28px;
}

.badge-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}