/**
 * RSV Roofing ChatBot Styles - Bundle Version
 */

:root {
  --rsv-primary: #02567B;
  --rsv-primary-light: #009FE5;
  --rsv-primary-lighter: #00CFF4;
  --rsv-success: #4ADE80;
  --rsv-shadow: 0 10px 40px rgba(2, 86, 123, 0.2);
  --rsv-shadow-lg: 0 20px 60px rgba(2, 86, 123, 0.3);
}

/* Floating Button */
.rsv-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rsv-primary) 0%, var(--rsv-primary-light) 100%);
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: var(--rsv-shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: rsv-pulse 2s ease-in-out infinite;
}

.rsv-chat-btn:hover {
  transform: scale(1.1);
}

.rsv-chat-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

@keyframes rsv-pulse {
  0%, 100% {
    box-shadow: 0 10px 40px rgba(2, 86, 123, 0.2), 0 0 0 0 rgba(0, 207, 244, 0.7);
  }
  50% {
    box-shadow: 0 10px 40px rgba(2, 86, 123, 0.2), 0 0 0 15px rgba(0, 207, 244, 0);
  }
}

/* Chat Window */
.rsv-chat-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 600px;
  background: white;
  border-radius: 20px;
  box-shadow: var(--rsv-shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.rsv-chat-window.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9) translateY(20px);
}

/* Header */
.rsv-chat-header {
  background: linear-gradient(135deg, var(--rsv-primary) 0%, var(--rsv-primary-light) 100%);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.rsv-chat-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  padding: 4px;
  object-fit: contain;
}

.rsv-chat-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  font-family: 'Lexend', sans-serif;
}

.rsv-chat-status {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rsv-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--rsv-success);
  animation: rsv-pulse-dot 2s ease-in-out infinite;
}

@keyframes rsv-pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

.rsv-chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Messages */
.rsv-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8f9fa;
  scroll-behavior: smooth;
}

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

.rsv-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(2, 86, 123, 0.3);
  border-radius: 3px;
}

.rsv-chat-message {
  display: flex;
  max-width: 85%;
  animation: rsv-appear 0.3s ease;
}

@keyframes rsv-appear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rsv-chat-message-user {
  align-self: flex-end;
}

.rsv-chat-message-assistant {
  align-self: flex-start;
}

.rsv-chat-message-content {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.rsv-chat-message-user .rsv-chat-message-content {
  background: linear-gradient(135deg, var(--rsv-primary) 0%, var(--rsv-primary-light) 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.rsv-chat-message-assistant .rsv-chat-message-content {
  background: white;
  color: #333;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rsv-chat-message-content strong {
  font-weight: 600;
  color: var(--rsv-primary);
}

.rsv-chat-message-user .rsv-chat-message-content strong {
  color: white;
  font-weight: 700;
}

.rsv-chat-message-content a {
  color: var(--rsv-primary-lighter);
  text-decoration: underline;
}

/* Typing Indicator */
.rsv-typing {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.rsv-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--rsv-primary);
  opacity: 0.6;
  animation: rsv-typing 1.4s ease-in-out infinite;
}

.rsv-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.rsv-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes rsv-typing {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* Input Container */
.rsv-chat-input-container {
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  align-items: center;
}

.rsv-chat-clear-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.rsv-chat-clear-btn:hover {
  background: #f3f4f6;
  color: #ef4444;
}

.rsv-chat-input {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  font-family: 'Lexend', sans-serif;
}

.rsv-chat-input:focus {
  border-color: var(--rsv-primary);
  box-shadow: 0 0 0 3px rgba(2, 86, 123, 0.1);
}

.rsv-chat-input::placeholder {
  color: #9ca3af;
}

.rsv-chat-send-btn {
  background: linear-gradient(135deg, var(--rsv-primary) 0%, var(--rsv-primary-light) 100%);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.rsv-chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(2, 86, 123, 0.3);
}

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

/* Quick Options */
.rsv-quick-options {
  padding: 12px 20px;
  background: white;
  border-top: 1px solid #e5e7eb;
  transition: all 0.3s;
}

.rsv-quick-options.hidden {
  max-height: 0;
  padding: 0 20px;
  opacity: 0;
  pointer-events: none;
}

.quick-options-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.quick-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.quick-option-btn {
  background: linear-gradient(135deg, rgba(2, 86, 123, 0.08) 0%, rgba(0, 159, 229, 0.08) 100%);
  border: 1px solid rgba(2, 86, 123, 0.2);
  color: var(--rsv-primary);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-option-btn:hover {
  background: linear-gradient(135deg, var(--rsv-primary) 0%, var(--rsv-primary-light) 100%);
  color: white;
  border-color: var(--rsv-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(2, 86, 123, 0.3);
}

.quick-option-btn:active {
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 480px) {
  .rsv-chat-btn {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
  }

  .rsv-chat-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    border-radius: 0;
  }

  .rsv-chat-header {
    padding: 16px;
  }

  .rsv-chat-messages {
    padding: 16px;
  }

  .quick-options-grid {
    grid-template-columns: 1fr;
  }

  .quick-option-btn {
    font-size: 12px;
    padding: 10px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .rsv-chat-btn,
  .rsv-chat-window,
  .rsv-chat-message,
  .rsv-chat-close-btn,
  .rsv-chat-send-btn {
    animation: none;
    transition: none;
  }
}

.rsv-chat-btn:focus-visible,
.rsv-chat-close-btn:focus-visible,
.rsv-chat-clear-btn:focus-visible,
.rsv-chat-send-btn:focus-visible {
  outline: 2px solid var(--rsv-primary);
  outline-offset: 2px;
}

/* Inline Booking Button */
.rsv-inline-booking {
  display: flex;
  justify-content: center;
  padding: 8px 0;
  animation: rsv-appear 0.3s ease;
}

.rsv-inline-booking-btn {
  background: linear-gradient(135deg, var(--rsv-primary-lighter) 0%, var(--rsv-primary-light) 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 207, 244, 0.3);
  font-family: 'Lexend', sans-serif;
}

.rsv-inline-booking-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 207, 244, 0.4);
  background: linear-gradient(135deg, #00e4ff 0%, #00b8d4 100%);
}

.rsv-inline-booking-btn:active {
  transform: translateY(0);
}
