/* =============================================
   CONTACT PAGE
   ============================================= */

/* Hero */
.contact-hero {
  margin-top: 72px;
}

.contact-hero-bg {
  transform: scale(1.06);
  will-change: transform;
}

.contact-hero-overlay {
  background:
    linear-gradient(180deg, rgba(5, 31, 32, 0.45) 0%, rgba(5, 31, 32, 0.7) 50%, rgba(5, 31, 32, 0.92) 100%);
}

/* Detail cards */
.contact-detail-card {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-detail-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.3);
}

/* Form inputs */
.contact-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.contact-input option {
  background: #0B2B26;
  color: #fff;
}

select.contact-input {
  color: rgba(255, 255, 255, 0.6);
}

select.contact-input:valid {
  color: #ffffff;
}

select.contact-input option[value=""][disabled] {
  color: rgba(255, 255, 255, 0.3);
}

/* Submit button */
.contact-submit-btn {
  box-shadow: 0 4px 20px rgba(142, 182, 155, 0.3);
}

/* reCAPTCHA */
.g-recaptcha {
  margin: 1rem 0;
  transform: scale(1);
  transform-origin: 0 0;
}

@media (max-width: 400px) {
  .g-recaptcha {
    transform: scale(0.85);
    transform-origin: 0 0;
  }
}

.contact-submit-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Map */
.contact-map-wrapper {
  position: relative;
}

.contact-map-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  pointer-events: none;
  z-index: 1;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.15);
}

/* Quick support cards */
.quick-support-card {
  text-decoration: none;
}

/* Social links */
.social-link-card {
  text-decoration: none;
}

/* CTA */
.contact-cta-overlay {
  background:
    linear-gradient(180deg, rgba(5, 31, 32, 0.5) 0%, rgba(5, 31, 32, 0.75) 50%, rgba(5, 31, 32, 0.9) 100%);
}

.contact-cta-btn {
  box-shadow: 0 4px 20px rgba(142, 182, 155, 0.3);
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 639px) {
  .contact-hero {
    min-height: 50vh;
  }

  .contact-map-wrapper iframe {
    height: 280px;
  }
}

/* =============================================
   LIVE CHAT WIDGET
   ============================================= */

.live-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Poppins', sans-serif;
}

/* Bubble */
.chat-bubble {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #8EB69B;
  color: #051F20;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(142, 182, 155, 0.45), 0 0 0 0 rgba(142, 182, 155, 0.4);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  animation: chat-bubble-appear 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 32px rgba(142, 182, 155, 0.55), 0 0 0 6px rgba(142, 182, 155, 0.12);
}

.chat-bubble:active {
  transform: scale(0.95);
}

.chat-bubble-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #8EB69B;
  animation: chat-pulse 2s ease-out infinite;
  pointer-events: none;
}

@keyframes chat-bubble-appear {
  0% { transform: scale(0) rotate(-12deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes chat-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Chat Window */
.chat-window {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: #0B2B26;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(142, 182, 155, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: chat-window-open 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-window.hidden {
  display: none;
}

@keyframes chat-window-open {
  0% { transform: scale(0.85) translateY(12px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Header */
.chat-header {
  background: #163832;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

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

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(142, 182, 155, 0.15);
  color: #8EB69B;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-header-title {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.chat-header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.65rem;
}

.chat-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  flex-shrink: 0;
}

.chat-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.chat-msg {
  display: flex;
  gap: 8px;
  max-width: 85%;
  animation: chat-msg-in 0.3s ease forwards;
}

@keyframes chat-msg-in {
  0% { transform: translateY(8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.chat-msg-bot {
  align-self: flex-start;
}

.chat-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(142, 182, 155, 0.15);
  color: #8EB69B;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.chat-msg-user .chat-msg-avatar {
  background: rgba(142, 182, 155, 0.25);
  color: #a8d4b8;
}

.chat-msg-content p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: 14px;
}

.chat-msg-bot .chat-msg-content p {
  background: #1a3d35;
  color: rgba(255, 255, 255, 0.85);
  border-bottom-left-radius: 4px;
}

.chat-msg-user .chat-msg-content p {
  background: #8EB69B;
  color: #051F20;
  border-bottom-right-radius: 4px;
}

.chat-msg-time {
  display: block;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 4px;
  padding: 0 4px;
}

.chat-msg-user .chat-msg-time {
  text-align: right;
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  animation: chat-typing-bounce 1.2s infinite;
}

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

@keyframes chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Quick Replies */
.chat-quick-replies {
  padding: 0 14px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.chat-quick-btn {
  background: rgba(142, 182, 155, 0.1);
  border: 1px solid rgba(142, 182, 155, 0.2);
  color: #8EB69B;
  font-size: 0.7rem;
  font-family: 'Poppins', sans-serif;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.chat-quick-btn:hover {
  background: rgba(142, 182, 155, 0.2);
  border-color: rgba(142, 182, 155, 0.4);
  color: #a8d4b8;
}

/* Input */
.chat-input-area {
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #0d2e29;
  flex-shrink: 0;
}

.chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  color: #fff;
  font-size: 0.82rem;
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.chat-input:focus {
  border-color: rgba(142, 182, 155, 0.4);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #8EB69B;
  color: #051F20;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}

.chat-send-btn:hover {
  background: #a8d4b8;
}

.chat-send-btn:active {
  transform: scale(0.92);
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .live-chat-widget {
    bottom: 16px;
    right: 16px;
  }

  .chat-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 120px);
    bottom: 68px;
    right: 0;
    border-radius: 16px;
  }

  .chat-bubble {
    width: 54px;
    height: 54px;
  }

  .chat-bubble svg {
    width: 24px;
    height: 24px;
  }
}

/* =============================================
   REDUCED MOTION
   ============================================= */

@media (prefers-reduced-motion: reduce) {
  .contact-hero-bg {
    transform: none;
  }

  .contact-detail-card,
  .quick-support-card,
  .social-link-card,
  .contact-submit-btn,
  .contact-cta-btn,
  .contact-cta-btn-secondary {
    transition: none;
  }

  .contact-detail-card:hover,
  .quick-support-card:hover,
  .social-link-card:hover {
    transform: none;
  }

  .chat-bubble {
    animation: none;
  }

  .chat-window {
    animation: none;
  }

  .chat-msg {
    animation: none;
  }

  .chat-bubble-pulse {
    animation: none;
  }
}
