/* ─── Navbar / app shell chrome ────────────────────────────────────────────
   Styles for the top navbar's search trigger, notifications dropdown,
   user-avatar fallback, account modal, and the global search overlay.
   All brand colors come from brand-tokens.css. */

/* Search trigger (visible navbar pill) */
.app-search-trigger {
  cursor: pointer;
  flex: 0 1 320px;
  margin-right: 1rem;
}
.app-search-trigger .app-search-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius-sm);
  background: var(--brand-surface-alt);
  transition: all 0.15s;
}
.app-search-trigger .app-search-icon { color: #8094ae; font-size: 1rem; }
.app-search-trigger .app-search-placeholder { color: #8094ae; font-size: 0.85rem; flex: 1; }
.app-search-trigger kbd {
  background: var(--brand-border);
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.65rem;
  color: #8094ae;
}

/* Mobile search icon */
.app-search-mobile-icon { color: var(--brand-text-muted); }

/* Notifications */
.notif-bell-wrap { position: relative; }
.notif-bell-icon { color: var(--brand-text-muted); }
.notif-badge {
  position: absolute;
  top: 2px;
  right: -2px;
  font-size: 0.6rem;
  padding: 2px 5px;
}
.notif-dropdown-menu {
  width: min(360px, calc(100vw - 1rem));
  max-height: min(480px, calc(100vh - 5rem));
  overflow: hidden;
  border-radius: var(--brand-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}
.notif-dropdown-header { border-bottom: 1px solid var(--brand-border); }
.notif-dropdown-header h6 { font-size: 0.9rem; }
.notif-dropdown-header .btn-link { font-size: 0.72rem; text-decoration: none; }
.notif-dropdown-divider { color: #e0e0e0; }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item {
  border-bottom: 1px solid var(--brand-divider);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: var(--brand-surface-alt); }
.notif-unread { background: #f0fafa; }
.notif-unread:hover { background: var(--brand-primary-light); }

/* User avatar fallback (no Google picture) */
.navbar-avatar-fallback {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--brand-primary);
  border-radius: 50%;
}
.navbar-avatar-fallback i { color: #fff; }

/* ─── Account modal (Profile / Settings / Billing) ────────────────────── */
.account-modal-content {
  border: none;
  border-radius: 1rem;
  overflow: hidden;
}
.account-modal-header {
  border-bottom: none;
  padding: 1.25rem 1.5rem 0;
}
.account-modal-tabs {
  border: none;
  gap: 0.5rem;
}
.account-modal-tabs .nav-link {
  border: none;
  color: var(--brand-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--brand-radius-sm);
  transition: all 0.15s;
}
.account-modal-tabs .nav-link:hover,
.account-modal-tabs .nav-link.active {
  color: var(--brand-primary);
  background: var(--brand-primary-light);
}
.account-modal-tabs .nav-link.active { font-weight: 600; }

.account-modal-body { padding: 1.5rem; overflow: visible; }
#accountModal .modal-content { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15); overflow: visible; }
#accountModal .modal-body { overflow: visible; }

.account-profile-header {
  border-bottom: 1px solid var(--brand-divider);
}
.account-profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--brand-primary);
}
.account-profile-avatar-fallback {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}
.account-profile-name { font-weight: 600; margin-bottom: 0; }

.account-form-label-sm { font-size: 0.82rem; }

.account-modal-section {
  border-top: 1px solid var(--brand-divider);
  padding-top: 1.25rem;
}

.account-google-card {
  background: #f0f7ff;
}
.account-google-card .google-icon { font-size: 1.5rem; color: #4285f4; }

.account-save-btn {
  background: var(--brand-primary);
  color: #fff;
}
.account-save-btn:hover { color: #fff; }

/* ─── Global search overlay ───────────────────────────────────────────── */
@keyframes gsSearchIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.global-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}
.global-search-modal {
  max-width: 560px;
  width: calc(100% - 2rem);
  margin: clamp(60px, 12vh, 120px) auto 0;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: gsSearchIn 0.15s ease-out;
}
.global-search-input-row {
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--brand-border);
}
.global-search-input-row .gs-icon { font-size: 1.25rem; color: #8094ae; flex-shrink: 0; }
.global-search-input-row input {
  flex: 1;
  border: none;
  outline: none;
  padding: 1rem 0.75rem;
  font-size: 1rem;
  background: transparent;
}
.global-search-input-row kbd {
  background: var(--brand-divider);
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.7rem;
  color: #8094ae;
  margin-left: 0.5rem;
}
.global-search-results {
  max-height: min(400px, 50vh);
  overflow-y: auto;
}

#global-search-results .gs-group-label {
  padding: 0.5rem 1.25rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #8094ae;
  background: #f8fafc;
}
#global-search-results .gs-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  text-decoration: none;
  color: var(--brand-text-heading);
  cursor: pointer;
  transition: background 0.1s;
}
#global-search-results .gs-item:hover,
#global-search-results .gs-item.gs-active {
  background: var(--brand-primary-light);
}
#global-search-results .gs-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}
#global-search-results .gs-name {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#global-search-results .gs-name mark {
  background: var(--brand-primary);
  color: #fff;
  border-radius: 2px;
  padding: 0 2px;
}
#global-search-results .gs-subtitle {
  font-size: 0.72rem;
  color: #8094ae;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#global-search-results .gs-empty {
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: #8094ae;
}
#global-search-results .gs-empty i {
  font-size: 2rem;
  opacity: 0.4;
  display: block;
  margin-bottom: 0.5rem;
}
#global-search-results .gs-footer {
  padding: 0.6rem 1.25rem;
  border-top: 1px solid var(--brand-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #8094ae;
  background: #f8fafc;
}
#global-search-results .gs-footer kbd {
  background: var(--brand-border);
  border: 1px solid #dee2e6;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.65rem;
  color: var(--brand-text-muted);
}

/* Billing modal — JS-rendered runtime buttons. The HTML strings carry
   inline `style="..."` with tight desktop padding; on phones we
   override to a tap-friendly size (≥36px) without rewriting the JS.
   !important is required to beat the inline style attribute. */
@media (max-width: 575.98px) {
  .billing-pay-btn,
  .billing-show-plans-btn,
  .billing-change-plan-btn,
  .billing-cycle-toggle,
  .billing-contact-sales-btn {
    min-height: 36px !important;
    padding: 8px 16px !important;
    font-size: 0.8125rem !important;
  }
  .billing-hide-plans-btn {
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 4px 8px !important;
    font-size: 1.25rem !important;
  }
}
