/* ==========================================================================
   SAATHI MATRIMONY - Premium Side Navigation Drawer
   Reusable component: drawer.css
   Styled to match the reference: light, flat single-column menu with a
   horizontal profile header and a compact "Go Premium" upsell footer.
   Design system shared with ../css/theme.css (Poppins, #E91E63/#FF9800/#7B1FA2)
   ========================================================================== */

:root {
  --drawer-width: 82vw;
  --drawer-width-min: 280px;
  --drawer-width-max: 400px;
  --drawer-duration: 300ms;
  --drawer-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --drawer-overlay: rgba(0, 0, 0, 0.45);
  --drawer-bg: #FFFFFF;
  --drawer-ink: #1A1A2E;
  --drawer-muted: #8A8A93;
  --drawer-icon: #6B7280;
  --drawer-soft: #FFF0F3;
  --drawer-line: #F3E5F5;
}

/* ---------- Hamburger toggle (top-left) ---------- */
.drawer-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--card, #ffffff);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(233, 30, 99, 0.08));
  color: var(--primary, #E91E63);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  position: relative;
  overflow: hidden;
}
.drawer-btn:hover {
  transform: scale(1.06);
  box-shadow: var(--shadow, 0 4px 20px rgba(233, 30, 99, 0.12));
  color: var(--primary-dark, #C2185B);
}
.drawer-btn:active { transform: scale(0.9); }

/* ---------- Overlay ---------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: var(--drawer-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--drawer-duration) var(--drawer-ease),
              visibility var(--drawer-duration) var(--drawer-ease);
}
body.drawer-open .drawer-overlay {
  opacity: 1;
  visibility: visible;
}

/* ---------- Drawer shell ---------- */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--drawer-width);
  min-width: var(--drawer-width-min);
  max-width: var(--drawer-width-max);
  height: 100%;
  height: 100dvh;
  z-index: 1101;
  display: flex;
  flex-direction: column;
  background: var(--drawer-bg);
  box-shadow: 10px 0 50px rgba(0, 0, 0, 0.22);
  transform: translateX(-100%);
  opacity: 0.55;
  visibility: hidden;
  will-change: transform;
  overflow: hidden;
  transition: transform var(--drawer-duration) var(--drawer-ease),
              opacity var(--drawer-duration) var(--drawer-ease),
              visibility var(--drawer-duration) var(--drawer-ease);
}
body.drawer-open .drawer {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

/* ---------- Header (horizontal profile) ---------- */
.drawer-header {
  position: relative;
  flex-shrink: 0;
  background: var(--drawer-bg);
  border-bottom: 1px solid var(--drawer-line);
  padding: 18px 16px;
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
  padding-right: 52px;
}
.drawer-close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--drawer-soft);
  color: var(--primary, #E91E63);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
  z-index: 2;
}
.drawer-close:hover { background: var(--primary, #E91E63); color: #fff; transform: rotate(90deg); }

.drawer-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.drawer-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #fff;
  box-shadow: 0 4px 14px rgba(233, 30, 99, 0.16);
  flex-shrink: 0;
}
.drawer-profile-text {
  flex: 1;
  min-width: 0;
}
.drawer-name {
  display: block;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--drawer-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drawer-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: 0.7rem;
  font-weight: 500;
  color: #2E7D32;
  background: rgba(76, 175, 80, 0.12);
  padding: 2px 8px;
  border-radius: 50px;
}
.drawer-verified i { color: #2E7D32; font-size: 0.8rem; }
.drawer-profile-chevron {
  color: var(--drawer-muted);
  font-size: 1rem;
  flex-shrink: 0;
  transition: color 0.2s ease, transform 0.2s ease;
}
.drawer-profile:hover .drawer-profile-chevron { color: var(--primary, #E91E63); transform: translateX(2px); }

/* ---------- Scrollable body ---------- */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px 16px;
  -webkit-overflow-scrolling: touch;
}
.drawer-body::-webkit-scrollbar { width: 3px; }
.drawer-body::-webkit-scrollbar-thumb {
  background: var(--primary-light, #F48FB1);
  border-radius: 4px;
}

/* ---------- Menu items (flat list) ---------- */
.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: none;
  background: none;
  text-decoration: none;
  color: var(--drawer-ink);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.drawer-item:hover {
  background: var(--drawer-soft);
  color: var(--primary, #E91E63);
  transform: translateX(4px);
}
.drawer-item.active {
  background: var(--drawer-soft);
  color: var(--primary, #E91E63);
  font-weight: 600;
}
.drawer-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: var(--gradient-primary, linear-gradient(135deg, #E91E63, #C2185B));
}
.drawer-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--drawer-icon);
  font-size: 1.18rem;
  transition: color 0.2s ease;
}
.drawer-item:hover .drawer-icon,
.drawer-item.active .drawer-icon {
  color: var(--primary, #E91E63);
}
.drawer-label { flex: 1; }

/* ---------- Footer premium upsell ---------- */
.drawer-footer {
  flex-shrink: 0;
  padding: 12px 14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--drawer-bg);
  border-top: 1px solid var(--drawer-line);
}
.drawer-premium {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #FDECF2, #FDEBF1);
  border: 1px solid rgba(233, 30, 99, 0.08);
  border-radius: 16px;
  padding: 12px 14px;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.drawer-premium:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(233, 30, 99, 0.14);
}
.drawer-premium:active { transform: scale(0.98); }
.drawer-premium-crown {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  background: var(--gradient-primary, linear-gradient(135deg, #E91E63, #C2185B));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}
.drawer-premium-info {
  flex: 1;
  min-width: 0;
}
.drawer-premium-title {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1A1A2E;
}
.drawer-premium-sub {
  display: block;
  font-size: 0.72rem;
  color: #A06A78;
}
.drawer-premium-go {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  color: var(--primary, #E91E63);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.drawer-premium:hover .drawer-premium-go { transform: translateX(2px); }

/* ---------- Ripple ---------- */
.drawer-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(233, 30, 99, 0.2);
  transform: scale(0);
  animation: drawerRipple 0.6s linear;
  pointer-events: none;
}
@keyframes drawerRipple { to { transform: scale(3.2); opacity: 0; } }
