/* Icon-based Navigation Styles - Apple-esque Design */

/* Navigation Menu */
nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav ul li {
  list-style: none;
  margin: 0;
}

/* Icon Link Styles */
.nav-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  color: var(--light-text);
  text-decoration: none;
  position: relative;
}

.nav-icon-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
  text-decoration: none;
}

.nav-icon-link:active {
  background-color: rgba(0, 0, 0, 0.08);
  transform: scale(0.95);
}

.nav-icon-link svg {
  stroke: var(--color-text-primary, #333);
  transition: stroke 0.2s ease;
}

.nav-icon-link:hover svg {
  stroke: black;
}

/* Tooltip on hover - Apple style */
.nav-icon-link::after {
  content: attr(title);
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  letter-spacing: 0.01em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-icon-link::before {
  content: '';
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid rgba(0, 0, 0, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1001;
}

.nav-icon-link:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0.5s;
}

.nav-icon-link:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0.5s;
}

/* Notifications button styling to match */
.notifications-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
}

.notifications-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.notifications-button:active {
  background-color: rgba(0, 0, 0, 0.08);
  transform: scale(0.95);
}

.notifications-button svg {
  stroke: var(--color-text-primary, #333);
  transition: stroke 0.2s ease;
}

.notifications-button:hover svg {
  stroke: black;
}

/* Tooltip for notifications button */
.notifications-button::after {
  content: attr(title);
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  letter-spacing: 0.01em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.notifications-button::before {
  content: '';
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid rgba(0, 0, 0, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1001;
}

.notifications-button:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0.5s;
}

.notifications-button:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0.5s;
}

/* Notification badge positioning */
.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--color-accent, #5A7A6A);
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 0 4px;
  border-radius: 8px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(10%, -20%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Dark mode: use red/accent background for notification badge visibility */
:root[data-theme="dark"] .notification-badge {
  background-color: var(--color-danger);
  color: var(--color-text-primary);
}

/* Active state for current page */
.nav-icon-link.active {
  background-color: var(--color-bg-hover);
}

.nav-icon-link.active svg {
  stroke: var(--color-text-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  nav ul {
    gap: 2px;
  }
  
  .nav-icon-link {
    padding: 6px 8px;
  }
  
  .notifications-button {
    padding: 6px 8px;
  }
  
  /* Hide tooltips on mobile */
  .nav-icon-link::after,
  .nav-icon-link::before,
  .notifications-button::after,
  .notifications-button::before {
    display: none;
  }
}

/* Smooth icon stroke animation */
@keyframes iconPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.nav-icon-link:focus svg,
.notifications-button:focus svg {
  animation: iconPulse 0.3s ease;
}

/* Focus visible for accessibility */
.nav-icon-link:focus-visible,
.notifications-button:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

/* ============================================
   Navigation Dropdown Menu - Supabase-inspired
   ============================================ */

.nav-dropdown-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Trigger button styling */
.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
  color: var(--text-color, #1D2433);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  position: relative;
}

.nav-dropdown-trigger:hover {
  background-color: rgba(0, 0, 0, 0.05);
  text-decoration: none;
}

.nav-dropdown-trigger:active {
  background-color: rgba(0, 0, 0, 0.08);
  transform: scale(0.98);
}

.nav-dropdown-trigger svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex-shrink: 0;
}

/* Chevron icon */
.nav-dropdown-trigger .chevron-icon {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.nav-dropdown-container:hover .nav-dropdown-trigger .chevron-icon {
  transform: rotate(180deg);
}

/* The dropdown panel */
.nav-dropdown-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background-color: var(--white, #fff);
  border: 1px solid var(--border-color, #d2d2d7);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 10px rgba(0, 0, 0, 0.06);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  min-width: 520px;
  max-width: calc(100vw - 2rem);
  padding: 0;
  overflow: hidden;
}

/* Show on hover */
.nav-dropdown-container:hover .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Show on click (active state) */
.nav-dropdown-container.active .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Invisible bridge to prevent closing when moving to dropdown */
.nav-dropdown-container::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
  background: transparent;
}

/* Panel inner layout - multi-column like Supabase */
.nav-dropdown-inner {
  display: flex;
}

/* Main content section (left) */
.nav-dropdown-main {
  flex: 1;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* Sidebar section (right) - like Supabase's "Modules" or "Customer Stories" */
.nav-dropdown-sidebar {
  width: 200px;
  background-color: var(--light-gray, #f5f5f7);
  padding: 16px;
  border-left: 1px solid var(--border-color, #d2d2d7);
}

.nav-dropdown-sidebar-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--light-text, #86868b);
  margin: 0 0 12px 0;
  padding: 0 8px;
}

/* Individual navigation item */
.nav-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-color, #1D2433);
  transition: background-color 0.15s ease;
}

.nav-dropdown-item:hover {
  background-color: var(--light-gray, #f5f5f7);
  text-decoration: none;
}

.nav-dropdown-item:active {
  background-color: var(--medium-gray, #e8e8ed);
}

/* Item icon container */
.nav-dropdown-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: var(--light-gray, #f5f5f7);
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.nav-dropdown-item:hover .nav-dropdown-item-icon {
  background-color: var(--medium-gray, #e8e8ed);
}

.nav-dropdown-item-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-color, #1D2433);
}

/* Item text content */
.nav-dropdown-item-content {
  flex: 1;
  min-width: 0;
}

.nav-dropdown-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color, #1D2433);
  margin: 0 0 2px 0;
  line-height: 1.3;
}

.nav-dropdown-item-desc {
  font-size: 12px;
  color: var(--light-text, #86868b);
  margin: 0;
  line-height: 1.4;
}

/* Sidebar items - simpler style */
.nav-dropdown-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-color, #1D2433);
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.nav-dropdown-sidebar-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
  text-decoration: none;
}

.nav-dropdown-sidebar-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--light-text, #86868b);
  flex-shrink: 0;
}

/* Section divider */
.nav-dropdown-divider {
  grid-column: span 2;
  height: 1px;
  background-color: var(--border-color, #d2d2d7);
  margin: 8px 0;
}

/* Full-width item (spans both columns) */
.nav-dropdown-item.full-width {
  grid-column: span 2;
}

/* Small variant for sidebar items */
.nav-dropdown-item.small {
  padding: 8px 10px;
}

.nav-dropdown-item.small .nav-dropdown-item-icon {
  width: 28px;
  height: 28px;
}

.nav-dropdown-item.small .nav-dropdown-item-icon svg {
  width: 14px;
  height: 14px;
}

.nav-dropdown-item.small .nav-dropdown-item-title {
  font-size: 13px;
}

.nav-dropdown-item.small .nav-dropdown-item-desc {
  font-size: 11px;
}

/* Footer link for "View All" style */
.nav-dropdown-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color, #d2d2d7);
  text-align: center;
}

.nav-dropdown-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-primary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.nav-dropdown-footer-link:hover {
  opacity: 0.8;
  text-decoration: none;
}

.nav-dropdown-footer-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-dropdown-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateX(0) translateY(100%);
    border-radius: 16px 16px 0 0;
    min-width: unset;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
  }
  
  .nav-dropdown-container:hover .nav-dropdown-panel {
    transform: translateX(0) translateY(0);
  }
  
  .nav-dropdown-inner {
    flex-direction: column;
  }
  
  .nav-dropdown-main {
    grid-template-columns: 1fr;
  }
  
  .nav-dropdown-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-color, #d2d2d7);
  }
  
  .nav-dropdown-item.full-width,
  .nav-dropdown-divider {
    grid-column: span 1;
  }
}

/* ============================================
   Logo Dropdown Specific Styles
   ============================================ */

.logo-dropdown {
  display: inline-flex;
  align-items: center;
}

.logo-dropdown h1 {
  margin: 0;
}

.logo-dropdown .logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.logo-dropdown .logo-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.logo-dropdown .nav-dropdown-panel {
  left: 0;
  transform: translateX(0) translateY(8px);
}

.logo-dropdown:hover .nav-dropdown-panel {
  transform: translateX(0) translateY(0);
}

/* Mobile: Click to open dropdown, not hover */
@media (max-width: 768px) {
  /* Disable hover on mobile for logo dropdown */
  .logo-dropdown:hover .nav-dropdown-panel {
    opacity: 0;
    visibility: hidden;
    transform: translateX(0) translateY(100%);
  }
  
  /* Show dropdown only when active class is added via JS */
  .logo-dropdown.mobile-active .nav-dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) translateY(0);
  }
  
  .logo-dropdown .nav-dropdown-panel {
    left: 0;
    right: 0;
    transform: translateX(0) translateY(100%);
  }
}

