/* Top Navigation */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  z-index: 1001;
}

.top-nav-inner {
  height: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  position: relative;
}

.top-nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 var(--space-md);
  max-width: var(--content-max-width);
  margin: 0 auto;
  position: relative;
}

.top-nav-brand {
  display: flex;
  align-items: center;
}

.brand-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.3px;
}

.top-nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-icon-btn {
  background: none;
  border: none;
  padding: var(--space-sm);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background-color 0.15s;
}

.nav-icon-btn:hover {
  background-color: var(--bg-hover);
}

.nav-icon-btn:active {
  background-color: var(--bg-color);
}

.nav-icon-btn svg {
  display: block;
}

/* Top Nav Dropdown Menu */
.top-nav-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  min-width: 180px;
  overflow: hidden;
  z-index: 1002;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  width: 100%;
  border: none;
  background: none;
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s;
  text-align: left;
  font-family: inherit;
}

.dropdown-item:hover {
  background-color: var(--bg-hover);
}

.dropdown-item svg {
  color: var(--text-secondary);
}

.logout-item {
  border-top: 1px solid var(--border-color);
  color: var(--danger-color);
}

.logout-item svg {
  color: var(--danger-color);
}

/* Top Nav Notifications */
.top-nav-notifications {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: 380px;
  overflow: hidden;
  z-index: 1002;
}

.notifications-header {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.notifications-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

.notifications-list {
  max-height: 320px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background-color: var(--bg-hover);
}

.notification-item.is-unread,
.notification-item.unread {
  background: var(--primary-light);
}

.notification-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-color);
  border-radius: 50%;
}

.notification-item.is-unread .notification-icon,
.notification-item.unread .notification-icon {
  background: var(--white);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

a.notification-content {
  text-decoration: none;
  color: inherit;
}

.notification-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1px;
}

.notification-message {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.notification-actions {
  flex-shrink: 0;
  display: flex;
  gap: var(--space-xs);
  align-items: flex-start;
}

.notification-actions .btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.6875rem;
}

.notification-mark-read {
  background: transparent;
  border: none;
  padding: var(--space-xs);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.notification-mark-read:hover {
  opacity: 1;
}

.notification-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--danger-color);
  color: white;
  font-size: 0.5625rem;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.notification-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin: 0;
}

.notification-item.empty {
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
}

/* Notification bell button positioning */
.notification-bell-btn {
  position: relative;
}

/* Notification header with mark all read button */
.notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mark-all-read-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 4px;
  transition: background-color 0.15s;
}

.mark-all-read-btn:hover {
  background-color: var(--primary-light);
}

/* Notification action buttons */
.notification-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: var(--bg-color);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.15s;
  text-decoration: none;
  color: var(--text-secondary);
}

.notification-action-btn:hover {
  background: var(--bg-hover);
}

.notification-action-btn.edit-btn {
  color: var(--secondary-color);
}

.notification-action-btn.edit-btn:hover {
  background: var(--primary-light);
}

.notification-action-btn.retry-btn {
  color: var(--primary-color);
}

.notification-action-btn.retry-btn:hover {
  background: var(--primary-light);
}

.notification-action-btn.delete-btn {
  color: var(--danger-color, #dc3545);
}

.notification-action-btn.delete-btn:hover {
  background: rgba(220, 53, 69, 0.1);
}

.notification-action-btn.mark-read-btn {
  color: var(--success-color, #2e7d32);
}

.notification-action-btn.mark-read-btn:hover {
  background: rgba(46, 125, 50, 0.1);
}

.notification-action-btn:disabled {
  color: var(--text-muted, #9ca3af);
  opacity: 0.6;
  cursor: not-allowed;
}

/* Notification icon colors */
.notification-icon .icon-success {
  color: var(--success-color);
}

.notification-icon .icon-error {
  color: var(--danger-color);
}

.notification-icon .icon-info {
  color: var(--primary-color);
}

/* Notifications dropdown footer */
.notifications-footer {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.view-all-link {
  color: var(--primary-color);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
}

.view-all-link:hover {
  text-decoration: underline;
}

/* Animate spin for loading state */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Notifications Page */
.notifications-page {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-sm) var(--space-md);
  padding-bottom: calc(var(--nav-height) + var(--space-md));
}

.notifications-page .notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  margin-bottom: var(--space-md);
  border-bottom: none;
}

.notifications-page .notifications-header h1 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

.notifications-page .notifications-header-actions {
  display: flex;
  gap: var(--space-xs);
}

.notifications-page .notifications-header-actions .notification-action-btn {
  width: 36px;
  height: 36px;
}

.notifications-page .notifications-list {
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  max-height: none;
  overflow: visible;
}

.notifications-page .notification-item {
  padding: var(--space-md);
}

.notifications-page .notification-message {
  white-space: normal;
  overflow: visible;
}

.notifications-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
  color: var(--text-muted);
}

.notifications-empty svg {
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.notifications-empty p {
  font-size: 0.8125rem;
  margin: 0;
}

/* Mobile responsive for top nav */
@media (max-width: 768px) {
  .top-nav-notifications {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--border-color);
  min-height: var(--nav-height);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding-bottom: var(--space-sm);
  padding-bottom: calc(var(--space-sm) + constant(safe-area-inset-bottom));
  padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom));
}

@media (display-mode: standalone) {
  .bottom-nav {
    padding-bottom: var(--space-lg);
    padding-bottom: calc(var(--space-lg) + constant(safe-area-inset-bottom));
    padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom));
  }
}

.nav-items {
  display: grid;
  grid-template-columns: 1fr 1fr auto 1fr 1fr;
  align-items: center;
  justify-items: center;
  width: 100%;
  max-width: var(--content-max-width);
  padding: 0 var(--space-md);
  gap: 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.15s;
  padding: 6px 4px;
  min-width: 56px;
}

.nav-item:hover {
  color: var(--text-secondary);
}

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

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
}

/* Camera Button (Center, Larger) */
.nav-item-camera {
  position: relative;
  margin: 0;
  padding: 0;
  justify-self: center;
}

.nav-icon-camera {
  width: 56px;
  height: 56px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  margin-top: -18px;
}

.nav-item-camera:hover .nav-icon-camera {
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.4);
}

.nav-icon-camera svg {
  color: white;
}
