/* Navigation Styles */

/* Navigation Rail (Sidebar) */
.nav-rail {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-rail-width);
  height: 100vh;
  background-color: var(--md-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-lg) 0;
  box-shadow: 2px 0 8px var(--md-shadow);
  z-index: 100;
  border-right: 1px solid transparent; /* Add transparent border for consistency */
}

.logo-container {
  margin-bottom: var(--spacing-xl);
}

.logo-container .material-symbols-outlined {
  font-size: 28px;
  color: var(--md-primary);
}

.nav-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80%;
  padding: var(--spacing-md) 0;
  margin: 4px 0;
  color: var(--md-on-surface-variant);
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
  border-radius: 16px;
}

.nav-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--md-primary-container);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: -1;
  border-radius: 16px;
}

.nav-icon::after {
  content: '';
  position: absolute;
  top: 0;
  left: -12px;
  width: 4px;
  height: 0;
  background-color: var(--md-primary);
  opacity: 0;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.nav-icon .material-symbols-outlined {
  font-size: 24px;
  margin-bottom: var(--spacing-xs);
  font-variation-settings: 'FILL' 0;
  transition: font-variation-settings 0.3s ease;
}

.nav-icon .nav-label {
  font-size: var(--label-medium);
  display: block;
}

/* Hover state styling */
.nav-icon:hover {
  color: var(--md-primary);
}

.nav-icon:hover::before {
  opacity: 0.2;
}

.nav-icon:hover::after {
  height: 100%;
  opacity: 0.8;
}

/* Active state styling - important to ensure consistency */
.nav-icon.active {
  color: var(--md-primary) !important;
}

.nav-icon.active::before {
  opacity: 0.15 !important;
}

.nav-icon.active::after {
  height: 100% !important;
  opacity: 1 !important;
}

.nav-icon.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1 !important;
}

.nav-rail-divider {
  width: 40px;
  height: 1px;
  background-color: var(--md-outline-variant);
  margin: var(--spacing-md) 0;
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--bottom-nav-height);
  background-color: var(--md-surface);
  box-shadow: 0 -2px 8px var(--md-shadow);
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
  padding: 0 var(--spacing-md);
}

.bottom-nav .nav-icon {
  flex-direction: column;
  padding: var(--spacing-sm) 0;
  width: auto;
  border-radius: 0;
}

.bottom-nav .nav-icon::before,
.bottom-nav .nav-icon::after {
  display: none;
}

.bottom-nav .nav-label {
  font-size: var(--label-small);
}

/* Add a highlight indicator for mobile */
.bottom-nav .nav-icon.active::before {
  display: block;
  width: 100%;
  height: 3px;
  top: auto;
  bottom: -3px;
  border-radius: 3px 3px 0 0;
  opacity: 1 !important;
}

/* AMOLED Dark Mode Navigation Adjustments */
@media (prefers-color-scheme: dark) {
  .nav-rail, .bottom-nav {
    background-color: #000000; /* True AMOLED black */
    border-right: 1px solid #2c342d; /* Subtle border for visual separation */
  }

  .nav-icon {
    color: #c0c9c0; /* Brighter color for better visibility */
  }

  .nav-icon:hover, .nav-icon.active {
    color: #a4e0af !important; /* Brighter accent color */
  }

  .nav-icon:hover::before {
    background-color: #a4e0af;
    opacity: 0.15;
  }

  .nav-icon:hover::after,
  .nav-icon.active::after {
    background-color: #a4e0af;
  }

  .logo-container .material-symbols-outlined {
    color: #a4e0af; /* Brighter accent color */
  }

  .nav-rail-divider {
    background-color: #2c342d; /* Slightly lighter for visibility */
  }

  .bottom-nav {
    border-top: 1px solid #2c342d; /* Border for visual separation */
  }
}

/* Apply AMOLED styling when using class-based dark mode */
body.dark-mode .nav-rail,
body.dark-mode .bottom-nav {
  background-color: #000000; /* True AMOLED black */
  border-right: 1px solid #2c342d; /* Subtle border for visual separation */
}

body.dark-mode .nav-icon {
  color: #c0c9c0; /* Brighter color for better visibility */
}

body.dark-mode .nav-icon:hover,
body.dark-mode .nav-icon.active {
  color: #a4e0af !important; /* Brighter accent color */
}

body.dark-mode .nav-icon:hover::before {
  background-color: #a4e0af;
  opacity: 0.15;
}

body.dark-mode .nav-icon:hover::after,
body.dark-mode .nav-icon.active::after {
  background-color: #a4e0af;
}

body.dark-mode .logo-container .material-symbols-outlined {
  color: #a4e0af; /* Brighter accent color */
}

body.dark-mode .nav-rail-divider {
  background-color: #2c342d; /* Slightly lighter for visibility */
}

body.dark-mode .bottom-nav {
  border-top: 1px solid #2c342d; /* Border for visual separation */
}

/* Media Queries */
@media (max-width: 768px) {
  .nav-rail {
    display: none;
  }

  .bottom-nav {
    display: block;
  }

  .main-content {
    margin-left: 0;
    margin-bottom: var(--bottom-nav-height);
  }
}
