/* ==========================================================================
   PARIKSHAGYAN TOP HEADER BAR & ACCOUNT DROPDOWN (MODULAR COMPONENT)
   ========================================================================== */

:root {
  --pg-parchment-border: #e6dac8;
  --pg-brand-primary: #8d3408;
  --pg-text-primary: #2c1a10;
  --pg-text-secondary: #57534e;
}

.pg-top-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  z-index: 99999 !important;
  background: #f2dbc0 !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(141, 52, 8, 0.14);
  box-shadow: 0 4px 18px rgba(90, 50, 20, 0.05);
  box-sizing: border-box !important;
}

/* Ensure inner pages (policy, terms, contact, etc.) have top space for fixed header */
body:not(.pg-homepage-body) {
  margin-top: 0 !important;
  padding-top: 72px !important;
}

/* Hide default ghost theme header block */
body:not(.pg-homepage-body) header.wp-block-template-part,
body:not(.pg-homepage-body) .wp-block-template-part[data-slug="header"] {
  display: none !important;
}

/* Zero out WordPress block theme top gaps */
body:not(.pg-homepage-body) main.wp-block-group,
body:not(.pg-homepage-body) .wp-block-group.alignfull {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.wp-block-shortcode:has(.pg-top-header),
.wp-block-group:has(.pg-top-header) {
  margin: 0 !important;
  padding: 0 !important;
}

.pg-top-header-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-sizing: border-box;
}

.pg-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

/* Hamburger Button (Default: hidden on desktop) */
.pg-hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  padding: 8px;
  background: rgba(230, 218, 200, 0.35);
  border: 1px solid var(--pg-parchment-border);
  border-radius: 8px;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.pg-hamburger-btn:hover {
  background: rgba(141, 52, 8, 0.08);
  border-color: var(--pg-brand-primary);
}

.pg-hamburger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--pg-text-primary);
  border-radius: 2px;
  transition: all 0.2s ease;
}

/* Brand Logo & Title */
.pg-brand-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.pg-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.pg-brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  display: block;
}

.pg-brand-text {
  display: flex;
  flex-direction: column;
}

.pg-brand-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--pg-text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap !important;
}

.pg-brand-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.3;
  margin-top: 1px;
  white-space: nowrap !important;
}

/* Right Nav Links */
.pg-header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-shrink: 0;
}

.pg-nav-link {
  color: var(--pg-text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap !important;
  transition: color 0.2s ease;
}

.pg-nav-link:hover {
  color: var(--pg-brand-primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Header Account Dropdown Menu */
.pg-header-account-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.pg-header-account-btn {
  background: transparent;
  border: none;
  padding: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pg-brand-primary);
  border-radius: 50%;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.pg-header-account-btn:hover {
  transform: scale(1.06);
  opacity: 0.9;
}

.pg-header-account-icon {
  color: var(--pg-brand-primary);
  display: block;
}

.pg-header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8d3408, #b45309);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(141, 52, 8, 0.25);
  border: 1.5px solid #f2e7d7;
}

/* Floating Dropdown Card */
.pg-header-account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 230px;
  background: linear-gradient(180deg, #fdfbf7 0%, #f7f1e5 100%);
  border: 1px solid var(--pg-parchment-border);
  border-radius: 14px;
  padding: 12px 10px;
  box-shadow: 0 10px 30px rgba(70, 35, 12, 0.12);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 3px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
  pointer-events: none;
}

.pg-header-account-wrap:hover .pg-header-account-dropdown,
.pg-header-account-wrap:focus-within .pg-header-account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.pg-header-account-dropdown::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.pg-acc-dd-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 8px;
}

.pg-acc-dd-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8d3408, #b45309);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pg-acc-dd-avatar--guest {
  background: #f1ebd9;
  color: var(--pg-brand-primary);
  border: 1px solid #e6dac8;
}

