/**
 * Webly Platform Drawer Stylesheet (SaaS Standard)
 * 100% Theme-Isolated & Encapsulated for Header & Footer Customizers
 */

[x-cloak] {
  display: none !important;
}

/* ==========================================================================
   DRAWER ROOT & ISOLATION RESETS
   ========================================================================== */
.webly-drawer-root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  color: #0f172a !important;
  line-height: 1.5 !important;
  box-sizing: border-box !important;
  -webkit-font-smoothing: antialiased;
}

.webly-drawer-root *,
.webly-drawer-root *::before,
.webly-drawer-root *::after {
  box-sizing: border-box !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

/* Force CSS isolation on standard elements inside drawer so theme css cannot leak */
.webly-drawer-root button,
.webly-drawer-root input,
.webly-drawer-root textarea,
.webly-drawer-root select,
.webly-drawer-root p,
.webly-drawer-root h1,
.webly-drawer-root h2,
.webly-drawer-root h3,
.webly-drawer-root h4,
.webly-drawer-root span,
.webly-drawer-root label,
.webly-drawer-root ul,
.webly-drawer-root li {
  margin: 0 !important;
  line-height: normal !important;
  box-sizing: border-box !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

/* ==========================================================================
   BACKDROP & DRAWER CONTAINER
   ========================================================================== */
.webly-drawer-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.5) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  z-index: 999990 !important;
}

.webly-drawer-panel {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 620px !important;
  background: #ffffff !important;
  border-left: 1px solid #e2e8f0 !important;
  box-shadow: -15px 0 45px rgba(15, 23, 42, 0.16) !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 999995 !important;
  color: #0f172a !important;
}

/* ==========================================================================
   DRAWER HEADER
   ========================================================================== */
.webly-drawer-header {
  padding: 20px 24px 18px 24px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

.webly-drawer-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 3px 9px !important;
  border-radius: 9999px !important;
  background: #ecfdf5 !important;
  color: #059669 !important;
  border: 1px solid #a7f3d0 !important;
  margin-bottom: 4px !important;
}

.webly-drawer-title {
  display: block !important;
  font-size: 1.22rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.02em !important;
  margin: 4px 0 2px 0 !important;
}

.webly-drawer-subtitle {
  display: block !important;
  font-size: 0.8rem !important;
  color: #64748b !important;
  margin: 0 !important;
}

.webly-drawer-close {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
  font-size: 1rem !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
}

.webly-drawer-close:hover {
  background: #fee2e2 !important;
  color: #ef4444 !important;
  border-color: #fca5a5 !important;
}

/* ==========================================================================
   SEGMENTED TABS TRACK
   ========================================================================== */
.webly-drawer-tabs-bar {
  padding: 10px 24px !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  overflow-x: auto !important;
  flex-shrink: 0 !important;
}

.webly-drawer-tabs-track {
  display: inline-flex !important;
  background: #e2e8f0 !important;
  padding: 3px !important;
  border-radius: 8px !important;
  gap: 2px !important;
}

.webly-drawer-tab {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 7px 14px !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  color: #64748b !important;
  border-radius: 6px !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
}

.webly-drawer-tab:hover {
  color: #0f172a !important;
}

.webly-drawer-tab--active {
  background: #ffffff !important;
  color: #2563eb !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

/* ==========================================================================
   DRAWER BODY & CARDS
   ========================================================================== */
.webly-drawer-body {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  padding: 24px !important;
  background: #f8fafc !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

.webly-drawer-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 18px 20px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

.webly-drawer-card--highlight {
  border-left: 3px solid #2563eb !important;
}

.webly-drawer-label {
  display: block !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  letter-spacing: -0.01em !important;
}

.webly-drawer-input,
.webly-drawer-textarea,
.webly-drawer-select {
  display: block !important;
  width: 100% !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 7px !important;
  padding: 9px 13px !important;
  font-size: 0.88rem !important;
  color: #0f172a !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.webly-drawer-input:focus,
.webly-drawer-textarea:focus,
.webly-drawer-select:focus {
  outline: none !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16) !important;
}

.webly-drawer-input::placeholder,
.webly-drawer-textarea::placeholder {
  color: #94a3b8 !important;
}

.webly-drawer-help {
  display: block !important;
  font-size: 0.76rem !important;
  color: #64748b !important;
  margin-top: 2px !important;
  line-height: 1.4 !important;
}

.webly-drawer-grid-2 {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 14px !important;
}

@media (max-width: 520px) {
  .webly-drawer-grid-2 {
    grid-template-columns: 1fr !important;
  }
}

/* Row items inside cards (e.g. Nav link items) */
.webly-drawer-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.webly-drawer-index {
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: #2563eb !important;
  font-family: monospace !important;
  background: #eff6ff !important;
  padding: 4px 8px !important;
  border-radius: 5px !important;
  border: 1px solid #bfdbfe !important;
}

.webly-drawer-remove {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 6px !important;
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  color: #ef4444 !important;
  cursor: pointer !important;
  font-size: 0.9rem !important;
  transition: all 0.15s ease !important;
}

.webly-drawer-remove:hover {
  background: #fee2e2 !important;
  border-color: #f87171 !important;
  color: #dc2626 !important;
}

.webly-drawer-pill-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 12px !important;
  border-radius: 7px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #334155 !important;
}

.webly-drawer-pill-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

.webly-drawer-pill-btn--active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25) !important;
}

.webly-drawer-pill-btn--active:hover {
  background: #1d4ed8 !important;
  color: #ffffff !important;
}

/* ==========================================================================
   DRAWER FOOTER & BUTTONS
   ========================================================================== */
.webly-drawer-footer {
  padding: 16px 24px !important;
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

.webly-drawer-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 9px 18px !important;
  border-radius: 7px !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.webly-drawer-btn-primary {
  background: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25) !important;
}

.webly-drawer-btn-primary:hover {
  background: #1d4ed8 !important;
}

.webly-drawer-btn-secondary {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

.webly-drawer-btn-secondary:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.webly-drawer-btn-danger {
  background: #fef2f2 !important;
  color: #ef4444 !important;
  border: 1px solid #fecaca !important;
}

.webly-drawer-btn-danger:hover {
  background: #fee2e2 !important;
  color: #dc2626 !important;
}

/* ==========================================================================
   FLOATING LAUNCH PILL BUTTONS (On-Screen in Edit Mode)
   ========================================================================== */
.webly-header-edit-bar {
  display: flex !important;
  justify-content: start !important;
  align-items: center !important;
  padding: 7px 16px !important;
  background: rgba(15, 23, 42, 0.9) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  position: relative !important;
  z-index: 100 !important;
}

.webly-header-edit-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px 16px !important;
  background: #2563eb !important;
  color: #ffffff !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  border-radius: 9999px !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.webly-header-edit-btn:hover {
  background: #1d4ed8 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5) !important;
}

.webly-footer-edit-bar {
  display: flex !important;
  justify-content: start !important;
  align-items: center !important;
  padding: 16px 0 !important;
  background: transparent !important;
  margin-left: 15px;
  margin-bottom: 50px;
}

.webly-footer-edit-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 9px 22px !important;
  background: #2563eb !important;
  color: #ffffff !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  border: 1px solid #1d4ed8 !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.webly-footer-edit-btn:hover {
  background: #1d4ed8 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45) !important;
}

/* ==========================================================================
   MODAL DIALOGS ELEVATION (Above Drawers)
   ========================================================================== */
.mp-overlay {
  z-index: 10000000 !important;
}

.mp-lightbox {
  z-index: 10000010 !important;
}