/**
 * Modern Glassmorphism Profile Dropdown & Dark Mode Styles
 * Modeled after premium SaaS / Framer / shadcn style profile dropdowns
 */

/* ── Top Navbar Avatar Trigger ── */
.profile-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.profile-avatar-trigger {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 42px !important;
  height: 42px !important;
  padding: 2px !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  outline: none !important;
  backdrop-filter: blur(10px) !important;
  user-select: none !important;
  text-decoration: none !important;
}

.profile-avatar-trigger:hover,
.profile-avatar-trigger.active {
  background: rgba(255, 255, 255, 0.35) !important;
  border-color: rgba(139, 92, 246, 0.65) !important;
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3) !important;
}

.site-header--overlay .profile-avatar-trigger {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

.profile-avatar-img-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: visible;
  flex-shrink: 0;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.profile-avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #ffffff;
  background: linear-gradient(135deg, #8b5cf6, #8b5cf6 55%, #d946ef);
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.35);
}

.profile-presence-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 10px;
  height: 10px;
  background-color: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.profile-trigger-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 2px;
}

/* ── The Floating Dropdown Menu Card ── */
.profile-menu-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(228, 228, 231, 0.85);
  border-radius: 20px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
  padding: 0.85rem;
  z-index: 1080;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.2s;
  pointer-events: none;
  color: #18181b;
  font-family: 'Inter', 'Hind Siliguri', sans-serif;
}

.profile-menu-card.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── User Overview Header Inside Menu ── */
.profile-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.6rem 0.5rem 0.85rem;
  border-bottom: 1px solid #f4f4f5;
  margin-bottom: 0.5rem;
}

.profile-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.profile-header-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-header-avatar .profile-header-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #8b5cf6 55%, #d946ef);
}

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

.profile-header-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-header-email {
  font-size: 0.78rem;
  color: #71717a;
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  color: #7c3aed;
  background: #f5f3ff;
  border: 1px solid #ede9fe;
}

/* ── Menu Action Links ── */
.profile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}

.profile-menu-item:hover {
  background-color: #f4f4f5;
  color: #0f172a;
  transform: translateX(2px);
}

.profile-menu-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-menu-item-left i,
.profile-menu-item-left svg {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  color: #71717a;
  transition: color 0.15s;
}

.profile-menu-item:hover .profile-menu-item-left i {
  color: #8b5cf6;
}

.profile-menu-shortcut {
  font-size: 0.7rem;
  font-family: inherit;
  font-weight: 600;
  color: #a1a1aa;
  background: #f4f4f5;
  padding: 2px 5px;
  border-radius: 5px;
  border: 1px solid #e4e4e7;
  line-height: 1;
}

/* ── Dark Mode Toggle Box (Matching Image) ── */
.profile-dark-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.55rem 0;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.6), rgba(245, 243, 255, 0.8));
  border: 1px solid rgba(244, 114, 182, 0.2);
}

.profile-dark-mode-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #e11d48;
}

.profile-dark-mode-label i {
  font-size: 0.95rem;
}

/* iOS Style Switch */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #e4e4e7;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
}

.ios-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.ios-switch input:checked + .ios-slider {
  background: linear-gradient(135deg, #8b5cf6, #8b5cf6);
}

.ios-switch input:checked + .ios-slider:before {
  transform: translateX(20px);
}

/* ── Switch Account Section ── */
.profile-section-title {
  margin: 0.6rem 0.5rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.profile-account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.55rem;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
  margin-bottom: 2px;
}

.profile-account-item:hover,
.profile-account-item.active {
  background-color: #faf5ff;
}

.profile-account-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.profile-account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-account-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #8b5cf6, #d946ef);
  flex-shrink: 0;
}

.profile-account-text {
  min-width: 0;
}

.profile-account-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-account-role {
  font-size: 0.72rem;
  color: #71717a;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-active-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  flex-shrink: 0;
}

