/* MOBILE-FIRST NAVBAR STYLES - TOGGLE ON ALL SCREENS */

/* Force light mode - prevent Android dark mode */
:root {
  color-scheme: light only;
  background-color: #ffffff;
}

html {
  color-scheme: light only;
  background-color: #ffffff;
}

body {
  color-scheme: light only;
  background-color: #ffffff;
  color: #1d1d1f;
}

/* Base sidebar - hidden by default on all screens */
.navbar-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  height: 100dvh;
  background: white;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  z-index: 1001;
  -webkit-transform: translate3d(-100%, 0, 0);
  transform: translate3d(-100%, 0, 0);
  -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Show sidebar when menu is open */
.navbar-sidebar.active {
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}

/* Backdrop overlay - shown on mobile when sidebar is open */
.navbar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.navbar-backdrop.active {
  display: block;
  opacity: 1;
}

/* Navbar Header */
.navbar-header {
  padding: 24px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.navbar-logo-text {
  font-size: 20px;
  font-weight: 600;
  color: #1d1d1f;
}

/* Navigation Items */
.navbar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.navbar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #1C9CFC;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.navbar-item:hover {
  background: #f5f5f7;
  color: #1d1d1f;
}

.navbar-item.active {
  background: #e8f0fe;
  color: #007AFF;
  border-right: 3px solid #007AFF;
}

.navbar-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.navbar-label {
  font-size: 16px;
  font-weight: 500;
}

/* Profile Section */
.navbar-footer {
  padding: 16px;
  border-top: 1px solid #f0f0f0;
}

.navbar-profile-dropdown {
  position: relative;
}

.navbar-profile-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f5f5f7;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.navbar-profile-button:hover {
  background: #e8e8ed;
}

.navbar-profile-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
}

.navbar-profile-info {
  flex: 1;
  text-align: left;
  min-width: 0;
}

.navbar-profile-name {
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar-profile-email {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar-profile-arrow {
  font-size: 16px;
  color: #666;
  transition: transform 0.2s ease;
}

.navbar-profile-button.active .navbar-profile-arrow {
  transform: rotate(180deg);
}

/* Profile Dropdown Menu */
.navbar-profile-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 8px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
}

.navbar-profile-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.navbar-profile-menu-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #1d1d1f;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.navbar-profile-menu-item:first-child {
  border-radius: 12px 12px 0 0;
}

.navbar-profile-menu-item:last-child {
  border-radius: 0 0 12px 12px;
}

.navbar-profile-menu-item:hover {
  background: #f5f5f7;
}

.navbar-profile-menu-item.logout {
  color: #ff3b30;
}

.navbar-menu-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.navbar-profile-menu-item > span:not(.navbar-menu-icon) {
  display: inline-block;
  flex: 1;
}

/* Menu Toggle Button - VISIBLE ON ALL SCREEN SIZES */
.menu-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  background: transparent;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.menu-toggle:active {
  background: #E5E5EA;
  transform: scale(0.95);
}

.menu-toggle:hover {
  background: #F0F0F0;
}

.menu-toggle i {
  font-size: 1.25rem;
  color: #1C9CFC;
  pointer-events: none;
}

/* When sidebar is open, move toggle button with it */
.navbar-sidebar.active ~ .menu-toggle {
  left: 296px;
}

/* Desktop: Show sidebar by default */
@media (min-width: 768px) {
  .navbar-sidebar {
    -webkit-transform: translate3d(0, 0, 0) !important;
    transform: translate3d(0, 0, 0) !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .navbar-backdrop {
    display: none !important;
  }

  body.has-sidebar .main-content,
  .main-content {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
  }

  .menu-toggle {
    display: none !important;
  }
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .menu-toggle {
    top: 12px;
    left: 12px;
  }

  .navbar-sidebar.active ~ .menu-toggle {
    left: 268px;
  }
}

/* Very small screens */
@media (max-width: 400px) {
  .navbar-sidebar {
    width: 260px;
  }

  .navbar-sidebar.active ~ .menu-toggle {
    left: 248px;
  }

  .navbar-logo-text {
    font-size: 18px;
  }

  .navbar-logo-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .navbar-item {
    padding: 10px 16px;
  }

  .navbar-label {
    font-size: 15px;
  }

  .navbar-profile-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .navbar-profile-name {
    font-size: 13px;
  }

  .navbar-profile-email {
    font-size: 11px;
  }
}
