/**
 * @file
 * Styles for WB WDR Chatbox floating button and modal.
 */

/* Floating button styles */
.wb-wdr-chatbox-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9998;
  padding: 12px 24px;
  background-color: #0071bc;
  color: #ffffff;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wb-wdr-chatbox-button:hover {
  background-color: #005a96;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.wb-wdr-chatbox-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Modal overlay */
.wb-wdr-chatbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.wb-wdr-chatbox-overlay.active {
  display: flex;
}

/* Modal container */
.wb-wdr-chatbox-modal {
  position: relative;
  width: 90%;
  max-width: 900px;
  height: 80vh;
  max-height: 700px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

/* Modal header */
.wb-wdr-chatbox-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background-color: #0071bc;
  color: #ffffff;
  border-bottom: 1px solid #e0e0e0;
}

.wb-wdr-chatbox-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Close button */
.wb-wdr-chatbox-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.wb-wdr-chatbox-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.wb-wdr-chatbox-close:focus {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Modal content (iframe container) */
.wb-wdr-chatbox-modal-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.wb-wdr-chatbox-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Loading indicator */
.wb-wdr-chatbox-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  color: #666666;
  display: none;
}

.wb-wdr-chatbox-loading.active {
  display: block;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Responsive styles */
@media (max-width: 768px) {
  .wb-wdr-chatbox-button {
    bottom: 15px;
    right: 15px;
    padding: 10px 20px;
    font-size: 13px;
  }

  .wb-wdr-chatbox-modal {
    width: 95%;
    height: 85vh;
    max-height: none;
  }

  .wb-wdr-chatbox-modal-header {
    padding: 12px 16px;
  }

  .wb-wdr-chatbox-modal-title {
    font-size: 16px;
  }
}

/* Accessibility improvements */
.wb-wdr-chatbox-button:focus,
.wb-wdr-chatbox-close:focus {
  outline: 3px solid #ffbf47;
  outline-offset: 2px;
}

/* Prevent body scroll when modal is open */
body.wb-wdr-chatbox-modal-open {
  overflow: hidden;
}