/* ============================================
   Profile Dropdown Styles
   ============================================ */

.profile-dropdown {
  position: relative;
}

.profile-dropdown-trigger {
  background: none;
  border: none;
  cursor: pointer;
}

/* Nav profile avatar image */
.nav-profile-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-dropdown-panel {
  min-width: 280px;
  right: 0;
  left: auto;
  transform: translateX(0) translateY(8px);
  padding: 0;
}

.profile-dropdown:hover .profile-dropdown-panel {
  transform: translateX(0) translateY(0);
}

/* Show profile dropdown when clicked (active state) */
.profile-dropdown.active .profile-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) translateY(0);
}

/* Profile header in dropdown */
.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.profile-dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--light-gray, #f5f5f7);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.profile-dropdown-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-dropdown-avatar svg {
  width: 22px;
  height: 22px;
  stroke: var(--light-text, #86868b);
}

.profile-dropdown-info {
  flex: 1;
  min-width: 0;
}

.profile-dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color, #1D2433);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dropdown-email {
  font-size: 12px;
  color: var(--light-text, #86868b);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Divider */
.profile-dropdown-divider {
  height: 1px;
  background-color: var(--border-color, #d2d2d7);
  margin: 0;
}

/* Menu items */
.profile-dropdown-menu {
  padding: 8px;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-color, #1D2433);
  font-size: 14px;
  transition: background-color 0.15s ease;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.profile-dropdown-item:hover {
  background-color: var(--light-gray, #f5f5f7);
  text-decoration: none;
}

.profile-dropdown-item svg {
  width: 18px;
  height: 18px;
  stroke: var(--light-text, #86868b);
  flex-shrink: 0;
}

.profile-dropdown-item span {
  flex: 1;
}

/* Logout item - slightly different style */
.profile-dropdown-logout {
  color: #ff3b30;
}

.profile-dropdown-logout svg {
  stroke: #ff3b30;
}

.profile-dropdown-logout:hover {
  background-color: rgba(255, 59, 48, 0.1);
}

/* Mobile adjustments for profile dropdown */
@media (max-width: 768px) {
  .profile-dropdown:hover .profile-dropdown-panel {
    opacity: 0;
    visibility: hidden;
  }
  
  .profile-dropdown.mobile-active .profile-dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) translateY(0);
  }
  
  .profile-dropdown-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    min-width: unset;
    width: 100%;
    border-radius: 16px 16px 0 0;
    transform: translateX(0) translateY(100%);
    max-height: 80vh;
    overflow-y: auto;
  }
}
