/* 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: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.navbar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
  margin: 0;
  padding: 0;
}

/* 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;
}

.navbar-section-divider {
  height: 1px;
  background: var(--ios-separator, rgba(60, 60, 67, 0.12));
  margin: 8px 20px;
}

.navbar-footer {
  padding: 12px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.navbar-footer-utils {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-footer-utils .sidebar-language-selector {
  flex: 1;
  z-index: auto;
}

.navbar-footer-utils .sidebar-language-selector .language-toggle {
  width: 100%;
  justify-content: center;
  padding: 10px 12px;
  background: #f5f5f7;
  border: none;
  border-radius: 10px;
  gap: 6px;
}

.navbar-footer-utils .sidebar-language-selector .language-toggle:hover {
  background: #e8e8ed;
}

.navbar-footer-utils .sidebar-language-selector .language-toggle i {
  font-size: 16px;
  color: #007AFF;
}

.navbar-donate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #FF6B6B 0%, #FF4757 100%);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.navbar-donate-btn:hover {
  background: linear-gradient(135deg, #FF4757 0%, #E84118 100%);
  transform: translateY(-1px);
  color: white;
}

.navbar-donate-btn i {
  font-size: 14px;
}

.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;
  flex-shrink: 0;
}

.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;
  flex-shrink: 0;
}

.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 16px rgba(0, 0, 0, 0.12);
  display: none;
  overflow: hidden;
  z-index: 1050;
}

.navbar-profile-menu.active {
  display: block;
}

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

.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-profile-menu-item i {
  width: 20px;
  font-size: 16px;
  text-align: center;
  flex-shrink: 0;
}

.navbar-profile-menu-item span {
  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 {
    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-img {
    height: 38px;
  }

  .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;
  }

  .navbar-footer-utils {
    flex-direction: column;
    gap: 8px;
  }

  .navbar-footer-utils .sidebar-language-selector,
  .navbar-donate-btn {
    width: 100%;
  }

  .navbar-donate-btn {
    padding: 10px 12px;
  }
}

/* Section Dropdowns */
.navbar-section-dropdown {
  border-bottom: 1px solid rgba(60, 60, 67, 0.08);
}

.navbar-section-dropdown:last-child {
  border-bottom: none;
}

.navbar-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.2s ease;
}

.navbar-section-toggle:hover {
  background: #f5f5f7;
}

.navbar-section-toggle:active {
  background: #e8e8ed;
}

.navbar-section-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #8E8E93;
}

.navbar-section-label {
  flex: 1;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #8E8E93;
}

.navbar-section-arrow {
  font-size: 10px;
  color: #8E8E93;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-section-dropdown.open .navbar-section-arrow {
  transform: rotate(180deg);
}

.navbar-section-dropdown.open .navbar-section-icon,
.navbar-section-dropdown.open .navbar-section-label {
  color: #007AFF;
}

.navbar-section-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-section-dropdown.open .navbar-section-content {
  max-height: 600px;
}

.navbar-badge-new {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
  background: linear-gradient(135deg, #34C759 0%, #30B350 100%);
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: auto;
  line-height: 1.2;
}

/* Home Dropdown Styles - iOS 28 Design */
.navbar-item-with-dropdown {
  position: relative;
}

.navbar-item.has-dropdown {
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  justify-content: flex-start;
  -webkit-tap-highlight-color: transparent;
}

.navbar-item.has-dropdown .dropdown-arrow {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: #8E8E93;
  opacity: 0.8;
}

.navbar-item-with-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
  color: #007AFF;
  opacity: 1;
}

.navbar-item-with-dropdown.active .navbar-item.has-dropdown {
  background: linear-gradient(135deg, rgba(28, 156, 252, 0.08) 0%, rgba(0, 122, 255, 0.12) 100%);
  color: #007AFF;
  border-right: 3px solid #007AFF;
}

.navbar-item-with-dropdown.active .navbar-item.has-dropdown .dropdown-arrow {
  color: #007AFF;
  opacity: 1;
}

.navbar-item-with-dropdown.no-dropdown .dropdown-arrow,
.navbar-item-with-dropdown.no-dropdown .navbar-item-dropdown {
  display: none;
}

.navbar-item-dropdown {
  max-height: 0;
  overflow: hidden;
  background: transparent;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease;
  padding: 0;
  margin: 0 12px;
  border-radius: 12px;
  opacity: 0;
}

.navbar-item-with-dropdown.open .navbar-item-dropdown {
  max-height: 300px;
  padding: 6px 0;
  background: #f5f5f7;
  opacity: 1;
  margin-top: 4px;
  margin-bottom: 8px;
}

.dropdown-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin: 2px 6px;
  color: #1d1d1f;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}

.dropdown-link:hover {
  background: rgba(0, 122, 255, 0.08);
  color: #007AFF;
}

.dropdown-link:active {
  background: rgba(0, 122, 255, 0.15);
  transform: scale(0.98);
}

.dropdown-link.active {
  background: rgba(0, 122, 255, 0.12);
  color: #007AFF;
  font-weight: 600;
}

@media (max-width: 400px) {
  .navbar-item-dropdown {
    margin: 0 8px;
  }

  .dropdown-link {
    padding: 10px 14px;
    font-size: 15px;
    margin: 2px 4px;
  }
}