.pg-acc-dd-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pg-acc-dd-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--pg-text-primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pg-acc-dd-email {
  font-size: 11px;
  color: var(--pg-text-secondary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pg-acc-dd-divider {
  height: 1px;
  background: var(--pg-parchment-border);
  margin: 4px 4px 6px;
}

.pg-acc-dd-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--pg-text-primary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pg-acc-dd-link:hover {
  background: rgba(230, 218, 200, 0.5);
  color: var(--pg-brand-primary);
}

.pg-acc-dd-link svg {
  color: var(--pg-brand-primary);
  flex-shrink: 0;
}

.pg-acc-dd-link--logout {
  color: #dc2626 !important;
}

.pg-acc-dd-link--logout svg {
  color: #dc2626 !important;
}

.pg-acc-dd-link--logout:hover {
  background: #fee2e2 !important;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 900px) {
  .pg-hamburger-btn {
    display: inline-flex !important;
  }

  .pg-header-nav {
    display: none !important;
  }
}

@media (max-width: 580px) {
  .pg-top-header {
    padding: 0 !important;
    margin: 0 !important;
    border-bottom: 1px solid var(--pg-parchment-border) !important;
  }

  .pg-top-header-inner {
    padding: 8px 14px !important;
    gap: 8px !important;
  }

  .pg-brand-logo {
    width: 36px;
    height: 36px;
  }

  .pg-brand-title {
    font-size: 18px;
  }

  .pg-brand-subtitle {
    font-size: 10.5px;
  }

  .pg-header-nav {
    display: none !important;
  }
}

/* ==========================================================================
   MOBILE SIDEBAR DRAWER & OVERLAY (mobile-mode-sidebar.JPG Layout)
   ========================================================================== */
.pg-sidebar-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: rgba(20, 10, 5, 0.45) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 99999998 !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  touch-action: none;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s;
}

.pg-sidebar-overlay.is-open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.pg-mobile-sidebar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  height: 100vh !important;
  height: 100dvh !important;
  width: min(280px, 80vw) !important;
  max-width: 85vw !important;
  margin: 0 !important;
  padding: 0 !important;
  background: linear-gradient(180deg, #fdfbf7 0%, #f7f1e5 100%) !important;
  border-right: 1px solid var(--pg-parchment-border) !important;
  border-top: none !important;
  border-bottom: none !important;
  border-left: none !important;
  border-radius: 0 !important;
  box-shadow: none;
  z-index: 99999999 !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translateX(-100%) !important;
  visibility: hidden !important;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.3s !important;
  box-sizing: border-box !important;
  font-family: "Poppins", system-ui, -apple-system, sans-serif !important;
}

.pg-mobile-sidebar.is-open {
  transform: translateX(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
  box-shadow: 10px 0 40px rgba(44, 26, 16, 0.35) !important;
}

body.pg-sidebar-open {
  overflow-y: hidden !important;
  touch-action: none !important;
}

.pg-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Top Centered Profile */
.pg-sb-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px 4px;
}

.pg-sb-avatar-wrap {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pg-sb-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(141, 52, 8, 0.16));
}

.pg-sb-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--pg-text-primary);
  margin: 0;
  padding: 0;
  line-height: 1.25;
}

.pg-sb-email {
  font-size: 12px;
  color: var(--pg-text-secondary);
  margin: 3px 0 0 0;
  padding: 0;
  word-break: break-all;
  line-height: 1.3;
}

.pg-sb-divider {
  height: 1px;
  background: var(--pg-parchment-border);
  margin: 16px 14px 10px;
}

/* Navigation List */
.pg-sb-nav {
  display: flex;
  flex-direction: column;
  padding: 2px 10px;
  gap: 4px;
}

.pg-sb-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--pg-text-primary);
  border: none;
  background: transparent;
  box-shadow: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pg-sb-link:hover {
  background: rgba(141, 52, 8, 0.06);
  color: var(--pg-brand-primary);
}

.pg-sb-link.active {
  background: #f2e6d6;
  color: #8d3408;
  font-weight: 600;
}

.pg-sb-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--pg-text-primary);
}

.pg-sb-link.active .pg-sb-icon {
  color: #8d3408;
}

.pg-sb-text {
  font-size: 14px;
  line-height: 1.2;
}

/* Bottom Logout / Auth Section */
.pg-sb-footer {
  margin-top: auto;
  border-top: 1px solid var(--pg-parchment-border);
  padding: 14px 16px;
}

