/* ==========================================================================
   Preview Pane & WeChat Device Simulator Styles
   ========================================================================== */

/* Outer Preview Container */
.preview-container {
  flex: 1;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px;
  background: #f1f3f5;
  overflow-y: auto;
  overflow-x: hidden;
  transition: background 0.3s ease;
}

/* Dark Mode Background for Container */
.preview-container.dark-mode {
  background: #0c0d10;
}

/* Phone Mockup Wrapper (Default Fluid / PC View) */
.phone-mockup-wrapper {
  width: 100%;
  max-width: 677px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

/* Notch & Home Indicator Hidden in Fluid Mode */
.phone-notch {
  display: none;
}

.phone-home-indicator {
  display: none;
}

/* Phone Screen Container (Default Fluid Mode) */
.phone-screen-container {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* WeChat Article Canvas (Paper) */
.wechat-article-shell {
  background: #ffffff;
  width: 100%;
  max-width: 677px;
  min-height: 100%;
  padding: 36px 32px 48px 32px;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  /* WeChat Official Native Font Stack */
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  color: #333333;
  line-height: 1.75;
  font-size: 15px;
  letter-spacing: 0.5px;
  word-break: break-word;
}

/* Dark Mode Article Canvas */
.preview-container.dark-mode .wechat-article-shell {
  background: #191919;
  color: #d6d6d6;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  border: 1px solid #282828;
}

/* ==========================================================================
   MOBILE DEVICE VIEWPORT MODES (375px & 414px)
   Realistic physical smartphone bezel with independent internal scrolling
   ========================================================================== */

.preview-container.viewport-375,
.preview-container.viewport-414 {
  overflow: hidden;
  align-items: center;
  padding: 16px;
}

/* Phone Mockup Wrapper in Mobile Mode */
.preview-container.viewport-375 .phone-mockup-wrapper,
.preview-container.viewport-414 .phone-mockup-wrapper {
  height: calc(100% - 10px);
  max-height: 840px;
  min-height: 500px;
  border: 10px solid #1e293b;
  border-radius: 46px;
  background: #ffffff;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

/* Specific Widths */
.preview-container.viewport-375 .phone-mockup-wrapper {
  width: 375px;
}

.preview-container.viewport-414 .phone-mockup-wrapper {
  width: 414px;
}

/* Top Notch / Dynamic Island */
.preview-container.viewport-375 .phone-notch,
.preview-container.viewport-414 .phone-notch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 24px;
  background: #1e293b;
  width: 120px;
  margin: 0 auto;
  border-radius: 0 0 14px 14px;
  flex-shrink: 0;
  z-index: 20;
}

.notch-speaker {
  width: 38px;
  height: 3px;
  background: #334155;
  border-radius: 2px;
}

.notch-camera {
  width: 7px;
  height: 7px;
  background: #0f172a;
  border: 1.5px solid #334155;
  border-radius: 50%;
}

/* Phone Internal Screen Container - SCROLLABLE INSIDE PHONE */
.preview-container.viewport-375 .phone-screen-container,
.preview-container.viewport-414 .phone-screen-container {
  flex: 1;
  height: calc(100% - 36px);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  position: relative;
  background: inherit;
}

/* Slim scrollbar for phone screen */
.phone-screen-container::-webkit-scrollbar {
  width: 4px;
}
.phone-screen-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}
.preview-container.dark-mode .phone-screen-container::-webkit-scrollbar-thumb {
  background: #334155;
}

/* Bottom Home Indicator Bar */
.preview-container.viewport-375 .phone-home-indicator,
.preview-container.viewport-414 .phone-home-indicator {
  display: block;
  width: 120px;
  height: 4px;
  background: #94a3b8;
  border-radius: 2px;
  margin: 5px auto 4px auto;
  flex-shrink: 0;
  z-index: 20;
}

/* Article Shell inside Phone Mockup */
.preview-container.viewport-375 .wechat-article-shell,
.preview-container.viewport-414 .wechat-article-shell {
  max-width: 100%;
  box-shadow: none;
  border: none;
  border-radius: 0;
  padding: 18px 18px 36px 18px;
}

/* Dark Mode Phone Shell Colors */
.preview-container.dark-mode.viewport-375 .phone-mockup-wrapper,
.preview-container.dark-mode.viewport-414 .phone-mockup-wrapper {
  border-color: #334155;
  background: #191919;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
}

.preview-container.dark-mode.viewport-375 .phone-notch,
.preview-container.dark-mode.viewport-414 .phone-notch {
  background: #334155;
}

.preview-container.dark-mode.viewport-375 .phone-home-indicator,
.preview-container.dark-mode.viewport-414 .phone-home-indicator {
  background: #64748b;
}
