/* web/css/ai-chat.css - Modern AI Chatbot Styling */

#ai-chat-root {
  font-family: inherit;
  z-index: 9999;
  position: relative;
}

/* Floating Action Button - Positioned Bottom Right */
.ai-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 110;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #e50914; /* primary red */
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px -5px rgba(229, 9, 20, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 700;
  font-size: 14px;
  user-select: none;
}

.ai-chat-fab:hover {
  transform: translateY(-2px) scale(1.03);
  background: #f40a16;
  box-shadow: 0 14px 30px -5px rgba(229, 9, 20, 0.5);
}

.ai-chat-fab-icon {
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Chat Window Modal / Widget Panel */
.ai-chat-window {
  position: fixed;
  bottom: 85px;
  right: 24px;
  width: calc(100vw - 48px);
  max-width: 410px;
  height: 580px;
  max-height: calc(100vh - 110px);
  background: rgba(24, 24, 27, 0.96); /* zinc-900 */
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  z-index: 120;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Chat Header */
.ai-chat-header {
  padding: 16px 20px;
  background: rgba(39, 39, 42, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.ai-chat-title {
  font-weight: 800;
  font-size: 15px;
  color: #ffffff;
  line-height: 1.2;
}

.ai-chat-subtitle {
  font-size: 11px;
  color: #a1a1aa;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.ai-online-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 9999px;
  display: inline-block;
  box-shadow: 0 0 8px #22c55e;
}

.ai-online-text {
  color: #22c55e;
  font-weight: 700;
}

/* Status Indikátor na plovoucím tlačítku */
.ai-fab-status {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  margin-right: 2px;
}

.ai-fab-status-dot {
  width: 9px;
  height: 9px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
  z-index: 2;
}

.ai-fab-status-ping {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #22c55e;
  opacity: 0.75;
  animation: ai-fab-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
  z-index: 1;
}

@keyframes ai-fab-ping {
  75%, 100% {
    transform: scale(2.3);
    opacity: 0;
  }
}

.ai-chat-trash-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #a1a1aa;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-chat-trash-btn:hover {
  background: rgba(229, 9, 20, 0.2);
  color: #ff4d4d;
}

.ai-chat-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #a1a1aa;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Chat Messages Container */
.ai-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
.ai-chat-body::-webkit-scrollbar {
  width: 5px;
}
.ai-chat-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
}

/* Message Bubble Styling */
.ai-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: aiFadeIn 0.3s ease-out forwards;
}

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

.ai-msg-user {
  align-self: flex-end;
}

.ai-msg-assistant {
  align-self: flex-start;
}

.ai-msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.ai-msg-user .ai-msg-bubble {
  background: #e50914;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.25);
}

.ai-msg-assistant .ai-msg-bubble {
  background: rgba(39, 39, 42, 0.85);
  color: #f4f4f5;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Recommended Products Cards */
.ai-recommendations-box {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.ai-item-card {
  background: rgba(24, 24, 27, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.2s;
}

.ai-item-card:hover {
  border-color: rgba(229, 9, 20, 0.5);
}

.ai-item-info {
  display: flex;
  flex-direction: column;
}

.ai-item-name {
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
}

.ai-item-desc {
  font-size: 11px;
  color: #a1a1aa;
  margin: 2px 0 4px 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-item-price {
  font-weight: 800;
  font-size: 12px;
  color: #e50914;
}

.ai-add-btn {
  background: rgba(229, 9, 20, 0.15);
  color: #ff4d4d;
  border: 1px solid rgba(229, 9, 20, 0.4);
  padding: 6px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.ai-add-btn:hover {
  background: #e50914;
  color: #ffffff;
  border-color: #e50914;
  transform: scale(1.02);
}

/* Dvouřádková karta pizzy s variantami Normální / Maxi */
.ai-item-card-variants {
  flex-direction: column;
  align-items: stretch;
}

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

.ai-variant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.ai-variant-label {
  font-weight: 700;
  font-size: 12px;
  color: #e4e4e7;
  min-width: 66px;
}

.ai-variant-row .ai-item-price {
  margin-left: auto;
}

.ai-add-all-btn {
  background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 14px rgba(229, 9, 20, 0.4);
  transition: all 0.2s;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ai-add-all-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(229, 9, 20, 0.5);
}

/* Quick Suggestion Pills */
.ai-suggestions-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ai-chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d4d4d8;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-chip-btn:hover {
  background: rgba(229, 9, 20, 0.2);
  border-color: rgba(229, 9, 20, 0.5);
  color: #ffffff;
}

/* Typing indicator dots */
.ai-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(39, 39, 42, 0.85);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-typing-dot {
  width: 6px;
  height: 6px;
  background: #a1a1aa;
  border-radius: 50%;
  animation: aiTyping 1.4s infinite ease-in-out both;
}

.ai-typing-dot:nth-child(1) { animation-delay: 0s; }
.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiTyping {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Chat Footer / Input area */
.ai-chat-footer {
  padding: 12px 16px;
  background: rgba(24, 24, 27, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-chat-input {
  flex: 1;
  background: rgba(39, 39, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.ai-chat-input:focus {
  border-color: #e50914;
}

.ai-chat-input::placeholder {
  color: #71717a;
}

.ai-chat-disclaimer {
  padding: 6px 16px 10px;
  background: rgba(24, 24, 27, 0.95);
  color: #71717a;
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
}

.ai-chat-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
}

.ai-chat-input-wrap .ai-chat-input {
  flex: 1;
  padding-right: 46px; /* místo pro počítadlo znaků */
}

.ai-chat-counter {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  color: #71717a;
  pointer-events: none;
}

.ai-chat-send-btn {
  background: #e50914;
  color: white;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ai-chat-send-btn:hover {
  background: #f40a16;
  transform: scale(1.05);
}

.ai-chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Toast feedback inside chat */
.ai-toast {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  margin-top: 6px;
  text-align: center;
  animation: aiFadeIn 0.2s ease-out;
}

/* Responsive adjustment for small mobile screens */
@media (max-width: 480px) {
  .ai-chat-fab {
    bottom: 20px;
    right: 16px;
    padding: 10px 16px;
    font-size: 13px;
  }
  .ai-chat-window {
    right: 12px;
    bottom: 75px;
    width: calc(100vw - 24px);
    height: 520px;
  }
}