.pg-sb-logout-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  color: #dc2626;
  transition: background-color 0.15s ease;
}

.pg-sb-logout-link:hover {
  background: rgba(220, 38, 38, 0.08);
}

.pg-sb-auth-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 10px;
}

.pg-sb-auth-text-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.pg-sb-auth-link {
  color: var(--pg-brand-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.pg-sb-auth-link:hover {
  text-decoration: underline;
}

.pg-sb-auth-sep {
  color: var(--pg-text-secondary);
}

/* ==========================================================================
   DARK MODE SUPPORT (TOP HEADER BAR, DROPDOWN & SIDEBAR)
   ========================================================================== */
body.dark-mode .pg-top-header,
body.dark .pg-top-header {
  background: rgba(18, 18, 22, 0.95) !important;
  border-bottom: 1px solid #272730 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45) !important;
}

body.dark-mode .pg-brand-title,
body.dark .pg-brand-title {
  color: #f4f4f5 !important;
}

body.dark-mode .pg-brand-subtitle,
body.dark .pg-brand-subtitle {
  color: #a1a1aa !important;
}

body.dark-mode .pg-nav-link,
body.dark .pg-nav-link {
  color: #d4d4d8 !important;
}

body.dark-mode .pg-nav-link:hover,
body.dark .pg-nav-link:hover {
  color: #fbbf24 !important;
}

body.dark-mode .pg-hamburger-btn,
body.dark .pg-hamburger-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: #3f3f46 !important;
}

body.dark-mode .pg-hamburger-bar,
body.dark .pg-hamburger-bar {
  background: #f4f4f5 !important;
}

body.dark-mode .pg-header-account-dropdown,
body.dark .pg-header-account-dropdown {
  background: #18181b !important;
  border-color: #27272a !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
}

body.dark-mode .pg-acc-dd-name,
body.dark .pg-acc-dd-name {
  color: #f4f4f5 !important;
}

body.dark-mode .pg-acc-dd-email,
body.dark .pg-acc-dd-email {
  color: #a1a1aa !important;
}

body.dark-mode .pg-acc-dd-divider,
body.dark .pg-acc-dd-divider {
  background: #27272a !important;
}

body.dark-mode .pg-acc-dd-link,
body.dark .pg-acc-dd-link {
  color: #e4e4e7 !important;
}

body.dark-mode .pg-acc-dd-link:hover,
body.dark .pg-acc-dd-link:hover {
  background: #27272a !important;
  color: #fbbf24 !important;
}

body.dark-mode .pg-sidebar-overlay,
body.dark .pg-sidebar-overlay {
  background: rgba(0, 0, 0, 0.7) !important;
}

body.dark-mode .pg-mobile-sidebar,
body.dark .pg-mobile-sidebar {
  background: #141418 !important;
  border-right-color: #272730 !important;
  box-shadow: 10px 0 35px rgba(0, 0, 0, 0.65) !important;
}

body.dark-mode .pg-sb-name,
body.dark .pg-sb-name {
  color: #f4f4f5 !important;
}

body.dark-mode .pg-sb-email,
body.dark .pg-sb-email {
  color: #a1a1aa !important;
}

body.dark-mode .pg-sb-divider,
body.dark-mode .pg-sb-footer,
body.dark .pg-sb-divider,
body.dark .pg-sb-footer {
  border-color: #272730 !important;
  background-color: #141418 !important;
}

body.dark-mode .pg-sb-link,
body.dark .pg-sb-link {
  color: #e4e4e7 !important;
}

body.dark-mode .pg-sb-link:hover,
body.dark .pg-sb-link:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fbbf24 !important;
}

body.dark-mode .pg-sb-link.active,
body.dark .pg-sb-link.active {
  background: #272730 !important;
  color: #fbbf24 !important;
}

body.dark-mode .pg-sb-link.active .pg-sb-icon,
body.dark .pg-sb-link.active .pg-sb-icon {
  color: #fbbf24 !important;
}

body.dark-mode .pg-sb-icon,
body.dark .pg-sb-icon {
  color: #e4e4e7 !important;
}