/**
 * Bottom Navigation Component
 * Mobile-first bottom tab bar for community pages
 * Inspired by The Grint's navigation pattern
 */

/* Bottom Navigation Container */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #ffffff;
  border-top: 1px solid #ddd0bc;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  /* Safe area padding for iPhone notch/home indicator */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 10px rgba(61, 41, 20, 0.08);
}

/* When safe area is present, increase total height */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    height: calc(60px + env(safe-area-inset-bottom, 0px));
  }
}

/* Navigation Items */
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #6b5344;
  font-size: 0.65rem;
  font-family: 'Source Serif 4', Georgia, serif;
  padding: 6px 12px;
  transition: all 0.2s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  min-width: 56px;
}

.bottom-nav-item:active {
  transform: scale(0.95);
}

/* Icon styling */
.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  margin-bottom: 2px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: all 0.2s ease;
}

/* Label styling */
.bottom-nav-label {
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Active state */
.bottom-nav-item.active {
  color: #2d5a27;
}

.bottom-nav-item.active svg {
  stroke: #2d5a27;
}

.bottom-nav-item.active .bottom-nav-label {
  font-weight: 600;
}

/* Hover state for non-touch devices */
@media (hover: hover) {
  .bottom-nav-item:hover {
    color: #2d5a27;
  }

  .bottom-nav-item:hover svg {
    stroke: #2d5a27;
  }
}

/* Center Play Button - Elevated CTA */
.bottom-nav-item.play-btn {
  position: relative;
  margin-top: -20px;
  background: linear-gradient(135deg, #2d5a27, #1a3d17);
  color: #ffffff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(45, 90, 39, 0.4);
  padding: 0;
  flex-direction: row;
  min-width: auto;
}

.bottom-nav-item.play-btn svg {
  width: 26px;
  height: 26px;
  stroke: #ffffff;
  margin-bottom: 0;
}

.bottom-nav-item.play-btn .bottom-nav-label {
  display: none;
}

.bottom-nav-item.play-btn:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(45, 90, 39, 0.3);
}

.bottom-nav-item.play-btn.active {
  background: linear-gradient(135deg, #4a7a3f, #2d5a27);
  box-shadow: 0 4px 20px rgba(45, 90, 39, 0.5);
}

/* Notification Badge */
.bottom-nav-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  background: #c62828;
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 1px 4px rgba(198, 40, 40, 0.4);
  animation: badgePulse 2s ease-in-out infinite;
}

.bottom-nav-badge.hidden {
  display: none;
}

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

/* Body padding to account for fixed nav */
body.has-bottom-nav {
  padding-bottom: 70px;
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body.has-bottom-nav {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }
}

/* Hide on larger screens (optional - can be removed if nav should always show) */
@media (min-width: 769px) {
  .bottom-nav {
    /* Comment out below to show on desktop too */
    /* display: none; */
  }

  /* body.has-bottom-nav {
    padding-bottom: 0;
  } */
}

/* Smooth entrance animation */
.bottom-nav {
  animation: slideUpNav 0.3s ease-out;
}

@keyframes slideUpNav {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Ripple effect on tap */
.bottom-nav-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(45, 90, 39, 0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  border-radius: inherit;
}

.bottom-nav-item:active::after {
  opacity: 1;
}

.bottom-nav-item.play-btn::after {
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
}
