/*
 * SMS Preview Component Styles
 *
 * Styles for the SMS tab in the campaign content editor.
 * Matches Figma design specifications.
 */

/* ============================================
   LAYOUT
   ============================================ */

.sms-preview-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 32px;
  min-height: 560px;
  padding: 32px 56px;
  position: relative;
}

/* Floating notice - speech bubble */
.sms-floating-notice {
  width: 300px;
  padding: 24px;
  background: #fafafa;
  border: 1px solid #eceff0;
  border-radius: 24px;
  margin-top: 24px;
  position: relative;
  flex-shrink: 0;
  align-self: flex-start;
}

.sms-floating-notice p {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  color: #52595f;
  text-align: center;
  margin: 0;
}

/* Speech bubble arrow pointing right */
.sms-floating-notice::after {
  content: "";
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 12px solid #fafafa;
}

.sms-floating-notice::before {
  content: "";
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 13px solid #eceff0;
}

/* ============================================
   iPHONE MOCKUP
   ============================================ */

.sms-iphone-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: flex-start;
}

.sms-iphone-container {
  position: relative;
  display: flex;
  align-items: flex-start;
}

/* Smart field button - floating on right edge of bubble wrapper */
.sms-smart-field-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  opacity: 1 !important;
  z-index: 10;
}

.sms-iphone {
  width: 299px;
  background: #e4e4e7;
  border-radius: 40px;
  padding: 8px;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.05);
}

.sms-iphone-frame {
  background: #fff;
  border-radius: 32px;
  overflow: hidden;
  position: relative;
}

/* Dynamic Island / Notch */
.sms-iphone-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 24px;
  background: #1c1c1e;
  border-radius: 16px;
  z-index: 10;
}

/* Message header */
.sms-iphone-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 44px 16px 12px;
  background: #fafafa;
  border-bottom: 1px solid #eceff0;
}

.sms-iphone-back {
  color: #000b14;
}

.sms-iphone-avatar {
  width: 28px;
  height: 28px;
  background: #eceff0;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #52595f;
}

.sms-iphone-business {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #000b14;
}

/* Message content */
.sms-iphone-content {
  height: 480px;
  padding: 16px;
  background: #fff;
  overflow-y: auto;
  position: relative;
}

/* Message bubble wrapper - for smart field editor */
.sms-message-bubble-wrapper {
  position: relative;
  max-width: 253px;
}

/* Message bubble */
.sms-message-bubble {
  padding: 16px;
  background: #fafafa;
  border-radius: 12px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: #000b14;
  min-height: auto;
  outline: none;
  white-space: pre-wrap; /* Preserve line breaks and wrap text */
  word-wrap: break-word; /* Break long words if needed */
}

/* Ensure multiple consecutive <br> tags are all visible */
.sms-message-bubble br {
  display: block;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

/* Use ::after to add actual height to each <br> tag */
.sms-message-bubble br::after {
  content: "";
  display: block;
  height: 1.5em;
  line-height: 1.5;
}

/* Add extra spacing between consecutive <br> tags */
.sms-message-bubble br + br {
  margin-top: 0;
}

.sms-message-bubble br + br::after {
  height: 1.5em; /* Ensure consecutive br tags each create a line break */
}

/* Empty divs used for multiple line breaks */
.sms-message-bubble .line-break-spacer {
  height: 1.5em;
  min-height: 1.5em;
  margin: 0;
  padding: 0;
  display: block;
}

.sms-message-bubble:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.sms-message-bubble:empty::before {
  content: attr(data-placeholder);
  color: #858a8e;
  pointer-events: none;
}

/* Timestamp */
.sms-message-time {
  display: block;
  text-align: right;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: #000b14;
  margin-top: 8px;
}


/* Home indicator */
.sms-iphone-home-indicator {
  width: 120px;
  height: 4px;
  background: #000;
  border-radius: 2px;
  margin: 16px auto 12px;
}

/* ============================================
   EMOJI BAR
   ============================================ */

.sms-emoji-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: #fff;
  border-radius: 24px;
  margin-top: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sms-emoji-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s ease;
  padding: 0;
}

.sms-emoji-btn:hover {
  background: #f5f5f5;
}

.sms-emoji-btn--icon {
  color: #858a8e;
}

.sms-emoji-btn--add {
  color: #858a8e;
}

/* ============================================
   FADED EMAIL PREVIEW (Right side iPad)
   ============================================ */

.sms-preview-hint--right {
  opacity: 0.4;
  pointer-events: none;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 70px;
}

/* iPad frame for email preview */
.sms-email-preview-ipad {
  width: 473px;
  height: 540px;
  background: #e4e4e7;
  border-radius: 18px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sms-email-preview-frame {
  background: #fafafa;
  border-radius: 18px;
  border: 1px solid #eceff0;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Gmail toolbar */
.sms-email-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #fff;
}

.sms-email-toolbar-icon {
  color: #52595f;
  flex-shrink: 0;
}

.sms-email-toolbar-icons {
  display: flex;
  gap: 6px;
  flex: 1;
}

.sms-email-toolbar-dot {
  width: 12px;
  height: 12px;
  background: #d6d8d9;
  border-radius: 2px;
}

.sms-email-toolbar-pagination {
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 8px;
  color: rgba(0, 0, 0, 0.54);
}

.sms-email-toolbar-arrow {
  color: #52595f;
  flex-shrink: 0;
}

/* Subject row */
.sms-email-subject-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fafafa;
}

.sms-email-subject {
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #202124;
}

.sms-email-important-icon {
  color: #f4b400;
  flex-shrink: 0;
}

.sms-email-badge {
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 7px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 2px;
}

/* Sender row */
.sms-email-sender-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 12px;
  background: #fafafa;
  border-bottom: 1px solid #eceff0;
}

.sms-email-sender-avatar {
  width: 22px;
  height: 22px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  flex-shrink: 0;
}

.sms-email-sender-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sms-email-sender-line1 {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
}

.sms-email-sender-line2 {
  display: flex;
  align-items: center;
  gap: 2px;
}

.sms-email-sender-name {
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 8px;
  font-weight: 700;
  color: #202124;
}

.sms-email-sender-email {
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 7px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.54);
}

.sms-email-unsubscribe {
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 6px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.54);
}

.sms-email-to {
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 7px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.54);
}

.sms-email-dropdown-arrow {
  color: rgba(0, 0, 0, 0.54);
}

.sms-email-timestamp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sms-email-time {
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 7px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.sms-email-star,
.sms-email-reply,
.sms-email-more {
  color: rgba(0, 0, 0, 0.54);
  flex-shrink: 0;
}

/* Email content */
.sms-email-content {
  padding: 16px 12px;
  background: #fafafa;
  flex: 1;
}

.sms-email-logo {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #000b14;
  margin-bottom: 12px;
}

.sms-email-headline {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #000b14;
  margin: 0 0 12px 0;
}

.sms-email-body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 9px;
  line-height: 1.5;
  color: #858a8e;
  margin: 0 0 24px 0;
}

/* Action buttons */
.sms-email-actions {
  display: flex;
  gap: 4px;
}

.sms-email-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 2px;
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 8px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.54);
  cursor: default;
}
