/* Mobile Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(18,9,31,0.98) 0%, rgba(8,4,14,0.98) 100%);
  border-top: 1px solid rgba(192,132,252,0.24);
  z-index: 9998; /* Below chat widget */
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.42), 0 0 22px rgba(139, 92, 246, 0.12);
  display: none; /* Hidden on desktop */
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 2px 0;
  max-width: 640px;
  margin: 0 auto;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 8px;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: #b9aacb;
  transition: all 0.3s ease;
  position: relative;
}

.bottom-nav-item:hover {
  color: #8b5cf6;
}

.bottom-nav-item.active {
  flex-direction: row;
  gap: 8px;
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 52%, #a855f7 100%);
  color: #ffffff;
  border-radius: 20px;
  padding: 8px 16px;
  box-shadow: 0 4px 14px rgba(76, 29, 149, 0.35), 0 0 18px rgba(168, 85, 247, 0.22);
}

.bottom-nav-item-icon {
  width: 24px;
  height: 24px;
  position: relative;
}

.bottom-nav-item-icon svg {
  width: 100%;
  height: 100%;
}

/* Icon variant switching */
.bottom-nav-item .icon-outlined {
  display: block;
}

.bottom-nav-item .icon-filled {
  display: none;
}

.bottom-nav-item.active .icon-outlined {
  display: none;
}

.bottom-nav-item.active .icon-filled {
  display: block;
}

.bottom-nav-item-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  display: none;
  white-space: nowrap;
}

.bottom-nav-item.active .bottom-nav-item-label {
  display: block;
}

/* Avatar styles for bottom-nav */
.bottom-nav-avatar-img,
.bottom-nav-avatar-initials {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: block;
}

.bottom-nav-avatar-img {
  object-fit: cover;
}

.bottom-nav-avatar-initials {
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 52%, #a855f7 100%);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  letter-spacing: 0.5px;
}

/* Hide SVG when avatar is shown */
.bottom-nav-item-icon:has(.bottom-nav-avatar-img) .bottom-nav-svg-icon,
.bottom-nav-item-icon:has(.bottom-nav-avatar-initials) .bottom-nav-svg-icon {
  display: none;
}

/* Active state adjustments for avatar */
.bottom-nav-item.active .bottom-nav-avatar-initials {
  background: #0d0714;
  color: #8b5cf6;
  border: 2px solid rgba(234, 220, 255, 0.85);
  box-sizing: border-box;
}

.bottom-nav-item.active .bottom-nav-avatar-img {
  border: 2px solid rgba(234, 220, 255, 0.9);
  box-sizing: border-box;
}

.bottom-nav-item-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #a855f7;
  color: #ffffff;
  border-radius: 10px;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Show on mobile only */
@media (max-width: 640px) {
  .bottom-nav {
    display: block;
  }
  
  /* Add bottom padding to body to prevent content being hidden */
  body {
    padding-bottom: 60px;
  }
}

/* Mobile User Sheet - Bottom Sheet for Profile Menu */
.mobile-user-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  pointer-events: none;
}

.mobile-user-sheet:not([hidden]) {
  pointer-events: auto;
}

.mobile-user-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 2, 10, 0.78);
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.mobile-user-sheet.active .mobile-user-sheet-backdrop {
  opacity: 1;
}

.mobile-user-sheet-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #160b24 0%, #0d0714 100%);
  border: 1px solid rgba(192,132,252,0.18);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
}

.mobile-user-sheet.active .mobile-user-sheet-content {
  transform: translateY(0);
}

.mobile-user-sheet-handle {
  width: 40px;
  height: 4px;
  background: #6d5a82;
  border-radius: 2px;
  margin: 12px auto 16px;
}

.mobile-user-sheet-header {
  padding: 0 20px 16px;
  border-bottom: 1px solid #2a1a3d;
}

.mobile-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-user-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #eadcff 0%, #c084fc 50%, #8b5cf6 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #5b21b6;
  font-weight: 600;
}

.mobile-user-details {
  flex: 1;
}

.mobile-user-name {
  font-weight: 600;
  font-size: 16px;
  color: #f3e8ff;
  margin-bottom: 4px;
}

.mobile-user-email {
  font-size: 13px;
  color: #b9aacb;
}

.mobile-user-sheet-body {
  padding: 8px 0;
}

.mobile-user-sheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  color: #ddd4ea;
  transition: background 0.2s;
}

.mobile-user-sheet-item:hover {
  background: #181022;
}

.mobile-user-sheet-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.mobile-user-sheet-label {
  font-size: 15px;
  font-weight: 500;
}

.mobile-user-sheet-divider {
  height: 1px;
  background: #2a1a3d;
  margin: 8px 0;
}

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

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Ensure chat widget works well with bottom nav */
@media (max-width: 640px) {
  .chat-widget {
    bottom: 0 !important; /* Chat opens from bottom */
  }
  
  .chat-popup {
    /* Chat popup should be above bottom nav */
    z-index: 9999;
  }
}

/* ===== FINAL THEME OVERRIDE ===== */
/* MOBILE BOTTOM NAV */
.bottom-nav{
  background:rgba(9,5,15,.94) !important;
  border-top-color:rgba(192,132,252,.18) !important;
  box-shadow:0 -10px 30px rgba(0,0,0,.40),0 -2px 18px rgba(139,92,246,.08) !important;
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}
.bottom-nav-item{
  color:#9f90ae !important;
}
.bottom-nav-item:hover,
.bottom-nav-item.active{
  color:#d8b4fe !important;
}
.bottom-nav-item.active .bottom-nav-item-icon{
  filter:drop-shadow(0 0 8px rgba(192,132,252,.30));
}
.bottom-nav-item-badge{
  background:linear-gradient(135deg,#7c3aed,#c026d3) !important;
  color:#fff !important;
  border-color:rgba(255,255,255,.18) !important;
  box-shadow:0 0 10px rgba(168,85,247,.28) !important;
}

@media (prefers-reduced-motion:reduce){
  .bottom-nav-item{transition:none !important;}
}

