/* Village modular auth & login panel styles */

.village-auth-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.25rem;
  background: linear-gradient(160deg, #f8fafc 0%, #ecfdf5 55%, #f0fdfa 100%);
}

.village-auth-flow {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(480px, 100%);
  max-height: 100vh;
  overflow-y: auto;
  padding: 1.5rem 1.25rem;
  margin: 0 auto;
  box-sizing: border-box;
}

.village-auth-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.75rem;
}

.village-auth-panel.hidden {
  display: none !important;
}

.village-auth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.25rem;
}

.village-auth-btn-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.village-auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.village-auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 1rem;
  color: #94a3b8;
  font-size: 0.875rem;
}

.village-auth-divider::before,
.village-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* Social verification grid — 2×2 uniform layout */
.village-auth-oauth {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
}

.village-auth-oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.village-auth-oauth-btn i {
  font-size: 1.125rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.village-auth-oauth-btn:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.village-auth-oauth-btn:active {
  transform: translateY(0);
}

.village-auth-oauth-btn--google i { color: #ea4335; }
.village-auth-oauth-btn--apple i { color: #111827; }
.village-auth-oauth-btn--facebook i { color: #1877f2; }
.village-auth-oauth-btn--x i { color: #0f1419; }

@media (max-width: 380px) {
  .village-auth-oauth {
    grid-template-columns: 1fr;
  }

  .village-auth-oauth-btn {
    justify-content: flex-start;
    padding-left: 1.25rem;
  }
}

/* ── Global top header ── */
.topnav__search input,
.topnav__search-input {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.35);
  color: #ffffff;
}

.topnav__search input::placeholder,
.topnav__search-input::placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
}

.topnav__search input::-webkit-input-placeholder,
.topnav__search-input::-webkit-input-placeholder {
  color: #94a3b8 !important;
}

.topnav__search input::-moz-placeholder,
.topnav__search-input::-moz-placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
}

.topnav__search input:focus,
.topnav__search-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.28);
}

.topnav__search-icon {
  color: #94a3b8;
}

.topnav__link {
  color: #475569;
  font-weight: 500;
}

.topnav__link:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.topnav__link--active,
.topnav__link--active:hover,
#topnavHomeLink.topnav__link--active {
  color: #047857;
  background: #ecfdf5;
  font-weight: 700;
  border: 1px solid rgba(5, 150, 105, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.topnav__link--active svg,
#topnavHomeLink.topnav__link--active svg {
  stroke: #047857;
}

.topnav__link--active span,
#topnavHomeLink.topnav__link--active span {
  color: #047857;
  font-weight: 700;
}

/* ── Sidebar profile card ── */
.sidebar-recommendations__title {
  color: #d1fae5;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.sidebar__user-card #sidebarUserRole {
  color: #6ee7b7;
}

.sidebar__user-card .account-control__label {
  color: #94a3b8;
}

.sidebar__user-card .account-toggle {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.sidebar__user-card .account-toggle__option {
  color: #ffffff;
  border: 1px solid transparent;
  font-size: 0.7rem;
  font-weight: 600;
}

.sidebar__user-card .account-toggle__option:hover {
  color: #ffffff;
  border-color: rgba(226, 232, 240, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar__user-card .account-toggle__option--active,
.sidebar__user-card .account-toggle__option--active:hover {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.55) 0%, rgba(13, 148, 136, 0.42) 100%);
  border-color: rgba(110, 231, 183, 0.65);
  box-shadow:
    0 0 0 1px rgba(110, 231, 183, 0.35),
    0 0 14px rgba(16, 185, 129, 0.28);
}

/* ── Top navigation — interactive premium states ── */
.topnav__link {
  position: relative;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 120ms ease;
}

.topnav__link:active {
  transform: scale(0.97);
}

.topnav__link--profile {
  position: relative;
}

.topnav__notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f97316;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.45), 0 0 10px rgba(249, 115, 22, 0.55);
  animation: topnavDotPulse 2.4s ease-in-out infinite;
  pointer-events: none;
}

.topnav__notification-dot--profile {
  top: 4px;
  right: -2px;
}

.topnav__link:hover .topnav__notification-dot,
.topnav__link--active .topnav__notification-dot {
  background: #ea580c;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 14px rgba(234, 88, 12, 0.75);
}

@keyframes topnavDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.88; }
}

/* Language + currency selectors — high-contrast light panels */
.global-language-selector {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.global-language-selector__label {
  color: #64748b;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.global-language-selector__select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  font-weight: 600;
  min-height: 34px;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.global-language-selector__select:hover {
  border-color: #10b981;
  background: #f8fafc;
}

.global-language-selector__select:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.28);
}

