/* Mobile Bottom Navigation Bar */

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
  padding: 0 8px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--text-muted-color);
  font-size: 10px;
  padding: 8px 4px;
  min-width: 56px;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  font-weight: 500;
}

.bottom-nav-item i {
  font-size: 22px;
  transition: transform 0.2s ease;
}

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

.bottom-nav-item.active {
  color: var(--accent-primary);
}

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

/* Toolkit button - same style as others (no special center styling) */

/* Toolkit Popup */
.toolkit-popup {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
}

.toolkit-popup.active {
  display: block;
}

.toolkit-popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

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

.toolkit-popup-content {
  position: absolute;
  bottom: 64px;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

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

/* Close animation */
.toolkit-popup.closing .toolkit-popup-content {
  animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.6, 1);
}

.toolkit-popup.closing .toolkit-popup-overlay {
  animation: fadeOut 0.25s ease-out;
}

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

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

/* Toolkit Popup Header */
.toolkit-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 12px 16px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 10;
}

.toolkit-popup-header h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
}

.toolkit-close {
  background: transparent;
  border: none;
  color: var(--text-muted-color);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 50%;
}

.toolkit-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
}

.toolkit-close:active {
  transform: scale(0.9);
}

/* Toolkit Items */
.toolkit-popup-items {
  padding: 8px 10px max(32px, calc(env(safe-area-inset-bottom) + 8px)) 10px;
}

.toolkit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 6px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.toolkit-item:active {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0.98);
}

.toolkit-item:last-child {
  margin-bottom: 0;
}

.toolkit-item i {
  font-size: 22px;
  color: var(--accent-primary);
  min-width: 26px;
  text-align: center;
}

.toolkit-item div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.toolkit-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color);
}

.toolkit-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted-color);
}

/* Adjust main content padding to account for bottom nav */
@media (max-width: 767.98px) {
  main.main-content {
    padding-bottom: 80px !important; /* 64px nav + 16px extra space */
  }

  /* Only apply bottom padding to toolkit popup offcanvas, not sidebar */
  .offcanvas.toolkit-popup {
    padding-bottom: 80px;
  }
}

/* Pull-to-close indicator (optional enhancement) */
.toolkit-popup-content::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

/* Smooth scrolling for toolkit list */
.toolkit-popup-content {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar for toolkit popup */
.toolkit-popup-content::-webkit-scrollbar {
  width: 4px;
}

.toolkit-popup-content::-webkit-scrollbar-track {
  background: transparent;
}

.toolkit-popup-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

/* Prevent body scroll when popup is open */
body.toolkit-popup-open {
  overflow: hidden;
}

/* Small screens adjustments */
@media (max-width: 360px) {
  .bottom-nav-item {
    min-width: 48px;
    font-size: 9px;
    padding: 8px 2px;
  }

  .bottom-nav-item i {
    font-size: 20px;
  }

  .mobile-bottom-nav {
    padding: 0 4px;
  }
}

  .toolkit-item {
    padding: 9px 10px;
  }

  .toolkit-item i {
    font-size: 20px;
    min-width: 24px;
  }

  .toolkit-item-title {
    font-size: 0.85rem;
  }

  .toolkit-item-desc {
    font-size: 0.7rem;
  }
}
