/* Navigation Styles */

/* Dark Mode Toggle */
.dark-mode-toggle {
  background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: white;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2), 
              0 0 10px rgba(111, 142, 251, 0.3),
              inset 0 2px 4px rgba(255, 255, 255, 0.5);
}

.dark-mode-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.2) 30%, transparent 70%);
  opacity: 0.4;
  transition: all 0.4s ease;
  z-index: 0;
}

.dark-mode-toggle:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 25px rgba(111, 142, 251, 0.4), 
              0 0 20px rgba(111, 142, 251, 0.3),
              inset 0 2px 5px rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.6);
}

.dark-mode-toggle:hover::before {
  opacity: 0.6;
  transform: scale(1.1);
}

.dark-mode-toggle:active {
  transform: translateY(1px) scale(0.95);
  box-shadow: 0 4px 10px rgba(111, 142, 251, 0.3),
              0 0 5px rgba(111, 142, 251, 0.2),
              inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999; /* Ensure the top bar (1001) stays above navbar */
  padding: 1rem 0;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.3s ease;
}

.nav-logo:hover {
  transform: scale(1.05);
}

.nav-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
  transition: transform 0.3s ease;
}

.nav-avatar:hover {
  transform: scale(1.1);
}

.nav-name {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
  transform: translateY(-2px);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Mobile Navigation */
.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-color);
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

/* Nav Menu Dark Mode Toggle Button */
.nav-dark-mode-toggle {
  margin-left: 0.5rem;
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    transition: left 0.3s ease;
    padding-top: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .nav-menu .nav-link {
    margin: 10px 0;
    font-size: 1.2rem;
    padding: 15px 30px;
    border-radius: 8px;
    transition: all 0.3s ease;
  }
  
  .nav-menu .nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(10px);
  }
  
  .dark-mode-toggle {
    margin-top: 20px;
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
    margin-left: 0.5rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    border-width: 1.5px;
  }
  
  .dark-mode-toggle::before {
    display: none;
  }
  
  .dark-mode-toggle:hover {
    transform: translateY(-2px) scale(1.05);
  }
}

/* Hide top bar on larger screens */
@media (min-width: 769px) {
  .top-bar {
    display: none;
  }
}

/* Show dark mode toggle in nav menu on larger screens */
@media (max-width: 768px) {
  .nav-dark-mode-toggle {
    display: none;
  }
}

/* When the bottom nav is visible, make sure the top bar is smaller */
@media (max-width: 768px) {
  .top-bar {
    padding: 0.25rem 0;
  }
  
  .top-bar .container {
    padding: 0 1rem;
  }
  
  .top-bar .dark-mode-toggle {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }
}

/* Hide any other floating buttons on mobile */
@media (max-width: 768px) {
    .scroll-to-top,
    .floating-btn:not(.bottom-nav-fab) {
        display: none !important;
    }
}

/* Enhanced Mobile Navigation */
@media (max-width: 480px) {
    .bottom-nav-container {
        padding: 0 0.5rem;
    }
    
    .bottom-nav-item {
        padding: 0.4rem 0.5rem;
        min-width: 50px;
    }
    
    .bottom-nav-item i {
        font-size: 1.1rem;
    }
    
    .bottom-nav-item span {
        font-size: 0.65rem;
    }
    
    .bottom-nav-fab {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        top: -22px;
    }
}

