/* ============================================================
   COMPONENTS.CSS — Nav, Footer, Buttons, Cards, Mobile Tab Bar
   ============================================================ */

/* ==================== DESKTOP NAV ==================== */
.site-nav {
  position: relative;
  z-index: 100;
  background: var(--color-cream);
  border-bottom: 1px solid var(--color-border);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-charcoal);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-brand .brand-diya {
  width: 24px;
  height: 24px;
  color: var(--color-terracotta);
}

.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-xl);
}

@media (min-width: 1024px) {
  .nav-links { display: flex; }
}

.nav-links a {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-brown-soft);
  position: relative;
  padding: var(--space-xs) 0;
  transition: color 300ms ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-sage);
  border-radius: 1px;
  transition: width 300ms ease, left 300ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-charcoal);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
  left: 0;
}

.nav-right {
  display: none;
  align-items: center;
  gap: var(--space-md);
}

@media (min-width: 1024px) {
  .nav-right { display: flex; }
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-sage);
  color: #fff;
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius-2xl);
  transition: background 300ms ease, transform 300ms ease;
}

.nav-cta:hover {
  background: var(--color-sage-dark);
  transform: translateY(-1px);
}

.nav-cta svg { width: 16px; height: 16px; }

.nav-social {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: var(--color-brown-soft);
  transition: color 300ms ease, background 300ms ease;
}

.nav-social a:hover {
  color: var(--color-sage-dark);
  background: rgba(122, 158, 126, 0.1);
}

.nav-social a svg { width: 20px; height: 20px; }

/* ==================== MOBILE BOTTOM TAB BAR ==================== */
.mobile-tab-bar {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-warm-white);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -2px 12px var(--color-shadow);
  padding-bottom: env(safe-area-inset-bottom, 0);
  height: calc(60px + env(safe-area-inset-bottom, 0));
}

@media (min-width: 1024px) {
  .mobile-tab-bar { display: none; }
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-brown-soft);
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  padding-top: 6px;
  transition: color 200ms ease;
  -webkit-tap-highlight-color: transparent;
}

.tab-item svg {
  width: 24px;
  height: 24px;
  transition: transform 200ms ease;
}

.tab-item.active {
  color: var(--color-sage);
}

.tab-item.active::before {
  content: '';
  position: absolute;
  top: 2px;
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-sage);
}

.tab-item.active svg {
  transform: scale(1.1);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  border-radius: var(--radius-2xl);
  cursor: pointer;
  transition: all 300ms ease;
  text-decoration: none;
  border: 2px solid transparent;
  min-height: 48px;
}

.btn-primary {
  background: var(--color-sage);
  color: #fff;
  border-color: var(--color-sage);
}

.btn-primary:hover {
  background: var(--color-sage-dark);
  border-color: var(--color-sage-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(122, 158, 126, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--color-sage-dark);
  border-color: var(--color-sage);
}

.btn-outline:hover {
  background: var(--color-sage);
  color: #fff;
  transform: translateY(-2px);
}

.btn-terracotta {
  background: var(--color-terracotta);
  color: #fff;
  border-color: var(--color-terracotta);
}

.btn-terracotta:hover {
  background: #b5613d;
  border-color: #b5613d;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(196, 112, 75, 0.3);
}

.btn-sm {
  padding: 10px 20px;
  font-size: var(--text-sm);
  min-height: 40px;
}

.btn svg { width: 18px; height: 18px; }

/* ==================== CARDS ==================== */
.card {
  background: var(--color-warm-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--color-sage);
  border-radius: 2px 2px 0 0;
  transition: width 300ms ease, left 300ms ease;
}

@media (min-width: 1024px) {
  .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
  }

  .card:hover::after {
    width: 100%;
    left: 0;
  }
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-md);
  color: var(--color-sage);
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
}

.card-text {
  color: var(--color-brown-soft);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-md);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-sage-dark);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: gap 200ms ease, color 200ms ease;
}

.card-link:hover {
  gap: var(--space-sm);
  color: var(--color-sage);
}

/* Coming Soon card variant */
.card--coming-soon {
  border: 2px dashed var(--color-border);
  opacity: 0.88;
  background: var(--color-cream);
}

.card--coming-soon::after { display: none; }

.badge {
  display: inline-block;
  padding: 3px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-2xl);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-terracotta {
  background: rgba(196, 112, 75, 0.12);
  color: var(--color-terracotta);
}

/* ==================== WISDOM TOPIC CARDS ==================== */
.wisdom-card {
  background: var(--color-warm-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 300ms ease, box-shadow 300ms ease;
  display: flex;
  flex-direction: column;
}

.wisdom-card-band {
  height: 4px;
  width: 100%;
}

.wisdom-card-body {
  padding: var(--space-lg) var(--space-xl) var(--space-xl);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.wisdom-card-category {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

.wisdom-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
}

.wisdom-card-summary {
  color: var(--color-brown-soft);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-md);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .wisdom-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
  }
}

/* ==================== FLOATING WHATSAPP ==================== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
  z-index: 900;
  transition: transform 300ms ease;
  animation: whatsappPulse 4s ease-in-out infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
}

.whatsapp-float svg { width: 28px; height: 28px; }

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

/* Hide on mobile (it's in the tab bar instead) */
@media (max-width: 1023px) {
  .whatsapp-float { display: none; }
}

/* ==================== BACK TO TOP ==================== */
.back-to-top {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--color-warm-white);
  color: var(--color-sage-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 899;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-sage);
  color: #fff;
}

.back-to-top svg { width: 20px; height: 20px; }

@media (max-width: 1023px) {
  .back-to-top { bottom: 80px; right: 16px; }
}

/* ==================== FOOTER ==================== */
.site-footer {
  background: var(--color-charcoal);
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

.footer-vine {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    transparent,
    var(--color-sage) 20%,
    var(--color-sage-light) 50%,
    var(--color-sage) 80%,
    transparent);
  opacity: 0.4;
}

.footer-grid {
  display: grid;
  gap: var(--space-2xl);
  padding: var(--space-3xl) 0 var(--space-2xl);
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

.footer-brand h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: #fff;
  margin-bottom: var(--space-xs);
}

.footer-brand .tagline {
  font-size: var(--text-sm);
  color: var(--color-sage-light);
  margin-bottom: var(--space-md);
}

.footer-brand p {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: rgba(255,255,255,0.6);
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  color: #fff;
  margin-bottom: var(--space-md);
}

.footer-links a {
  display: block;
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  padding: var(--space-xs) 0;
  transition: color 200ms ease, padding-left 200ms ease;
}

.footer-links a:hover {
  color: var(--color-sage-light);
  padding-left: var(--space-sm);
}

.footer-social a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  padding: var(--space-xs) 0;
  transition: color 200ms ease;
}

.footer-social a:hover {
  color: var(--color-sage-light);
}

.footer-social a svg { width: 18px; height: 18px; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: var(--space-lg) 0;
  text-align: center;
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.4);
}

/* Add padding at page bottom on mobile for the tab bar */
@media (max-width: 1023px) {
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0)); }
}
