/*
 * Imotimo — Guest conversation UI v39 (CSS-only, 2026-10-11)
 * Full replacement for /public_html/assets/css/imotimo_guest_v22.css
 * Compatible with the existing v37/v38 guest contact, thread and owner pages.
 * No PHP, database, PayPal or messaging logic changes.
 */

/* Shared foundation: keep text readable and prevent unexpected iOS text inflation. */
body.imxguest,
body.imxguest-owner {
  --imxg-blue: #1378e6;
  --imxg-ink: #253c59;
  --imxg-muted: #59718c;
  --imxg-line: #d7e4f3;
  --imxg-paper: rgba(255, 255, 255, .86);
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: #c9ddef url('../images/plovdiv-bg.png') center / cover fixed;
  color: var(--imxg-ink);
  font: 400 15px/1.5 system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}
body.imxguest *, body.imxguest-owner * { box-sizing: border-box; }

/* Only style the guest UI, not the shared Imotimo navigation. */
body.imxguest .imxguest-shell,
body.imxguest-owner .imxguest-shell {
  position: relative;
  z-index: 2;
  width: min(670px, calc(100% - 28px));
  margin: 22px auto 34px;
  padding: clamp(16px, 3vw, 25px);
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 20px;
  background: rgba(247, 250, 254, .77);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  box-shadow: 0 14px 36px rgba(19, 42, 73, .16);
  min-width: 0;
  overflow-wrap: anywhere;
}
body.imxguest .imxguest-shell.imxguest-wide,
body.imxguest-owner .imxguest-shell.imxguest-wide {
  width: min(1120px, calc(100% - 28px));
}

