/* Shivam Mehta — Inline Visual Studio (Elementor-Style Editor) */

body.sm-editor-active .editable-target,
body.sm-editor-active [data-cms] {
  transition: outline 0.15s ease, background-color 0.15s ease !important;
  cursor: text !important;
}

body.sm-editor-active .editable-target:hover,
body.sm-editor-active [data-cms]:hover {
  outline: 2px dashed var(--blue, #183cd1) !important;
  outline-offset: 4px !important;
  border-radius: 4px !important;
}

body.sm-editor-active .editable-target:focus,
body.sm-editor-active [data-cms]:focus {
  outline: 2px solid var(--blue, #183cd1) !important;
  outline-offset: 4px !important;
  background-color: rgba(24, 60, 209, 0.06) !important;
  border-radius: 4px !important;
}

/* Image Swap Trigger */
body.sm-editor-active [data-cms-image],
body.sm-editor-active .portrait-object,
body.sm-editor-active .project-cover {
  position: relative;
  cursor: pointer !important;
}

body.sm-editor-active .sm-image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 23, 0.65);
  backdrop-filter: blur(4px);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 20;
  pointer-events: none;
}

body.sm-editor-active [data-cms-image]:hover .sm-image-overlay,
body.sm-editor-active .portrait-object:hover .sm-image-overlay,
body.sm-editor-active .project-cover:hover .sm-image-overlay {
  opacity: 1;
}

/* Floating Editor Dock */
#sm-editor-dock {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 22, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.1);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #f1f3f5;
  font-size: 13px;
  user-select: none;
  animation: smDockSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes smDockSlideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.sm-dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: transparent;
  color: #e2e8f0;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sm-dock-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sm-dock-btn.active {
  background: #183cd1;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(24, 60, 209, 0.4);
}

.sm-dock-btn.save-btn {
  background: #10b981;
  color: #ffffff;
  font-weight: 600;
  padding: 6px 14px;
}

.sm-dock-btn.save-btn:hover {
  background: #059669;
}

.sm-dock-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
}

/* Flyout Dialogs / Drawers */
.sm-flyout-panel {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 22, 26, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  padding: 20px;
  z-index: 9999998;
  width: 380px;
  max-width: calc(100vw - 32px);
  color: #f1f3f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  animation: smFlyoutFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes smFlyoutFade {
  from { opacity: 0; transform: translate(-50%, 10px) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.sm-flyout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  font-size: 14px;
}

.sm-flyout-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}

.sm-flyout-close:hover {
  color: #ffffff;
}

.sm-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
}

.sm-field-label {
  color: #94a3b8;
}

.sm-color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sm-color-input {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}

.sm-text-input,
.sm-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 6px 10px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
  width: 140px;
}

.sm-text-input:focus,
.sm-select:focus {
  border-color: #183cd1;
  background: rgba(255, 255, 255, 0.12);
}

.sm-select option {
  background: #181b20;
  color: #ffffff;
}

/* Toast Message */
#sm-editor-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: #ffffff;
  padding: 10px 22px;
  border-radius: 30px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
  z-index: 10000000;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: smToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes smToastIn {
  from { opacity: 0; transform: translate(-50%, -15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}


/* Floating Launcher Pill when editor is closed */
#sm-editor-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  z-index: 999999;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background 0.2s ease;
}

#sm-editor-launcher:hover {
  transform: translateY(-2px) scale(1.03);
  background: #183cd1;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 14px 35px rgba(24, 60, 209, 0.4);
}

/* Floating Rich Text Selection Bubble (Elementor / Medium style) */
#sm-inline-bubble {
  position: absolute;
  z-index: 10000002;
  background: rgba(18, 20, 26, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -100%);
  margin-top: -8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#sm-inline-bubble.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -100%);
}

#sm-inline-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: rgba(18, 20, 26, 0.95) transparent transparent transparent;
}

.sm-bubble-btn {
  background: transparent;
  border: none;
  color: #e2e8f0;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.sm-bubble-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.sm-bubble-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 2px;
}

/* Color Palette Dropdown inside bubble */
.sm-color-swatch-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.sm-color-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: #183cd1;
}

.sm-bubble-palette {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  background: #181b22;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 8px;
  display: none;
  grid-template-columns: repeat(5, 22px);
  gap: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  z-index: 10000005;
}

.sm-bubble-palette.open {
  display: grid;
}

.sm-color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.sm-color-dot:hover {
  transform: scale(1.2);
  border-color: #ffffff;
}

.sm-custom-color-picker {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
}

/* Position bubble below when selected near top of screen */
#sm-inline-bubble.position-below {
  transform: translate(-50%, 0);
  margin-top: 8px;
}
#sm-inline-bubble.position-below::after {
  top: -6px;
  bottom: auto;
  border-width: 0 6px 6px;
  border-color: transparent transparent rgba(18, 20, 26, 0.95) transparent;
}

