/* F2F AI Proje Ajanı — matches product mockups */

.f2f-ai-chatbot-root {
  --f2f-green: #22c55e;
  --f2f-green-soft: #e8f8ee;
  --f2f-green-border: #b8e9c8;
  --f2f-ink: #111827;
  --f2f-muted: #6b7280;
  --f2f-line: #e5e7eb;
  --f2f-bg: #ffffff;
  --f2f-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  --f2f-radius: 22px;
  --f2f-font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f2f-bottom: 4%;
  --f2f-side: 2%;
  --f2f-fab: 64px;
  position: fixed;
  z-index: 99999;
  bottom: var(--f2f-bottom);
  right: var(--f2f-side);
  font-family: var(--f2f-font);
  color: var(--f2f-ink);
  line-height: 1.45;
  box-sizing: border-box;
  /* Keep a real hit-box so absolute/fixed children don't collapse */
  width: var(--f2f-fab);
  height: var(--f2f-fab);
  pointer-events: none;
}

.f2f-ai-chatbot-root *,
.f2f-ai-chatbot-root *::before,
.f2f-ai-chatbot-root *::after {
  box-sizing: border-box;
}

.f2f-ai-chatbot-root > * {
  pointer-events: auto;
}

.f2f-ai-chatbot-root[data-position="left"] {
  right: auto;
  left: var(--f2f-side);
}

/* Teaser bubble — fixed to viewport (not trapped in 64px FAB box) */
.f2f-ai-teaser {
  position: fixed;
  right: var(--f2f-side);
  bottom: calc(var(--f2f-bottom) + var(--f2f-fab) + 14px);
  width: min(300px, calc(100vw - 32px));
  max-width: min(300px, calc(100vw - 32px));
  min-width: min(260px, calc(100vw - 32px));
  padding: 14px 16px 15px;
  border-radius: 16px;
  background: #111111;
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  text-align: left;
  border: 0;
  font: inherit;
  animation: f2f-teaser-in 0.35s ease both;
  z-index: 99998;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.f2f-ai-chatbot-root[data-position="left"] .f2f-ai-teaser {
  right: auto;
  left: var(--f2f-side);
}

.f2f-ai-teaser-title {
  display: block;
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--f2f-green);
  line-height: 1.35;
  white-space: normal;
}

.f2f-ai-teaser-msg {
  display: block;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  white-space: normal;
}

/* Launcher FAB — stays visible when open (becomes close) */
.f2f-ai-launcher {
  position: absolute;
  right: 0;
  bottom: 0;
  width: var(--f2f-fab);
  height: var(--f2f-fab);
  border: 2.5px solid var(--f2f-green);
  border-radius: 50%;
  background: #0a0a0a;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), 0 0 0 3px rgba(34, 197, 94, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  padding: 0;
  z-index: 3;
}

.f2f-ai-chatbot-root[data-position="left"] .f2f-ai-launcher {
  right: auto;
  left: 0;
}

.f2f-ai-launcher:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32), 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.f2f-ai-launcher-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  color: #fff;
}

.f2f-ai-launcher-close {
  display: none;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  color: #fff;
}

.f2f-ai-launcher-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--f2f-green);
  border: 2px solid #0a0a0a;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

.f2f-ai-chatbot-root.is-open .f2f-ai-teaser {
  display: none;
}

.f2f-ai-chatbot-root.is-open .f2f-ai-launcher {
  background: #111;
}

.f2f-ai-chatbot-root.is-open .f2f-ai-launcher-text,
.f2f-ai-chatbot-root.is-open .f2f-ai-launcher-dot {
  display: none;
}

.f2f-ai-chatbot-root.is-open .f2f-ai-launcher-close {
  display: block;
}

/* Panel — fixed to viewport so it never sinks with a collapsed parent */
.f2f-ai-panel {
  position: fixed;
  right: var(--f2f-side);
  bottom: calc(var(--f2f-bottom) + var(--f2f-fab) + 12px);
  width: min(380px, calc(100vw - 24px));
  height: min(640px, calc(100dvh - var(--f2f-bottom) - var(--f2f-fab) - 28px));
  max-height: calc(100dvh - var(--f2f-bottom) - var(--f2f-fab) - 28px);
  background: var(--f2f-bg);
  border-radius: var(--f2f-radius);
  box-shadow: var(--f2f-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 99998;
}

.f2f-ai-chatbot-root[data-position="left"] .f2f-ai-panel {
  right: auto;
  left: var(--f2f-side);
}

.f2f-ai-chatbot-root.is-open .f2f-ai-panel {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

@keyframes f2f-teaser-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Header */
.f2f-ai-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--f2f-line);
  flex-shrink: 0;
  background: #fff;
}

.f2f-ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: #111;
  flex-shrink: 0;
}

.f2f-ai-header-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--f2f-ink);
}

.f2f-ai-minimize {
  width: 36px;
  height: 36px;
  border: 0;
  background: #f3f4f6;
  color: #374151;
  cursor: pointer;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.f2f-ai-minimize:hover {
  background: #e5e7eb;
  color: #111827;
}

/* Screens */
.f2f-ai-screen {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.f2f-ai-screen.is-active {
  display: flex;
}

/* Discover */
.f2f-ai-discover-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 18px 12px;
  text-align: center;
}

.f2f-ai-discover-body h2 {
  margin: 0 0 10px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--f2f-ink);
}