.imxguest-shell h1,
.imxguest-shell h2,
.imxguest-shell h3 { overflow-wrap: anywhere; letter-spacing: -.012em; }
.imxguest-shell h1 {
  margin: 12px 0 9px;
  color: var(--imxg-blue);
  font-size: clamp(22px, 3.2vw, 27px);
  line-height: 1.2;
  font-weight: 780;
}
.imxguest-shell h2 {
  color: #155eac;
  font-size: clamp(16px, 2.2vw, 19px);
  line-height: 1.32;
  margin: 13px 0 10px;
  font-weight: 760;
}
.imxguest-shell h3 { color: #155eac; font-size: 16px; line-height: 1.35; }
.imxguest-shell p { margin: 9px 0 12px; line-height: 1.52; }
.imxguest-shell a { color: #0a60b4; text-underline-offset: 2px; }
.imxguest-shell a:focus-visible,
.imxguest-shell button:focus-visible,
.imxguest-shell input:focus-visible,
.imxguest-shell select:focus-visible,
.imxguest-shell textarea:focus-visible {
  outline: 3px solid #80baff;
  outline-offset: 2px;
}

/* Accessible forms: 16px inputs avoid Safari automatic zoom. */
.imxguest-shell label {
  display: block;
  color: #175da5;
  font-size: 14px;
  font-weight: 750;
  margin: 14px 0 6px;
}
.imxguest-shell input,
.imxguest-shell select,
.imxguest-shell textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #bfd4ee;
  border-radius: 11px;
  padding: 11px 12px;
  background: rgba(255,255,255,.97);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.45;
  color: var(--imxg-ink);
  box-shadow: inset 0 1px 1px rgba(15,47,82,.03);
}
.imxguest-shell textarea {
  min-height: 96px;
  max-width: 100%;
  resize: vertical;
}
.imxguest-shell select { padding-right: 26px; }

.imxguest-shell button,
.imxguest-button,
.imxguest-shell a.imxguest-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  max-width: 100%;
  min-height: 44px;
  padding: 11px 16px;
  background: #1378e6;
  border: 0;
  border-radius: 11px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font: 750 14px/1.35 system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  white-space: normal;
  text-align: center;
  margin: 10px 8px 6px 0;
  overflow-wrap: anywhere;
}
.imxguest-shell button:hover,
.imxguest-shell a.imxguest-button:hover { background: #0d68cc; }
.imxguest-shell button.imxguest-secondary { background: #5f768e; }
.imxguest-note { font-size: 13px; line-height: 1.5; color: var(--imxg-muted); }
.imxguest-error, .imxguest-ok {
  padding: 12px 14px;
  border-radius: 11px;
  font-size: 14px;
  line-height: 1.45;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.imxguest-error { background: #ffe7ea; color: #982538; }
.imxguest-ok { background: #e6f8ed; color: #096b40; }
.imxguest-hp { position: absolute; left: -10000px; top: -10000px; opacity: 0; }

/* Chat bubbles: time / sender are visually secondary, message remains easy to read. */
.imxguest-bubble {
  padding: 11px 13px;
  margin: 9px 0;
  max-width: 88%;
  background: #fff;
  border: 1px solid rgba(190,211,236,.6);
  border-radius: 13px 13px 13px 5px;
  box-shadow: 0 2px 6px rgba(36,65,101,.035);
  overflow-wrap: anywhere;
  word-break: normal;
  font-size: 14px;
  line-height: 1.47;
}
.imxguest-bubble.mine {
  background: #dfedff;
  border-color: #c8ddfa;
  border-radius: 13px 13px 5px 13px;
  margin-left: auto;
}
.imxguest-bubble small {
  display: block;
  color: var(--imxg-muted);
  font-size: 11.5px;
  line-height: 1.4;
}
.imxguest-bubble p { margin: 5px 0 0; line-height: 1.48; }

/* Seller's guest inbox — compact list and a fluid conversation area. */
.imxguest-grid {
  display: grid;
  grid-template-columns: minmax(200px, 285px) minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}
.imxguest-grid > aside,
.imxguest-grid > section {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 15px;
  background: var(--imxg-paper);
  padding: 16px;
  overflow-wrap: anywhere;
}
.imxguest-item {
  display: block;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  margin: 8px 0;
  padding: 10px 11px;
  border: 1px solid #cadef6;
  border-radius: 11px;
  background: #edf5ff;
  color: #194d80;
  transition: background .15s ease;
}
.imxguest-item:hover { background: #dfeeff; }
.imxguest-item strong { font-size: 14px; }
.imxguest-item small { font-size: 11px; color: #56708a; }
.imxguest-inline { display: block; }

/* Touch phones. Use a single column and smaller card headings, without clipping. */
@media (max-width: 760px) {
  body.imxguest, body.imxguest-owner {
    background-attachment: scroll; /* iOS Safari handles scroll better than fixed. */
    background-position: center top;
  }
  body.imxguest .imxguest-shell,
  body.imxguest-owner .imxguest-shell,
  body.imxguest .imxguest-shell.imxguest-wide,
  body.imxguest-owner .imxguest-shell.imxguest-wide {
    width: calc(100% - 20px);
    padding: 15px;
    margin: 12px auto 24px;
    border-radius: 16px;
  }
  .imxguest-shell h1 {
    font-size: 21px;
    line-height: 1.22;
    margin: 10px 0 8px;
  }
  .imxguest-shell h2 {
    font-size: 16px;
    line-height: 1.32;
    margin: 9px 0 9px;
  }
  .imxguest-shell p { margin: 8px 0 10px; }
  .imxguest-grid { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .imxguest-grid > aside, .imxguest-grid > section {
    padding: 12px;
    border-radius: 12px;
  }
  .imxguest-grid > aside > h2 { margin-top: 0; }
  .imxguest-item { margin: 7px 0; padding: 9px 10px; }
  .imxguest-bubble {
    font-size: 14px;
    max-width: 94%;
    padding: 10px 11px;
    margin: 8px 0;
  }
  .imxguest-bubble small { font-size: 11px; }
  .imxguest-shell input,
  .imxguest-shell select,
  .imxguest-shell textarea { font-size: 16px; }
  .imxguest-shell textarea { min-height: 92px; }
  .imxguest-shell button,
  .imxguest-shell a.imxguest-button { min-height: 44px; }
}
@media (max-width: 420px) {
  body.imxguest .imxguest-shell,
  body.imxguest-owner .imxguest-shell,
  body.imxguest .imxguest-shell.imxguest-wide,
  body.imxguest-owner .imxguest-shell.imxguest-wide {
    width: calc(100% - 14px);
    padding: 12px;
    margin: 7px auto 20px;
    border-radius: 14px;
  }
  .imxguest-shell h1 { font-size: 20px; }
  .imxguest-shell h2 { font-size: 15.5px; }
  .imxguest-grid > aside,
  .imxguest-grid > section { padding: 11px; }
  .imxguest-bubble { max-width: 96%; }
  .imxguest-shell button,
  .imxguest-shell a.imxguest-button {
    width: 100%;
    margin: 9px 0 5px;
  }
  /* The report action is one of the longest labels; never overflow. */
  .imxguest-shell button.imxsec-danger { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .imxguest-item { transition: none; }
}