/* ── Menu Footer (Sign Out) ── */
.profile-menu-footer {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f4f4f5;
}

.profile-logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.profile-logout-btn:hover {
  background-color: #fef2f2;
  color: #dc2626;
}

.profile-logout-btn i {
  font-size: 0.95rem;
  color: #94a3b8;
  transition: color 0.15s;
}

.profile-logout-btn:hover i {
  color: #dc2626;
}

/* ═══════════════════════════════════════════════
   🌙 GLOBAL DARK MODE THEME STYLES
   ═══════════════════════════════════════════════ */
html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background-color: #09090b !important;
  color: #f4f4f5 !important;
}

/* Dark Mode Navigation & Header */
html[data-theme="dark"] .site-header {
  background-color: rgba(9, 9, 11, 0.85) !important;
  border-bottom: 1px solid rgba(39, 39, 42, 0.9) !important;
}

html[data-theme="dark"] .profile-menu-card {
  background: rgba(18, 18, 23, 0.96) !important;
  border-color: rgba(63, 63, 70, 0.8) !important;
  color: #f4f4f5 !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

html[data-theme="dark"] .profile-menu-header,
html[data-theme="dark"] .profile-menu-footer {
  border-color: #27272a !important;
}

html[data-theme="dark"] .profile-header-name,
html[data-theme="dark"] .profile-account-name {
  color: #f4f4f5 !important;
}

html[data-theme="dark"] .profile-header-email,
html[data-theme="dark"] .profile-account-role {
  color: #a1a1aa !important;
}

html[data-theme="dark"] .profile-menu-item {
  color: #d4d4d8 !important;
}

html[data-theme="dark"] .profile-menu-item:hover {
  background-color: #27272a !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .profile-menu-shortcut {
  background: #27272a !important;
  border-color: #3f3f46 !important;
  color: #a1a1aa !important;
}

html[data-theme="dark"] .profile-dark-mode-row {
  background: rgba(39, 39, 42, 0.6) !important;
  border-color: rgba(63, 63, 70, 0.7) !important;
}

html[data-theme="dark"] .profile-dark-mode-label {
  color: #fb7185 !important;
}

html[data-theme="dark"] .profile-account-item:hover,
html[data-theme="dark"] .profile-account-item.active {
  background-color: rgba(139, 92, 246, 0.12) !important;
}

html[data-theme="dark"] .profile-badge-pill {
  background: rgba(139, 92, 246, 0.2) !important;
  border-color: rgba(139, 92, 246, 0.35) !important;
  color: #c4b5fd !important;
}

html[data-theme="dark"] .profile-logout-btn {
  color: #a1a1aa !important;
}

html[data-theme="dark"] .profile-logout-btn:hover {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}

/* ── Dashboard Settings Controls ── */
.pref-section-card {
  transition: all 0.2s ease;
}

.pref-section-card:hover {
  border-color: rgba(139, 92, 246, 0.3) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.pref-section-card .form-check-input:checked {
  background-color: #8b5cf6;
  border-color: #8b5cf6;
}

html[data-theme="dark"] .pref-section-card {
  background-color: rgba(24, 24, 27, 0.7) !important;
  border-color: rgba(63, 63, 70, 0.7) !important;
  color: #f4f4f5 !important;
}

html[data-theme="dark"] .pref-section-card .bg-white {
  background-color: #18181b !important;
  border-color: #27272a !important;
  color: #f4f4f5 !important;
}

html[data-theme="dark"] .pref-section-card .border-bottom {
  border-color: #27272a !important;
}

/* ── Desktop Notification Dropdown ── */
.notification-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.desktop-notif-trigger {
  position: relative;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  color: #52525b !important;
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: 1.05rem !important;
  letter-spacing: 0.02em;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease !important;
  outline: none !important;
  user-select: none !important;
  text-decoration: none !important;
}

.desktop-notif-trigger::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-indigo, #8b5cf6), var(--brand-fuchsia, #d946ef));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.desktop-notif-trigger:hover,
.desktop-notif-trigger:focus {
  color: #18181b !important;
  background: rgba(24, 24, 27, 0.04) !important;
  box-shadow: none !important;
}

.desktop-notif-trigger:hover::after,
.desktop-notif-trigger:focus::after,
.desktop-notif-trigger.active::after {
  transform: scaleX(1);
}

.desktop-notif-trigger.active {
  color: #7c3aed !important;
  background: rgba(139, 92, 246, 0.08) !important;
}

.desktop-notif-badge {
  position: absolute;
  top: 0px;
  right: 0px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  line-height: 1;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
  z-index: 2;
}

.desktop-notif-menu-card {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.97);
  transform-origin: top right;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1060;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.desktop-notif-menu-card.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.desktop-notif-header {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.desktop-notif-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-notif-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
  font-family: 'Hind Siliguri','Inter',sans-serif;
}

.desktop-notif-count-pill {
  font-size: 0.7rem;
  font-weight: 700;
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 2px 8px;
  font-family: 'Inter',sans-serif;
}

.desktop-notif-mark-all {
  background: none;
  border: none;
  color: #6366f1;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}

.desktop-notif-mark-all:hover {
  background: #eef2ff;
  color: #4338ca;
}

.desktop-notif-list {
  max-height: 380px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.desktop-notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  cursor: pointer;
}

.desktop-notif-item:hover {
  background: #f8fafc;
}

.desktop-notif-item.is-unread {
  background: #f5f3ff;
}

.desktop-notif-item.is-unread:hover {
  background: #ede9fe;
}

.desktop-notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.desktop-notif-item-body {
  flex: 1;
  min-width: 0;
}

.desktop-notif-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-family: 'Hind Siliguri','Inter',sans-serif;
}

.desktop-notif-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8b5cf6;
  flex-shrink: 0;
}

.desktop-notif-item-msg {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.35;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: 'Hind Siliguri','Inter',sans-serif;
}

.desktop-notif-item-time {
  font-size: 0.68rem;
  color: #94a3b8;
  font-family: 'Inter', sans-serif;
}

.desktop-notif-footer {
  padding: 10px 16px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}

.desktop-notif-all-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4f46e5;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s;
}

