/**
 * 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(99, 102, 241, 0.65) !important;
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 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, #6366f1, #8b5cf6 55%, #d946ef);
  box-shadow: 0 2px 6px rgba(99, 102, 241, 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, #6366f1, #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: #4f46e5;
  background: #eef2ff;
  border: 1px solid #e0e7ff;
}

/* ── 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: #6366f1;
}

.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, #6366f1, #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(99, 102, 241, 0.12) !important;
}

html[data-theme="dark"] .profile-badge-pill {
  background: rgba(99, 102, 241, 0.2) !important;
  border-color: rgba(99, 102, 241, 0.35) !important;
  color: #a5b4fc !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(99, 102, 241, 0.3) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

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

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;
}

