/* CasinoFull AI agent — gold / burgundy, isolated from table layout */

.cf-ai {
  --cf-ai-gold: #f2cf5c;
  --cf-ai-gold-2: #af7c41;
  --cf-ai-bg: #140808;
  --cf-ai-panel: #1e0c0c;
  --cf-ai-text: #f6e7c3;
  --cf-ai-muted: #c4a57a;
  --cf-ai-line: rgba(242, 207, 92, 0.28);
  font-family: Arial, Helvetica, sans-serif;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483000;
  color: var(--cf-ai-text);
  line-height: 1.4;
}

.cf-ai *,
.cf-ai *::before,
.cf-ai *::after {
  box-sizing: border-box;
}

.cf-ai-fab {
  width: 60px;
  height: 60px;
  border: 1px solid var(--cf-ai-gold-2);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, #6b2a1a, #2a0c0c 62%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(242, 207, 92, 0.2);
  color: var(--cf-ai-gold);
  padding: 0;
}

.cf-ai-fab:hover,
.cf-ai-fab:focus {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 18px rgba(242, 207, 92, 0.25);
}

.cf-ai-fab svg {
  width: 28px;
  height: 28px;
  display: block;
}

.cf-ai-dot {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #140808;
}

.cf-ai-fab-wrap {
  position: relative;
  display: inline-block;
}

.cf-ai.is-open .cf-ai-fab-wrap {
  display: none;
}

.cf-ai-panel {
  display: none;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 28px));
  flex-direction: column;
  background: linear-gradient(180deg, #2a1210 0%, var(--cf-ai-panel) 40%);
  border: 1px solid var(--cf-ai-gold-2);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.cf-ai.is-open .cf-ai-panel {
  display: flex;
}

.cf-ai-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-bottom: 1px solid var(--cf-ai-line);
  background: linear-gradient(180deg, rgba(175, 124, 65, 0.28), transparent);
}

.cf-ai-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3a1810;
  border: 1px solid var(--cf-ai-gold);
  color: var(--cf-ai-gold);
  flex: 0 0 auto;
}

.cf-ai-avatar svg {
  width: 20px;
  height: 20px;
}

.cf-ai-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--cf-ai-gold) !important;
  text-transform: none;
  letter-spacing: 0.02em;
}

.cf-ai-head p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--cf-ai-muted);
}

.cf-ai-head-text {
  flex: 1;
  min-width: 0;
}

.cf-ai-close {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--cf-ai-gold);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
}

.cf-ai-close:hover {
  background: rgba(242, 207, 92, 0.12);
}

.cf-ai-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.cf-ai-msg {
  max-width: 92%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.cf-ai-msg a {
  color: var(--cf-ai-gold);
  text-decoration: underline;
}

.cf-ai-msg.is-bot {
  align-self: flex-start;
  background: rgba(175, 124, 65, 0.16);
  border: 1px solid var(--cf-ai-line);
  color: var(--cf-ai-text);
  border-bottom-left-radius: 4px;
}

.cf-ai-msg.is-user {
  align-self: flex-end;
  background: linear-gradient(180deg, #af7c41, #7a4a22);
  color: #fff8e8;
  border-bottom-right-radius: 4px;
}

.cf-ai-msg.is-err {
  align-self: stretch;
  max-width: 100%;
  background: rgba(180, 40, 40, 0.25);
  border: 1px solid #c45c5c;
}

.cf-ai-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 16px;
}

.cf-ai-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cf-ai-gold);
  animation: cfAiBounce 1s infinite ease-in-out;
}

.cf-ai-typing i:nth-child(2) { animation-delay: 0.15s; }
.cf-ai-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes cfAiBounce {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.cf-ai-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.cf-ai-card {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--cf-ai-line);
  color: var(--cf-ai-text);
}

.cf-ai-card > a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.cf-ai-card:hover {
  border-color: var(--cf-ai-gold);
}

.cf-ai-card b {
  display: block;
  font-size: 13px;
  color: #fff;
  font-weight: 700;
}

.cf-ai-card span {
  font-size: 12px;
  color: #f87171;
  font-weight: 700;
}

.cf-ai-cart-btn {
  margin-top: 6px;
  width: 100%;
  height: 28px;
  border: 1px solid var(--cf-ai-gold);
  border-radius: 8px;
  background: linear-gradient(180deg, #d4a017, #af7c41);
  color: #1a0c0c;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
}

.cf-ai-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.cf-ai-action {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  background: #16a34a;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 700;
}

.cf-ai-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--cf-ai-line);
  background: rgba(0, 0, 0, 0.2);
}

.cf-ai-langs button {
  width: 24px;
  height: 18px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  border-radius: 2px;
  line-height: 0;
}

.cf-ai-langs button.is-active {
  border-color: var(--cf-ai-gold);
}

.cf-ai-langs img {
  width: 16px;
  height: 11px;
  display: block;
}

.cf-ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px 0;
}

.cf-ai-quick a.cf-ai-quick-wa {
  border: 1px solid #25d366;
  background: rgba(37, 211, 102, 0.18);
  color: #7dffb0;
  font-size: 11px;
  padding: 6px 9px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-block;
}

.cf-ai-wa-bar {
  display: block;
  text-align: center;
  padding: 7px 10px;
  background: #128c47;
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none !important;
  letter-spacing: 0.02em;
}

.cf-ai-wa-bar:hover {
  background: #0e7a3c;
}

.cf-ai-quick button:hover {
  background: rgba(175, 124, 65, 0.28);
}

.cf-ai-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--cf-ai-line);
}

.cf-ai-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--cf-ai-gold-2);
  border-radius: 10px;
  background: #120808;
  color: #fff8e8;
  padding: 0 12px;
  font-size: 13px;
}

.cf-ai-form input:focus {
  outline: none;
  border-color: var(--cf-ai-gold);
}

.cf-ai-form button[type="submit"] {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--cf-ai-gold);
  border-radius: 10px;
  background: linear-gradient(180deg, #d4a017, #af7c41);
  color: #1a0c0c;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.cf-ai-form button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: wait;
}

.cf-ai.is-rtl {
  right: auto;
  left: 18px;
}

.cf-ai.is-rtl .cf-ai-msg.is-bot { align-self: flex-end; }
.cf-ai.is-rtl .cf-ai-msg.is-user { align-self: flex-start; }

@media screen and (max-width: 600px) {
  .cf-ai {
    right: 10px;
    bottom: 10px;
  }
  .cf-ai.is-rtl {
    left: 10px;
  }
  .cf-ai.is-open .cf-ai-panel {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    max-height: none;
    border-radius: 12px;
  }
}