/* Ensure effortless text selection across all tags */
body.sm-editor-active .editable-target,
body.sm-editor-active [contenteditable="true"],
body.sm-editor-active .editable-target * {
  user-select: text !important;
  -webkit-user-select: text !important;
}

/* Hero Section Interactive Overrides for Edit Mode */
body.sm-editor-active .hero-words {
  pointer-events: auto !important;
  z-index: 20 !important;
}

body.sm-editor-active .hero-statement,
body.sm-editor-active .hero-statement > span,
body.sm-editor-active .hero-description,
body.sm-editor-active .hero-description > p,
body.sm-editor-active .hero-meta,
body.sm-editor-active .hero-positioning,
body.sm-editor-active .hero-baseline,
body.sm-editor-active .hero-baseline > span {
  pointer-events: auto !important;
  cursor: text !important;
  user-select: text !important;
  -webkit-user-select: text !important;
}

body.sm-editor-active .hero-name {
  pointer-events: auto !important;
  z-index: 15 !important;
  cursor: text !important;
  user-select: text !important;
  -webkit-user-select: text !important;
}

body.sm-editor-active .hero-name > span {
  pointer-events: auto !important;
  display: inline-block !important;
  cursor: text !important;
  user-select: text !important;
  -webkit-user-select: text !important;
}

body.sm-editor-active .hero-proof,
body.sm-editor-active .hero-reviews,
body.sm-editor-active .review-float,
body.sm-editor-active .review-float p,
body.sm-editor-active .hero-revenue,
body.sm-editor-active .hero-revenue * {
  pointer-events: auto !important;
  z-index: 20 !important;
}

/* Ensure photo room layer doesn't block hero words or hero name */
body.sm-editor-active .working-room {
  pointer-events: none !important;
  z-index: 1 !important;
}

body.sm-editor-active .portrait-object {
  pointer-events: auto !important;
  z-index: 2 !important;
}

/* Section Reordering Styles (Elementor-Style On-Page & Panel) */
body.sm-editor-active main > section,
body.sm-editor-active main > footer {
  position: relative !important;
}

.sm-section-handle {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 20, 26, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #e2e8f0;
}

body.sm-editor-active main > section:hover .sm-section-handle,
body.sm-editor-active main > footer:hover .sm-section-handle {
  opacity: 1;
  pointer-events: auto;
}

.sm-handle-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.sm-handle-btn:hover {
  background: #183cd1;
  transform: scale(1.15);
}

.sm-handle-label {
  letter-spacing: 0.04em;
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
  padding: 0 4px;
}

/* Sections Flyout Panel Styling */
.sm-section-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 6px;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sm-section-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.sm-section-title {
  font-size: 12px;
  font-weight: 500;
  color: #f1f5f9;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sm-section-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sm-order-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: background 0.15s ease;
}

.sm-order-btn:hover {
  background: #183cd1;
}

.sm-order-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Studio Credential Screen (Modal & Lock) */
#sm-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 16, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: smFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.sm-auth-card {
  background: #141720;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  width: 100%;
  max-width: 380px;
  padding: 32px 28px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  text-align: center;
  animation: smScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.sm-auth-icon {
  width: 56px;
  height: 56px;
  background: rgba(24, 60, 209, 0.15);
  border: 1px solid rgba(24, 60, 209, 0.4);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 18px;
  box-shadow: 0 0 25px rgba(24, 60, 209, 0.25);
}

.sm-auth-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.sm-auth-desc {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 22px;
  line-height: 1.5;
}

.sm-auth-input-wrap {
  margin-bottom: 16px;
}

.sm-auth-input {
  width: 100%;
  padding: 13px 18px;
  background: #0a0c12;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #ffffff;
  font-size: 16px;
  letter-spacing: 0.12em;
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.sm-auth-input:focus {
  border-color: #183cd1;
  box-shadow: 0 0 0 3px rgba(24, 60, 209, 0.35);
}

.sm-auth-input.error {
  border-color: #ef4444;
  animation: smShake 0.4s ease;
}

.sm-auth-remember {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 20px;
  cursor: pointer;
  user-select: none;
}

.sm-auth-remember input {
  accent-color: #183cd1;
  cursor: pointer;
}

.sm-auth-actions {
  display: flex;
  gap: 10px;
}

.sm-auth-btn {
  flex: 1;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.sm-auth-btn-primary {
  background: #183cd1;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(24, 60, 209, 0.4);
}

.sm-auth-btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(24, 60, 209, 0.55);
}

.sm-auth-btn-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.sm-auth-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

@keyframes smFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes smScaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes smShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
