/* ====== CHAT WIDGET ====== */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gold);
  border: 1px solid var(--gold-bright);
  color: var(--black);
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(201, 169, 97, 0.4), 0 0 0 0 rgba(201, 169, 97, 0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  animation: chatPulse 2.5s ease-in-out infinite;
}

.chat-fab:hover {
  transform: scale(1.06);
  background: var(--gold-bright);
}

.chat-fab.open {
  background: var(--black);
  border-color: var(--gold);
  color: var(--gold);
  animation: none;
}

.chat-fab svg {
  width: 28px;
  height: 28px;
  transition: transform 0.3s ease;
}

.chat-fab .icon-close {
  display: none;
}

.chat-fab.open .icon-chat { display: none; }
.chat-fab.open .icon-close { display: block; }

@keyframes chatPulse {
  0%, 100% { box-shadow: 0 8px 30px rgba(201, 169, 97, 0.4), 0 0 0 0 rgba(201, 169, 97, 0.5); }
  50% { box-shadow: 0 8px 30px rgba(201, 169, 97, 0.4), 0 0 0 12px rgba(201, 169, 97, 0); }
}

.chat-window {
  position: fixed;
  bottom: 104px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 140px);
  background: var(--charcoal);
  border: 1px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.chat-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--black);
  display: flex;
  align-items: center;
  gap: 14px;
}

.chat-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-header-avatar svg {
  width: 24px;
  height: 24px;
  color: var(--black);
}

.chat-header-info {
  flex: 1;
  min-width: 0;
}

.chat-header-name {
  font-family: var(--display);
  font-size: 18px;
  color: var(--cream);
  font-weight: 500;
  line-height: 1.1;
}

.chat-header-status {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4CD964;
  box-shadow: 0 0 8px rgba(76, 217, 100, 0.6);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dark) transparent;
}

.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }

.chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  animation: msgIn 0.3s ease;
}

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

.chat-msg.bot {
  background: var(--slate);
  border: 1px solid var(--line);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-msg.user {
  background: var(--gold);
  color: var(--black);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

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

.chat-typing {
  align-self: flex-start;
  background: var(--slate);
  border: 1px solid var(--line);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  padding: 14px 18px;
  display: flex;
  gap: 4px;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  animation: typingDot 1.2s ease-in-out infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.chat-quick-replies {
  padding: 0 20px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-quick {
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--gold);
  font-size: 12px;
  font-family: var(--body);
  cursor: pointer;
  border-radius: 20px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.chat-quick:hover {
  border-color: var(--gold);
  background: rgba(201, 169, 97, 0.1);
}

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: var(--black);
}

.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: var(--slate);
  border: 1px solid var(--line);
  color: var(--cream);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--body);
  resize: none;
  max-height: 100px;
  min-height: 44px;
  line-height: 1.4;
}

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

.chat-input::placeholder { color: var(--muted); }

.chat-btn {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--black);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chat-btn:hover { background: var(--gold-bright); }
.chat-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-btn svg { width: 20px; height: 20px; }

.chat-btn-secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--gold);
}

.chat-btn-secondary:hover {
  border-color: var(--gold);
  background: rgba(201, 169, 97, 0.1);
}

.chat-disclaimer {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
  letter-spacing: 0.05em;
}

/* Photo upload form */
.chat-photo-form {
  background: var(--slate);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 20px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: msgIn 0.4s ease;
}

.chat-photo-form h4 {
  font-family: var(--display);
  color: var(--gold);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 4px;
}

.chat-photo-form p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
  line-height: 1.5;
}

.chat-photo-form label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.chat-photo-form input[type="text"],
.chat-photo-form input[type="email"],
.chat-photo-form input[type="tel"],
.chat-photo-form textarea {
  width: 100%;
  background: var(--black);
  border: 1px solid var(--line);
  color: var(--cream);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--body);
}

.chat-photo-form input:focus,
.chat-photo-form textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.chat-photo-form textarea {
  resize: vertical;
  min-height: 60px;
}

.chat-photo-form .photo-drop {
  border: 1px dashed var(--gold);
  border-radius: 8px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(201, 169, 97, 0.04);
}

.chat-photo-form .photo-drop:hover {
  background: rgba(201, 169, 97, 0.1);
}

.chat-photo-form .photo-drop svg {
  width: 32px;
  height: 32px;
  color: var(--gold);
  margin-bottom: 8px;
}

.chat-photo-form .photo-drop span {
  display: block;
  font-size: 12px;
  color: var(--cream);
  letter-spacing: 0.1em;
}

.chat-photo-form .photo-drop small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

.chat-photo-form .photo-drop input[type="file"] {
  display: none;
}

.chat-photo-form .photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chat-photo-form .photo-preview-item {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.chat-photo-form .photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-photo-form .photo-preview-item button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.8);
  border: none;
  color: var(--cream);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.chat-photo-form .submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--gold);
  color: var(--black);
  border: none;
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  margin-top: 4px;
  font-family: var(--body);
  transition: background 0.2s ease;
}

.chat-photo-form .submit-btn:hover { background: var(--gold-bright); }
.chat-photo-form .submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-photo-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 700px) {
  .chat-fab {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }
  .chat-window {
    bottom: 88px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    height: calc(100vh - 110px);
  }
  .chat-photo-form .form-row {
    grid-template-columns: 1fr;
  }
}
