/* experience_editor/device_chrome.css – Pure CSS phone + laptop device frames */

.device-chrome {
  display: flex;
  flex-direction: column;
  background: var(--surface-base);
  border: 2px solid var(--border-default);
  overflow: hidden;
  transition: width var(--duration-normal) var(--ease-out),
              max-height var(--duration-normal) var(--ease-out);
}

/* ── Phone frame (life-sized iPhone: 393×852 CSS viewport) ──
   Uses actual iPhone 16 Pro / ~17 Pro viewport dimensions.
   The frame fills available height; constrained by max-height
   so it fits the preview panel. */
.device-chrome--phone {
  width: 393px;
  max-width: 100%;
  height: 852px;
  max-height: calc(100vh - var(--ee-header-height) - var(--ee-header-height) - var(--space-6));
  border-radius: 40px;
  border-width: 4px;
  align-self: center;
  flex-shrink: 1;
}

.device-chrome--phone .device-chrome__status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  background: var(--surface-base);
  flex-shrink: 0;
}

.device-chrome--phone .device-chrome__notch {
  width: 126px;
  height: 34px;
  background: #000;
  border-radius: 20px;
}

.device-chrome--phone .device-chrome__screen {
  flex: 1;
  width: 100%;
  border: none;
  background: var(--surface-base);
  min-height: 0;
}

/* ── Phone: DM-aware app bars ──
   Three variants (Safari, Mail, Messages) rendered in markup.
   Only the one matching data-dm is shown. All hidden in laptop mode. */

.device-chrome__app-bar {
  flex-shrink: 0;
  background: var(--surface-base);
  border-top: 1px solid var(--border-subtle);
  display: none;                       /* hidden by default */
  flex-direction: column;
  align-items: center;
  padding: 6px 16px 0;
}

/* Show the right bar based on data-dm */
.device-chrome--phone[data-dm="WEB"] .device-chrome__app-bar--safari,
.device-chrome--phone[data-dm="FEED"] .device-chrome__app-bar--safari {
  display: flex;
}
.device-chrome--phone[data-dm="EMAIL"] .device-chrome__app-bar--mail {
  display: flex;
}
.device-chrome--phone[data-dm="SMS"] .device-chrome__app-bar--messages {
  display: flex;
}

/* Hide all app bars in laptop mode */
.device-chrome--laptop .device-chrome__app-bar { display: none; }

/* ── Shared bar elements ── */
.device-chrome__app-bar-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  height: 36px;
  padding: 0 8px;
}
.device-chrome__app-bar-btn {
  font-size: 16px;
  color: var(--accent-primary);
  opacity: 0.7;
  cursor: default;
  user-select: none;
  line-height: 1;
}
.device-chrome__home-indicator {
  width: 134px;
  height: 5px;
  background: var(--text-primary);
  border-radius: 3px;
  opacity: 0.18;
  margin: 6px 0 8px;
}

/* ── Safari (WEB / FEED) ── */
.device-chrome__safari-url {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 36px;
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 13px;
}
.device-chrome__safari-lock {
  font-size: 10px;
  opacity: 0.5;
  line-height: 1;
}
.device-chrome__safari-domain {
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ── Mail (EMAIL) ── */
.device-chrome__app-bar--mail .device-chrome__app-bar-btn {
  font-size: 20px;
}

/* ── Messages (SMS) ── */
.device-chrome__messages-input {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 4px;
}
.device-chrome__messages-field {
  flex: 1;
  height: 30px;
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  background: var(--surface-base);
}
.device-chrome__app-bar--messages .device-chrome__app-bar-btn {
  font-size: 22px;
  opacity: 0.6;
}

/* ── Laptop frame (fills panel width, 16:10 desktop aspect ratio) ── */
.device-chrome--laptop {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  border-width: 2px;
  border-bottom-width: 14px;
  flex-shrink: 1;
  min-height: 0;
}

.device-chrome--laptop .device-chrome__status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  background: var(--accent-primary);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.device-chrome--laptop .device-chrome__notch {
  width: 6px;
  height: 6px;
  background: var(--text-on-accent);
  border-radius: 50%;
  opacity: 0.5;
}

.device-chrome--laptop .device-chrome__screen {
  flex: 1;
  width: 100%;
  border: none;
  background: var(--surface-base);
  min-height: 0;
}
