/* Mobile App-Style Navigation */

/* Desktop Navigation Bar */
.desktop-nav {
  display: none;
  padding: 12px 0;
  margin-bottom: 20px;
}

.desktop-nav-wrapper {
  max-width: max-content;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.desktop-nav-container {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.desktop-nav-logout {
  background: var(--octo-pink);
  border: 1px solid var(--octo-pink);
  border-radius: 8px;
  padding: 8px 16px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: system-ui;
  white-space: nowrap;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.desktop-nav-logout:hover {
  background: var(--octo-pink-hover);
  border-color: var(--octo-pink-hover);
}

.desktop-nav-item {
  padding: 8px 16px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.desktop-nav-item:hover {
  background: var(--octo-pink);
  color: white;
}

.desktop-nav-item.active {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

.desktop-nav-icon {
  font-size: 16px;
}

/* Bottom Navigation Bar */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel);
  border-top: 1px solid var(--edge);
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 8px 0;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 8px;
  min-width: 60px;
}

.mobile-nav-item:hover {
  background: rgba(218, 24, 132, 0.1);
  color: var(--octo-pink);
}

.mobile-nav-item.active {
  color: var(--accent);
  font-weight: 600;
}

.mobile-nav-icon {
  font-size: 22px;
  line-height: 1;
}

/* Show desktop nav on desktop */
@media (min-width: 769px) {
  .desktop-nav {
    display: block;
  }
}

/* Show on mobile devices */
@media (max-width: 768px) {
  /* Add bottom padding to content to prevent overlap with nav */
  .wrap,
  .menu-container {
    padding-bottom: 100px !important;
  }

  .mobile-nav {
    display: block !important;
  }

  /* Show logo on mobile */
  body.has-mobile-nav .logo-header {
    padding: 16px;
    text-align: center;
  }

  body.has-mobile-nav .logo-header img {
    width: auto;
    height: auto;
  }
}

/* App-style header for mobile */
.app-header {
  display: none;
  background: var(--accent);
  color: white;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.app-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

.app-header-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: white;
}

.app-header-back {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.app-header-back:hover {
  background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
  .app-header {
    display: block;
  }

  /* Hide standard logo header on mobile when app header is present */
  body.has-app-header .logo-header {
    display: none;
  }

  body.has-app-header h1 {
    display: none;
  }
}

/* Card-style menu buttons (app-like) */
.menu-card {
  background: var(--panel);
  border-radius: 12px;
  border: 1px solid var(--edge);
  border-left: 4px solid var(--accent);
  padding: 16px;
  margin-bottom: 12px;
  text-decoration: none;
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.menu-card:hover {
  transform: translateX(2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background: var(--panel-hover, var(--panel));
}

.menu-card-icon {
  margin-right: 8px;
  font-size: 18px;
}

/* Section headers for menus */
.menu-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 24px 0 12px 4px;
}

.menu-section-title:first-child {
  margin-top: 0;
}

/* Statistics cards (app-like) */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 20px 0;
}

@media (min-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-card {
  background: var(--panel);
  border-radius: 12px;
  border: 1px solid var(--edge);
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-card-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-card-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.stat-card-value.primary {
  color: var(--accent);
}

.stat-card-value.success {
  color: var(--success);
}

.stat-card-value.error {
  color: var(--error);
}

/* Settings and Energy Dropdowns */
.settings-dropdown-container {
  position: relative;
}

.energy-dropdown-container {
  position: relative;
}

.energy-dropdown-container .desktop-nav-item {
  background: none;
  border: none;
  font-family: inherit;
}

.settings-dropdown-btn {
  background: var(--octo-purple);
  border: 1px solid var(--octo-purple);
  border-radius: 8px;
  padding: 8px 16px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: system-ui;
  white-space: nowrap;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-dropdown-btn:hover {
  background: var(--octo-pink);
  border-color: var(--octo-pink);
}

.settings-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 8px;
  background: transparent;
  min-width: 220px;
  z-index: 1001;
}

.settings-dropdown-menu::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.settings-dropdown-menu .settings-dropdown-item {
  position: relative;
}

.settings-dropdown-menu.show {
  display: block;
}

.settings-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--edge);
}

.settings-dropdown-item:last-child {
  border-bottom: none;
}

.settings-dropdown-item:hover {
  background: var(--octo-pink);
  color: white;
}

.settings-dropdown-icon {
  font-size: 16px;
}

/* Mobile Settings - hide desktop dropdown on mobile */
@media (max-width: 768px) {
  .settings-dropdown-container {
    display: none;
  }
}

/* Mobile Settings Menu */
.mobile-settings-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.mobile-settings-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
}

.mobile-settings-overlay.show {
  display: block;
}

.mobile-settings-menu {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel);
  border-radius: 16px 16px 0 0;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

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

.mobile-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--edge);
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
}

.mobile-settings-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}

.mobile-settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  text-decoration: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid var(--edge);
  transition: background 0.2s ease;
}

.mobile-settings-item:last-child {
  border-bottom: none;
}

.mobile-settings-item:active {
  background: var(--octo-pink);
  color: white;
}

.mobile-settings-icon {
  font-size: 20px;
}

/* Mobile logout button styling */
.mobile-nav-item.mobile-logout-btn {
  color: var(--octo-pink);
}

.mobile-nav-item.mobile-logout-btn:active {
  background: var(--octo-pink);
  color: white;
}
