/* SVENGO-ЗБВ — ai-helper.html page-specific styles. R6 (extracted). */

html, body { height: 100%; overflow: hidden; }
body { background: var(--stone-100); }

/* Site header */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 60px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stone-200);
}
.site-header-inner {
  display: flex; align-items: center; height: 100%;
  max-width: 1280px; margin: 0 auto; padding: 0 24px; gap: 12px;
}
.site-header-logo { height: 34px; width: auto; flex-shrink: 0; }
.site-header-brand {
  font-weight: 800; font-size: 16px; letter-spacing: 2px;
  color: var(--stone-950); white-space: nowrap;
}
.site-header-brand span { color: var(--stone-400); font-weight: 400; margin: 0 6px; }
.site-header-nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.site-header-nav a {
  font-size: 13px; font-weight: 500; color: var(--stone-700);
  letter-spacing: 0.3px; text-decoration: none; transition: color 0.2s;
}
.site-header-nav a:hover { color: var(--green-700); }
.site-header-nav .active { color: var(--green-700); font-weight: 700; }

/* Site footer */
.site-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--stone-950); padding: 8px 16px;
  text-align: center; font-size: 12px; color: var(--stone-600);
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  justify-content: center; align-items: center; line-height: 1.4;
}
.site-footer a { color: var(--stone-500); text-decoration: none; }
.site-footer a:hover { color: var(--green-400); }
.site-footer .sep { color: var(--stone-700); }
.site-footer-credit { color: var(--stone-600); white-space: nowrap; }

/* Background */
.bg {
  position: fixed; inset: 0; z-index: 0;
  background-image: url('/public/images/ai-landscape.png');
  background-image: image-set(
    url('/public/images/ai-landscape.avif') type('image/avif'),
    url('/public/images/ai-landscape.webp') type('image/webp'),
    url('/public/images/ai-landscape.png')  type('image/png')
  );
  background-size: cover; background-position: center;
}
.bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(30,58,50,0.88), rgba(26,25,24,0.82));
}
@media (orientation: portrait) {
  .bg {
    background-image: url('/public/images/ai-portrait.png');
    background-image: image-set(
      url('/public/images/ai-portrait.avif') type('image/avif'),
      url('/public/images/ai-portrait.webp') type('image/webp'),
      url('/public/images/ai-portrait.png')  type('image/png')
    );
  }
}

/* Layout */
.app {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  height: calc(100vh - 60px - 38px); height: calc(100dvh - 60px - 38px);
  margin-top: 60px;
  max-width: 800px; margin-left: auto; margin-right: auto;
}

/* Header */
.chat-header {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.chat-back {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: none;
  color: var(--white); font-size: 18px; cursor: pointer;
  transition: background 0.2s; text-decoration: none;
}
.chat-back:hover { background: rgba(255,255,255,0.15); color: var(--white); }
.chat-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-600), var(--green-400));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.chat-header-info { flex: 1; }
.chat-header-name {
  font-weight: 700; font-size: 15px; color: var(--white); letter-spacing: 0.3px;
}
.chat-header-status {
  font-size: 12px; color: var(--green-300); display: flex; align-items: center; gap: 5px;
}
.chat-header-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green-400);
  animation: dotPulse 2s infinite;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.4; }
}
.chat-header-phone {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: none;
  color: var(--white); font-size: 16px; cursor: pointer;
  text-decoration: none; transition: background 0.2s;
}
.chat-header-phone:hover { background: rgba(255,255,255,0.15); color: var(--white); }

/* Messages area */
.chat-messages {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 20px 20px 8px;
  display: flex; flex-direction: column; gap: 16px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* Message bubbles */
.msg { display: flex; gap: 10px; max-width: 85%; animation: msgIn 0.3s ease; }
.msg-bot { align-self: flex-start; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }

@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--green-600), var(--green-400));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; margin-top: 2px;
}
.msg-user .msg-avatar { display: none; }

.msg-bubble {
  padding: 14px 18px; border-radius: 16px; line-height: 1.6; font-size: 14.5px;
}
.msg-bot .msg-bubble {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  border-bottom-left-radius: 4px;
}
.msg-user .msg-bubble {
  background: var(--green-700);
  color: var(--white);
  border-bottom-right-radius: 4px;
}
.msg-bubble p { margin-bottom: 8px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble strong { font-weight: 700; color: var(--white); }
.msg-bubble ul, .msg-bubble ol { padding-left: 18px; margin: 8px 0; }
.msg-bubble li { margin-bottom: 4px; }
.msg-bubble code {
  background: rgba(255,255,255,0.1); padding: 2px 6px;
  border-radius: 4px; font-size: 13px;
}

/* Typing indicator */
.typing { display: flex; gap: 10px; align-self: flex-start; max-width: 85%; }
.typing-dots {
  padding: 14px 22px; border-radius: 16px; border-bottom-left-radius: 4px;
  background: rgba(255,255,255,0.1); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; gap: 5px; align-items: center;
}
.typing-dot {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.5);
  animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Quick actions */
.quick-actions {
  display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 20px 4px;
  flex-shrink: 0;
}
.quick-btn {
  padding: 8px 16px; border-radius: 20px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.75);
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.quick-btn:hover {
  background: rgba(255,255,255,0.15);
  color: var(--white);
  border-color: rgba(255,255,255,0.2);
}

/* Input area */
.chat-input-area {
  flex-shrink: 0;
  padding: 12px 20px max(12px, env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.chat-input-wrap {
  display: flex; align-items: flex-end; gap: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px; padding: 6px 6px 6px 18px;
  transition: border-color 0.2s;
}
.chat-input-wrap:focus-within { border-color: var(--green-400); }
.chat-input {
  flex: 1; border: none; background: transparent;
  color: var(--white); font-family: var(--font-body);
  font-size: 15px; line-height: 1.5; padding: 8px 0;
  resize: none; outline: none;
  max-height: 120px; min-height: 24px;
}
.chat-input::placeholder { color: rgba(255,255,255,0.35); }
.chat-send {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: var(--green-600); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s, transform 0.15s;
  flex-shrink: 0; font-size: 18px;
}
.chat-send:hover { background: var(--green-700); transform: scale(1.05); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.chat-send svg { width: 20px; height: 20px; fill: var(--white); }

/* Disclaimer */
.chat-disclaimer {
  text-align: center; font-size: 11px; color: rgba(255,255,255,0.3);
  padding: 6px 20px 0; flex-shrink: 0;
}

/* Desktop wide */
@media (min-width: 800px) {
  .app {
    height: calc(100vh - 60px - 38px); height: calc(100dvh - 60px - 38px);
    border-left: 1px solid rgba(255,255,255,0.06);
    border-right: 1px solid rgba(255,255,255,0.06);
  }
}

/* Hide nav on mobile */
@media (max-width: 768px) {
  .site-header-nav { display: none; }
  .site-footer { bottom: 0; font-size: 11px; padding: 8px 16px; }
  .app { height: calc(100vh - 60px - 34px); height: calc(100dvh - 60px - 34px); }
}

/* Small mobile */
@media (max-width: 480px) {
  .msg { max-width: 92%; }
  .quick-btn { font-size: 12px; padding: 7px 12px; }
}
