/* =========================================
   Lazio Frame — Mac screen mockup element
   ========================================= */

/* ----------------------------------------
   Builder scaffolding: hide from flex layout
   ---------------------------------------- */
.lazio-frame > .brx-nestable-children-placeholder,
.lazio-frame > .brx-nestable-children {
  display: none;
}

/* Base frame */
.lazio-frame {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro', 'Segoe UI', Roboto, sans-serif;
  text-align: left;
}

/* ---------- Variant backgrounds ---------- */
.lazio-frame--dark  { background-color: #1e1e1e; }
.lazio-frame--light { background-color: #f6f6f6; }
.lazio-frame--white { background-color: #ffffff; }

/* ---------- Title bar ---------- */
.lazio-frame__titlebar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  flex-shrink: 0;
}

.lazio-frame--dark .lazio-frame__titlebar  { background: #2d2d2d; border-bottom: 1px solid rgba(0,0,0,0.35); }
.lazio-frame--light .lazio-frame__titlebar { background: #e8e8e8; border-bottom: 1px solid rgba(0,0,0,0.09); }
.lazio-frame--white .lazio-frame__titlebar { background: #f6f6f6; border-bottom: 1px solid rgba(0,0,0,0.09); }

/* ---------- Mac traffic light dots (real macOS colors) ---------- */
.lazio-frame__dots { display: flex; gap: 8px; min-width: 56px; }
.lazio-frame__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12);
}
.lazio-frame__dot--close    { background: #ED6A5E; border: 0.5px solid #CF544D; }
.lazio-frame__dot--minimize { background: #F5BF4F; border: 0.5px solid #D6A13E; }
.lazio-frame__dot--maximize { background: #61C454; border: 0.5px solid #2DAC2F; }

/* Spacer mirrors dots width for title centering */
.lazio-frame__dots-spacer { min-width: 56px; }

/* ---------- Title text ---------- */
.lazio-frame__title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
}
.lazio-frame--dark .lazio-frame__title  { color: rgba(255,255,255,0.85); }
.lazio-frame--light .lazio-frame__title { color: rgba(0,0,0,0.5); }
.lazio-frame--white .lazio-frame__title { color: rgba(0,0,0,0.5); }

/* ---------- Email meta fields ---------- */
.lazio-frame__email-meta {
  padding: 12px 16px 8px;
  flex-shrink: 0;
  text-align: left;
}

.lazio-frame__email-row {
  display: flex;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.3;
}

/* Separator between rows */
.lazio-frame__email-row + .lazio-frame__email-row {
  border-top: 1px solid rgba(0,0,0,0.06);
}

.lazio-frame__email-label {
  font-weight: 500;
  width: 60px;
  flex-shrink: 0;
}

.lazio-frame__email-value {
  flex: 1;
  min-width: 0;
  font-weight: normal;
}

/* Email meta variant colors */
.lazio-frame--dark .lazio-frame__email-meta  { border-bottom: 1px solid rgba(255,255,255,0.08); }
.lazio-frame--light .lazio-frame__email-meta { border-bottom: 1px solid rgba(0,0,0,0.06); }
.lazio-frame--white .lazio-frame__email-meta { border-bottom: 1px solid rgba(0,0,0,0.06); }

.lazio-frame--dark .lazio-frame__email-label  { color: rgba(255,255,255,0.5); }
.lazio-frame--light .lazio-frame__email-label { color: rgba(0,0,0,0.4); }
.lazio-frame--white .lazio-frame__email-label { color: rgba(0,0,0,0.4); }

.lazio-frame--dark .lazio-frame__email-value  { color: rgba(255,255,255,0.85); }
.lazio-frame--light .lazio-frame__email-value { color: rgba(0,0,0,0.85); }
.lazio-frame--white .lazio-frame__email-value { color: rgba(0,0,0,0.85); }

.lazio-frame--dark .lazio-frame__email-row + .lazio-frame__email-row {
  border-top-color: rgba(255,255,255,0.08);
}

/* ---------- Toolbar ---------- */
.lazio-frame__toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  flex-shrink: 0;
  text-align: left;
}

.lazio-frame--dark .lazio-frame__toolbar  { border-top: 1px solid rgba(255,255,255,0.08); }
.lazio-frame--light .lazio-frame__toolbar { border-top: 1px solid rgba(0,0,0,0.06); }
.lazio-frame--white .lazio-frame__toolbar { border-top: 1px solid rgba(0,0,0,0.06); }

.lazio-frame__toolbar-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: default;
}

/* Standard toolbar button */
.lazio-frame--dark .lazio-frame__toolbar-btn  { color: rgba(255,255,255,0.7); }
.lazio-frame--light .lazio-frame__toolbar-btn { color: rgba(0,0,0,0.55); }
.lazio-frame--white .lazio-frame__toolbar-btn { color: rgba(0,0,0,0.55); }

/* Send button — accent-colored first button */
.lazio-frame__toolbar-btn--send {
  background: #0A84FF;
  color: #fff !important;
  border-radius: 4px;
  padding: 4px 14px;
}

/* ---------- Children (body area) fill remaining space ---------- */
.lazio-frame > *:not(.lazio-frame__titlebar):not(.lazio-frame__email-meta):not(.lazio-frame__toolbar) {
  flex: 1 1 auto;
}

/* Dark mode — light/white variants become dark */
[data-brx-theme="dark"] .lazio-frame--white,
[data-brx-theme="dark"] .lazio-frame--light {
  background-color: #1e1e1e;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 247, 237, 0.1);
}

[data-brx-theme="dark"] .lazio-frame--white .lazio-frame__titlebar,
[data-brx-theme="dark"] .lazio-frame--light .lazio-frame__titlebar {
  background: #2d2d2d;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-brx-theme="dark"] .lazio-frame--white .lazio-frame__title,
[data-brx-theme="dark"] .lazio-frame--light .lazio-frame__title {
  color: rgba(255, 255, 255, 0.85);
}

[data-brx-theme="dark"] .lazio-frame--white .lazio-frame__email-meta,
[data-brx-theme="dark"] .lazio-frame--light .lazio-frame__email-meta {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-brx-theme="dark"] .lazio-frame--white .lazio-frame__email-label,
[data-brx-theme="dark"] .lazio-frame--light .lazio-frame__email-label {
  color: rgba(255, 255, 255, 0.5);
}

[data-brx-theme="dark"] .lazio-frame--white .lazio-frame__email-value,
[data-brx-theme="dark"] .lazio-frame--light .lazio-frame__email-value {
  color: rgba(255, 255, 255, 0.85);
}

[data-brx-theme="dark"] .lazio-frame--white .lazio-frame__email-row + .lazio-frame__email-row,
[data-brx-theme="dark"] .lazio-frame--light .lazio-frame__email-row + .lazio-frame__email-row {
  border-top-color: rgba(255, 255, 255, 0.08);
}

[data-brx-theme="dark"] .lazio-frame--white .lazio-frame__toolbar,
[data-brx-theme="dark"] .lazio-frame--light .lazio-frame__toolbar {
  border-top-color: rgba(255, 255, 255, 0.08);
}

[data-brx-theme="dark"] .lazio-frame--white .lazio-frame__toolbar-btn,
[data-brx-theme="dark"] .lazio-frame--light .lazio-frame__toolbar-btn {
  color: rgba(255, 255, 255, 0.7);
}

/* Dark variant contrast — subtle ring against dark backgrounds */
[data-brx-theme="dark"] .lazio-frame--dark {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 247, 237, 0.08);
}

/* ---------- Email body (greeting + content + signature) ---------- */
.lazio-frame__email-body {
  padding: 20px 24px;
  font-family: system-ui, -apple-system, Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 400;
  text-align: left;
}

.lazio-frame__email-body p {
  margin-top: 0;
}

.lazio-frame__email-body p:last-child {
  margin-bottom: 0;
}

.lazio-frame__email-greeting {
  margin-bottom: 0.75em;
}

.lazio-frame__email-content p {
  margin-top: 0;
}

.lazio-frame__email-sig {
  margin-top: 1.5em;
  white-space: pre-line;
}

/* Email body variant colors */
.lazio-frame--dark .lazio-frame__email-body  { color: rgba(255,255,255,0.85); }
.lazio-frame--light .lazio-frame__email-body { color: #1C1917; }
.lazio-frame--white .lazio-frame__email-body { color: #1C1917; }

/* Dark mode overrides */
[data-brx-theme="dark"] .lazio-frame--white .lazio-frame__email-body,
[data-brx-theme="dark"] .lazio-frame--light .lazio-frame__email-body {
  color: rgba(255,255,255,0.85);
}

/* ---------- Scrollable body ------------------------------------------ */
.lazio-frame__scroll-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Thin styled scrollbar — visible but unobtrusive */
.lazio-frame__scroll-body::-webkit-scrollbar { width: 6px; }
.lazio-frame__scroll-body::-webkit-scrollbar-track { background: transparent; }
.lazio-frame__scroll-body::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}
.lazio-frame__scroll-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.25);
}
/* Firefox */
.lazio-frame__scroll-body { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.15) transparent; }

/* Dark variant scrollbar */
.lazio-frame--dark .lazio-frame__scroll-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
}
.lazio-frame--dark .lazio-frame__scroll-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.35);
}
.lazio-frame--dark .lazio-frame__scroll-body { scrollbar-color: rgba(255,255,255,0.2) transparent; }

/* Scroll hint — bottom bar with subtle text */
.lazio-frame__scroll-hint {
  padding: 8px 16px;
  text-align: center;
  font-family: Poppins, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.5;
  transition: opacity 0.3s ease;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.lazio-frame__scroll-hint[aria-hidden="true"] { opacity: 0; }
.lazio-frame--dark .lazio-frame__scroll-hint { border-top-color: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }

/* Builder: no scroll, show all content */
.bricks-is-builder .lazio-frame__scroll-body { max-height: none !important; overflow: visible !important; }
.bricks-is-builder .lazio-frame__scroll-hint { display: none; }