.f2f-ai-discover-body .f2f-sub {
  margin: 0 auto 20px;
  max-width: 32ch;
  font-size: 13.5px;
  color: var(--f2f-muted);
  line-height: 1.5;
}

.f2f-ai-featured {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--f2f-green-border);
  background: var(--f2f-green-soft);
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: filter 0.15s ease;
}

.f2f-ai-featured:hover {
  filter: brightness(0.98);
}

.f2f-ai-featured-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--f2f-green);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.f2f-ai-featured-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.f2f-ai-featured-text {
  flex: 1;
  min-width: 0;
}

.f2f-ai-featured-text strong {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
}

.f2f-ai-featured-text span {
  display: block;
  font-size: 12px;
  color: var(--f2f-muted);
  margin-top: 2px;
}

.f2f-ai-featured-chevron {
  color: #9ca3af;
  font-size: 18px;
}

.f2f-ai-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.f2f-ai-divider::before,
.f2f-ai-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--f2f-line);
}

.f2f-ai-services {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.f2f-ai-service {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 12px;
  border: 1px solid var(--f2f-line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.f2f-ai-service:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.f2f-ai-service-icon {
  width: 28px;
  height: 28px;
  color: var(--f2f-green);
  display: grid;
  place-items: center;
}

.f2f-ai-service-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.f2f-ai-service strong {
  font-size: 13.5px;
  font-weight: 650;
}

/* Lead form */
.f2f-ai-lead-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 18px 18px;
}

.f2f-ai-lead-body h2 {
  margin: 0 0 8px;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.f2f-ai-lead-body .f2f-sub {
  margin: 0 auto 20px;
  text-align: center;
  max-width: 34ch;
  font-size: 13.5px;
  color: var(--f2f-muted);
}

.f2f-ai-lead-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.f2f-ai-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.f2f-ai-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.f2f-ai-field label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.f2f-ai-field input {
  width: 100%;
  border: 1px solid var(--f2f-line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--f2f-ink);
}

.f2f-ai-field input:focus {
  outline: none;
  border-color: var(--f2f-green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.f2f-ai-lead-submit {
  margin-top: 6px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  background: var(--f2f-green);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.f2f-ai-lead-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.f2f-ai-lead-cancel {
  display: block;
  margin: 4px auto 0;
  border: 0;
  background: transparent;
  color: var(--f2f-muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 8px;
}

.f2f-ai-lead-error {
  display: none;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
}

.f2f-ai-lead-error.is-visible {
  display: block;
}

/* Chat */
.f2f-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
}

.f2f-ai-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  animation: f2f-in 0.22s ease both;
}

.f2f-ai-bubble.is-user {
  align-self: flex-end;
  background: var(--f2f-green);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.f2f-ai-bubble.is-bot {
  align-self: flex-start;
  background: #f3f4f6;
  color: var(--f2f-ink);
  border-bottom-left-radius: 6px;
}

.f2f-ai-bubble.is-error {
  align-self: stretch;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
}

.f2f-ai-typing-label {
  align-self: flex-start;
  font-size: 13px;
  font-style: italic;
  color: #9ca3af;
  padding: 2px 4px;
}

/* Composer shared */
.f2f-ai-footer {
  flex-shrink: 0;
  padding: 10px 14px 14px;
  border-top: 1px solid transparent;
  background: #fff;
}

.f2f-ai-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid #c7ebe0;
  border-radius: 999px;
  padding: 6px 6px 6px 14px;
  background: #fff;
}

.f2f-ai-composer input {
  flex: 1;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 14px;
  background: transparent;
  color: var(--f2f-ink);
  min-width: 0;
}

.f2f-ai-composer input::placeholder {
  color: #9ca3af;
}

.f2f-ai-send {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #9ca3af;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.f2f-ai-send:hover:not(:disabled),
.f2f-ai-composer:focus-within .f2f-ai-send:not(:disabled) {
  background: var(--f2f-green);
}

.f2f-ai-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.f2f-ai-send svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.f2f-ai-whatsapp {
  display: none;
  margin-top: 10px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  background: #128c7e;
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.f2f-ai-whatsapp.is-visible {
  display: block;
}

.f2f-ai-whatsapp:hover {
  filter: brightness(1.05);
}

@keyframes f2f-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 480px) {
  .f2f-ai-panel {
    width: calc(100vw - 16px);
    right: 8px !important;
    left: auto !important;
    bottom: calc(var(--f2f-bottom) + var(--f2f-fab) + 10px);
    height: min(70dvh, calc(100dvh - var(--f2f-bottom) - var(--f2f-fab) - 24px));
    max-height: calc(100dvh - var(--f2f-bottom) - var(--f2f-fab) - 24px);
  }

  .f2f-ai-chatbot-root[data-position="left"] .f2f-ai-panel {
    left: 8px !important;
    right: auto !important;
  }

  .f2f-ai-teaser {
    width: min(280px, calc(100vw - 24px));
    max-width: min(280px, calc(100vw - 24px));
    min-width: 0;
    right: 12px;
    left: auto;
  }

  .f2f-ai-chatbot-root[data-position="left"] .f2f-ai-teaser {
    left: 12px;
    right: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .f2f-ai-panel,
  .f2f-ai-bubble,
  .f2f-ai-launcher {
    transition: none !important;
    animation: none !important;
  }
}