.global-language-selector__select option {
  background: #ffffff;
  color: #334155;
  font-weight: 500;
}

/* Global currency selector — Binance P2P-style compact fiat picker */
.global-currency-selector {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 9.5rem;
}

.global-currency-selector__label {
  color: #64748b;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.62rem;
}

#global-currency-select,
.global-currency-selector__select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.8rem;
  min-height: 34px;
  min-width: 9.5rem;
  max-width: 11.5rem;
  padding: 0.35rem 1.75rem 0.35rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231e293b' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

#global-currency-select:hover,
.global-currency-selector__select:hover {
  border-color: #10b981;
  background-color: #f8fafc;
}

#global-currency-select:focus,
.global-currency-selector__select:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.28);
  color: #0f172a;
}

#global-currency-select option,
.global-currency-selector__select option {
  background: #ffffff;
  color: #1e293b;
  font-weight: 600;
  font-size: 0.82rem;
}

/* Profile avatar + summary dropdown */
.topnav__profile-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.topnav__avatar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.topnav__avatar-btn:hover {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.topnav__avatar-btn:active {
  transform: scale(0.96);
}

.topnav__avatar-btn[aria-expanded="true"] {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.28);
}

.topnav__profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 200;
  width: min(260px, 82vw);
  padding: 0.85rem;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.08);
}

.topnav__profile-dropdown--open {
  animation: profileDropdownIn 180ms ease;
}

@keyframes profileDropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.topnav__profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.topnav__profile-dropdown-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #d1fae5;
}

.topnav__profile-dropdown-meta strong {
  display: block;
  font-size: 0.88rem;
  color: #0f172a;
  font-weight: 700;
}

.topnav__profile-dropdown-meta span {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.topnav__profile-dropdown-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.topnav__profile-dropdown-item {
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f8fafc;
  color: #1e293b;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.topnav__profile-dropdown-item:hover {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.topnav__profile-dropdown-item:active {
  background: #d1fae5;
}

/* ══════════════════════════════════════════════════════════════
   Viewport isolation — rigid panel switching (no bleed/overlap)
   ══════════════════════════════════════════════════════════════ */

.feed-container.view-panel,
.delivery-container.view-panel,
.market-container.view-panel,
.chat-container.view-panel,
.wallet-container.view-panel,
.jobs-container.view-panel,
.market-analysis-container.view-panel {
  display: none;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

.view-panel.active-view {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#pay-page.view-panel.active-view,
#market-page.view-panel.active-view {
  display: flex !important;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 9986;
  overflow-y: auto;
}

#pay-page.view-panel.active-view {
  background: linear-gradient(180deg, #0a0f1a 0%, #060a12 45%, #04060c 100%);
  color: #e2e8f0;
  padding: calc(var(--nav-height, 64px) + 1rem) 0 2.5rem;
}

#market-page.view-panel.active-view {
  background: radial-gradient(ellipse 90% 70% at 50% -10%, rgba(16, 185, 129, 0.12) 0%, transparent 55%), #f4f6f9;
  padding: calc(var(--nav-height, 64px) + 1rem) 0 2rem;
}

/* Glassmorphism cards — borderless, subtle depth */
.village-glass-card {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}

.delivery-container .delivery-dashboard,
.jobs-container .jobs-dashboard,
.chat-container .chat-hub,
.market-analysis-container .market-analysis-dashboard {
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.delivery-dashboard__title,
.jobs-dashboard__title,
.chat-hub__title,
.market-analysis-dashboard__title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.delivery-dashboard__subtitle,
.jobs-dashboard__subtitle,
.chat-hub__subtitle,
.market-analysis-dashboard__subtitle {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #64748b;
}

.delivery-dashboard__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}

.delivery-job-card {
  padding: 1rem;
}

.delivery-job-card__id {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #059669;
}

.delivery-job-card__route {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.delivery-job-card__meta {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: #64748b;
}

.delivery-job-card__action {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #047857, #10b981);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 160ms ease;
}

.delivery-job-card__action:hover {
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.28);
  transform: translateY(-1px);
}

.jobs-dashboard__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.jobs-dashboard__item {
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

.chat-hub__open-btn {
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 10px;
  background: #1e293b;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease;
}

.chat-hub__open-btn:hover {
  background: #047857;
}

/* Strip thick neon / placeholder framing inside market module */
#market-page .village-market__seller-card,
#market-page .village-market__chip,
.delivery-container .delivery-job-card {
  border: none !important;
  outline: none !important;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05) !important;
}

#market-page .village-market__chip {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
}

#market-page .village-market__seller-card {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 1rem;
}