/* iPhone X and similar devices with notch */
@media (max-width: 768px) and (orientation: portrait) {
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    body {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* Landscape mode adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .bottom-nav {
        padding: 0.25rem 0;
    }
    
    .bottom-nav-item {
        padding: 0.3rem 0.5rem;
    }
    
    .bottom-nav-item span {
        display: none;
    }
    
    .bottom-nav-fab {
        display: none;
    }
    
    body {
        padding-bottom: 50px;
    }
}

/* PWA-like experience */
@media (display-mode: standalone) {
    .bottom-nav {
        background: rgba(var(--bg-primary-rgb), 0.95);
        backdrop-filter: blur(20px);
    }
    
    .bottom-nav-item:hover,
    .bottom-nav-item.active {
        background: rgba(102, 126, 234, 0.15);
    }
}

/* Dark Mode Navigation */
body.dark-mode .navbar {
  background: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .dark-mode-toggle {
  background: linear-gradient(135deg, #2a2d3e 0%, #424663 100%);
  border-color: rgba(111, 142, 251, 0.5);
  color: #ffd54f;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), 
              0 0 10px rgba(255, 213, 79, 0.2), 
              inset 0 1px 3px rgba(111, 142, 251, 0.3);
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav-menu {
    gap: 1rem;
  }
  
  .dark-mode-toggle {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
  
  .nav-link {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 0 1rem;
  }
  
  .nav-menu {
    gap: 0.5rem;
  }
  
  /* Small screen top bar adjustments */
  .top-bar-avatar {
    width: 30px;
    height: 30px;
  }
  
  .top-bar-name {
    font-size: 0.95rem;
  }
  
  .top-bar .dark-mode-toggle {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }
}

/* Mobile Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 0;
    z-index: 1000;
    display: none;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 1rem;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 60px;
    position: relative;
    overflow: hidden;
}

.bottom-nav-item i {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.bottom-nav-item span {
    font-size: 0.7rem;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

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

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
}

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

/* Badge for notifications */
.bottom-nav-item .badge {
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    background: #ff4757;
    color: white;
    font-size: 0.6rem;
    padding: 0.15rem 0.3rem;
    border-radius: 10px;
    min-width: 1rem;
    text-align: center;
    line-height: 1;
}

/* Hide top nav on mobile when bottom nav is active */
@media (max-width: 768px) {
    .bottom-nav {
        display: block;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
    
    .nav-menu {
        display: none;
    }
    
    .nav-toggle {
        display: none;
    }
    
    /* Add bottom padding to body to prevent content from being hidden */
    body {
        padding-bottom: 80px;
    }
    
    /* Adjust footer for bottom nav */
    .footer {
        padding-bottom: 80px;
    }
}

/* Animation for bottom nav items */
@keyframes bottomNavPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.bottom-nav-item.pulse {
    animation: bottomNavPulse 0.3s ease;
}

/* Dark mode support */
[data-theme="dark"] .bottom-nav {
    background: rgba(31, 41, 55, 0.95);
    border-top-color: rgba(75, 85, 99, 0.3);
}

[data-theme="dark"] .bottom-nav-item:hover,
[data-theme="dark"] .bottom-nav-item.active {
    background: rgba(102, 126, 234, 0.2);
}

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

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

/* Hide bottom nav when scrolling down (optional) */
.bottom-nav.hidden {
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

/* Floating action button style for special actions */
.bottom-nav-fab {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.bottom-nav-fab:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.bottom-nav-fab:active {
    transform: translateX(-50%) translateY(0) scale(0.95);
}

/* Focus states for accessibility */
.bottom-nav-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.bottom-nav-fab:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Smooth transitions for all states */
.bottom-nav-item,
.bottom-nav-fab {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add subtle shadow for depth */
.bottom-nav::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.05));
    pointer-events: none;
}

/* Theme toggle icon animations */
.dark-mode-toggle i {
  position: relative;
  z-index: 1;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: floatIcon 3s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7), 
               0 0 20px rgba(255, 255, 255, 0.3);
  font-size: 1.3rem;
}

.dark-mode-toggle:hover i {
  transform: rotate(45deg) scale(1.1);
  animation-play-state: paused;
}

body.dark-mode .dark-mode-toggle i {
  animation: pulseSun 3s ease-in-out infinite;
  text-shadow: 0 0 15px rgba(255, 213, 79, 0.8), 
               0 0 30px rgba(255, 213, 79, 0.4);
  font-size: 1.3rem;
}

body.dark-mode .dark-mode-toggle:hover i {
  transform: rotate(-45deg) scale(1.2);
  animation-play-state: paused;
}

@keyframes floatIcon {
  0% {
    transform: translateY(0) rotate(0);
  }
  25% {
    transform: translateY(-3px) rotate(5deg);
  }
  50% {
    transform: translateY(0) rotate(0);
  }
  75% {
    transform: translateY(2px) rotate(-5deg);
  }
  100% {
    transform: translateY(0) rotate(0);
  }
}

@keyframes pulseSun {
  0% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
  25% {
    transform: scale(1.1) rotate(5deg);
    opacity: 0.9;
  }
  50% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
  75% {
    transform: scale(1.05) rotate(-5deg);
    opacity: 0.95;
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

/* Additional Dark Mode Toggle Styles */
body.dark-mode .dark-mode-toggle:hover {
  background: linear-gradient(135deg, #424663 0%, #2a2d3e 100%);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 
              0 0 15px rgba(255, 213, 79, 0.2),
              inset 0 2px 5px rgba(111, 142, 251, 0.4);
  border-color: rgba(111, 142, 251, 0.7);
}

/* Enhanced theme toggle with ripple effect */
.dark-mode-toggle::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

.dark-mode-toggle:active::after {
  opacity: 0.4;
  transform: scale(3);
  transition: 0s;
}

/* Theme toggle transition */
.dark-mode-toggle, .dark-mode-toggle i, body.dark-mode .dark-mode-toggle, body.dark-mode .dark-mode-toggle i {
  will-change: transform, box-shadow, text-shadow, background;
}

/* Additional styling for visible focus state */
.dark-mode-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(111, 142, 251, 0.5),
              0 5px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .dark-mode-toggle:focus {
  box-shadow: 0 0 0 3px rgba(255, 213, 79, 0.5),
              0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Container glow effect */
@media (min-width: 769px) {
  .dark-mode-toggle {
    filter: drop-shadow(0 0 5px rgba(111, 142, 251, 0.3));
  }
  
  body.dark-mode .dark-mode-toggle {
    filter: drop-shadow(0 0 5px rgba(255, 213, 79, 0.2));
  }
  
  .dark-mode-toggle:hover {
    filter: drop-shadow(0 0 8px rgba(111, 142, 251, 0.5));
  }
  
  body.dark-mode .dark-mode-toggle:hover {
    filter: drop-shadow(0 0 8px rgba(255, 213, 79, 0.3));
  }
}

/* Top Bar Styling */
.top-bar {
  background: rgba(255, 255, 255, 0.9);
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 1001;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.top-bar .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Top bar logo styling */
.top-bar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.top-bar-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
}

.top-bar-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark-mode .top-bar-name {
  color: #fff;
}

body.dark-mode .top-bar-avatar {
  border-color: rgba(255, 255, 255, 0.3);
}

/* Dark mode styling for top bar */
body.dark-mode .top-bar {
  background: rgba(17, 24, 39, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Dark mode top bar text and logo */
body.dark-mode .top-bar-name {
  background: linear-gradient(135deg, #60a5fa, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Responsive styles for top bar */
@media (max-width: 768px) {
  .top-bar-right {
    gap: 0.5rem;
  }
  
  .navbar {
    top: 50px; /* Adjust based on the height of your top bar */
  }
}

/* Make dark mode toggle in top bar visible on mobile */
@media (max-width: 768px) {
  .bottom-nav {
    display: block;
  }
  
  .top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1001;
    padding: 0.4rem 0;
    height: 50px; /* Fixed height to ensure consistent spacing */
    display: flex;
    align-items: center;
  }
  
  .top-bar .container {
    width: 100%;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
  }
  
  .top-bar-content {
    justify-content: space-between;
    width: 100%;
    display: flex;
    align-items: center;
  }
  
  .top-bar-left {
    display: flex;
    align-items: center;
  }
  
  .top-bar-logo {
    display: flex;
    align-items: center;
  }
  
  .top-bar-avatar {
    width: 32px;
    height: 32px;
    border-width: 1.5px;
  }
  
  .top-bar-name {
    font-size: 1rem;
    margin-left: 0.3rem;
  }
  
  .top-bar-right {
    display: flex;
    align-items: center;
  }
  
  .top-bar .dark-mode-toggle {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  
  body.dark-mode .top-bar {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  /* Hide the navbar when top bar is visible */
  .navbar {
    display: none;
  }
}

/* Dark mode button in bottom navigation */
.bottom-nav-item.dark-mode-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.bottom-nav-item.dark-mode-btn i {
  font-size: 1.2rem;
  color: var(--primary-color);
  animation: floatIcon 2s ease-in-out infinite;
}

body.dark-mode .bottom-nav-item.dark-mode-btn i {
  color: #ffd54f;
  animation: pulseSun 2s ease-in-out infinite;
}

.bottom-nav-item.dark-mode-btn:hover,
.bottom-nav-item.dark-mode-btn:active {
  background: rgba(102, 126, 234, 0.1);
}

/* Update bottom nav container spacing for the additional item */
@media (max-width: 768px) {
  .bottom-nav-container {
    justify-content: space-between;
    padding: 0 0.5rem;
  }
  
  .bottom-nav-item {
    min-width: auto;
    padding: 0.5rem;
    flex: 1;
  }
}
