/* ============================================================
   vsos-sunny-modal.css — Ask Sunny Floating Modal
   SA-33 (2026-08-20)

   Standalone fullscreen overlay modal for Ask-Sunny staff chat.
   Uses vsos design tokens (--vs-* from vsos-design-system.css,
   and the warm inline fallbacks matching vsos-one-cockpit.css).
   Works on ALL pages that load the tabbar — no page rebuild needed.
   ============================================================ */

/* ── Overlay backdrop ──────────────────────────────────────── */
#vsos-sunny-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9900;
  background: rgba(46, 36, 25, 0.52);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  align-items: flex-end;
  justify-content: center;
  /* animation driven by .open class */
}
#vsos-sunny-modal-overlay.open {
  display: flex;
  animation: vsm-fade-in 0.18s ease;
}
@keyframes vsm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Modal sheet ───────────────────────────────────────────── */
#vsos-sunny-modal {
  width: 100%;
  max-width: 540px;
  max-height: 88dvh;
  max-height: 88vh; /* fallback */
  display: flex;
  flex-direction: column;
  border-radius: 22px 22px 0 0;
  overflow: hidden;
  /* 28.08.2026 (Eric): 1:1 Website-Widget-Optik (sunny-widget.js) — Paper-Card */
  background: #f4efe4;
  border: 1px solid #ddcfb4;
  border-bottom: none;
  box-shadow: 0 -10px 42px rgba(0, 0, 0, 0.24);
  animation: vsm-sheet-up 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  color: #2a2a2a;
}
@keyframes vsm-sheet-up {
  from { transform: translateY(60px); opacity: 0.4; }
  to   { transform: translateY(0);    opacity: 1;   }
}

/* ── Header bar ────────────────────────────────────────────── */
#vsos-sunny-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px 9px;
  border-bottom: 1px solid rgba(31, 74, 58, 0.10);
  flex-shrink: 0;
}
/* 28.08.2026 (Eric): Avatar-Kreis wie Website-Widget */
.vsm-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #d78a2f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
#vsos-sunny-modal-header .vsm-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  color: #1f4a3a;
  letter-spacing: 0;
  margin: 0;
}
#vsos-sunny-modal-header .vsm-subtitle {
  font-size: 10.5px;
  color: #7a7260;
  margin: 0;
  line-height: 1.3;
}
#vsos-sunny-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #8C7A5F;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
#vsos-sunny-modal-close:hover {
  background: rgba(232, 163, 61, 0.12);
  color: #E08A3C;
}

/* ── Message list ──────────────────────────────────────────── */
#vsos-sunny-modal-msgs {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  -webkit-overflow-scrolling: touch;
}
#vsos-sunny-modal-msgs::-webkit-scrollbar {
  width: 4px;
}
#vsos-sunny-modal-msgs::-webkit-scrollbar-thumb {
  background: rgba(140, 110, 70, 0.24);
  border-radius: 4px;
}

/* ── Bubbles ───────────────────────────────────────────────── */
.vsm-bubble {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.vsm-bubble.vsm-staff {
  /* 28.08.2026 (Eric): Website-Widget-Farben */
  align-self: flex-end;
  background: #1f4a3a;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}
.vsm-bubble.vsm-sunny {
  align-self: flex-start;
  background: #FFFFFF;
  color: #2a2a2a;
  border: 1px solid rgba(31, 74, 58, 0.12);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.vsm-bubble.vsm-typing {
  color: #9C8A73;
  font-style: italic;
}
.vsm-empty {
  /* 28.08.2026 (Eric): Begrüßung als Bot-Bubble wie Website */
  align-self: flex-start;
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  background: #FFFFFF;
  color: #2a2a2a;
  border: 1px solid rgba(31, 74, 58, 0.12);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  font-size: 13px;
  line-height: 1.45;
}

/* ── Confirm/Cancel action buttons ────────────────────────── */
.vsm-action-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  align-self: flex-start;
  width: 100%;
  max-width: 360px;
}
.vsm-action-row button {
  /* 28.08.2026 (Eric): Buttons breiter, kein Buchstaben-Clipping */
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.vsm-action-row button:hover { opacity: 0.85; }
.vsm-action-row .vsm-btn-confirm { background: #4CAF50; color: #FFF; }
.vsm-action-row .vsm-btn-cancel  { background: #E05050; color: #FFF; }

/* ── Input bar ─────────────────────────────────────────────── */
#vsos-sunny-modal-inputbar {
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(232, 220, 197, 0.7);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
#vsos-sunny-modal-input {
  /* 28.08.2026 (Eric): !important noetig — vsos-one-cockpit.css setzt global
     input/textarea-Styles mit !important (Border 12px + Sun-Focus) und wuerde
     die Website-1:1-Optik sonst ueberschreiben. Scoped per ID, keine Nebenwirkung. */
  flex: 1;
  border: 1px solid rgba(31, 74, 58, 0.25) !important;
  border-radius: 11px !important;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  background: #FFFFFF !important;
  color: #2a2a2a !important;
  outline: none;
  transition: border-color 0.15s;
  resize: none;
  min-height: 42px;
  max-height: 100px;
  overflow-y: auto;
  line-height: 1.4;
}
#vsos-sunny-modal-input:focus {
  border-color: #1f4a3a !important;
  box-shadow: none !important;
}
#vsos-sunny-modal-input::placeholder {
  color: #7a7260;
}
#vsos-sunny-modal-send {
  border: none;
  border-radius: 11px;
  background: #d78a2f;
  color: #FFF;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  width: 42px;
  min-width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
#vsos-sunny-modal-send:hover {
  background: #c47a25;
}
#vsos-sunny-modal-send:active {
  transform: scale(0.92);
}
#vsos-sunny-modal-send:disabled {
  opacity: 0.55;
  cursor: default;
}

/* ── Footer actions (clear) ────────────────────────────────── */
#vsos-sunny-modal-footer {
  padding: 4px 14px 10px;
  text-align: right;
  flex-shrink: 0;
}
#vsos-sunny-modal-footer button {
  background: none;
  border: none;
  color: #9C8A73;
  font-size: 11px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.12s;
}
#vsos-sunny-modal-footer button:hover {
  color: #E08A3C;
}

/* ── Safe-area padding for devices with bottom bars ───────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #vsos-sunny-modal {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* -- Mascot (Eric 27.08.: Sunny figure floating above the staff modal) -- */
#vsos-sunny-modal { position: relative; overflow: visible; }
#vsos-sunny-modal-mascot {
  position: absolute;
  top: -118px;
  right: 6px;
  width: 74px;
  height: 132px;
  pointer-events: none;
  z-index: 1;
}
#vsos-sunny-modal-mascot video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(46,36,25,.28));
}
@media (max-height: 620px) { #vsos-sunny-modal-mascot { display: none; } }

/* T4: Link Cards (Deep-Link-Karten, 03.09.2026) */
.vsm-link-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  align-self: flex-start;
  width: 90%;
}
.vsm-link-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid rgba(31,74,58,.18);
  border-radius: 12px;
  text-decoration: none;
  color: #1f4a3a;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: background .15s, border-color .15s;
}
.vsm-link-card:hover {
  background: #f4efe4;
  border-color: rgba(31,74,58,.35);
}
.vsm-link-emoji { font-size: 16px; flex-shrink: 0; }
.vsm-link-label { flex: 1; }
.vsm-link-arrow { color: #a89070; font-size: 14px; flex-shrink: 0; }