.desktop-notif-all-btn:hover {
  color: #3730a3;
  text-decoration: underline;
}

/* Dark theme overrides */
[data-theme='dark'] .desktop-notif-menu-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
[data-theme='dark'] .desktop-notif-header,
[data-theme='dark'] .desktop-notif-footer {
  background: #0f172a;
  border-color: #334155;
}
[data-theme='dark'] .desktop-notif-title {
  color: #f8fafc;
}
[data-theme='dark'] .desktop-notif-count-pill {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.4);
}
[data-theme='dark'] .desktop-notif-item {
  border-color: #334155;
}
[data-theme='dark'] .desktop-notif-item:hover {
  background: #334155;
}
[data-theme='dark'] .desktop-notif-item.is-unread {
  background: rgba(139, 92, 246, 0.15);
}
[data-theme='dark'] .desktop-notif-item.is-unread:hover {
  background: rgba(139, 92, 246, 0.25);
}
[data-theme='dark'] .desktop-notif-item-title {
  color: #f1f5f9;
}
[data-theme='dark'] .desktop-notif-item-msg {
  color: #94a3b8;
}

[data-theme='dark'] .desktop-notif-trigger {
  color: #cbd5e1 !important;
}

[data-theme='dark'] .desktop-notif-trigger:hover,
[data-theme='dark'] .desktop-notif-trigger:focus {
  color: #f8fafc !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

[data-theme='dark'] .desktop-notif-trigger.active {
  color: #a78bfa !important;
  background: rgba(167, 139, 250, 0.12) !important;
}

[data-theme='dark'] .desktop-notif-badge {
  border-color: #0f172a;
}



