/* ========================================
   CHAT WIDGET STYLES
   ======================================== */

/* Widget Container */
.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: "Plus Jakarta Sans", sans-serif;
}

/* Chat Button */
.chat-widget-button {
  position: relative;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #d93b3b 0%, #b91c1c 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: move;
  box-shadow: 0 8px 24px rgba(217, 59, 59, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-user-select: none;
}

.chat-widget-button:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(217, 59, 59, 0.5);
}

.chat-widget-button:active {
  transform: scale(0.95);
}

.chat-widget-button .material-symbols-outlined {
  color: white;
  font-size: 32px;
  animation: pulse 2s ease-in-out infinite;
}

/* Badge */
.chat-widget-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 12px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
  animation: bounce 1s ease-in-out infinite;
}

/* Popup */
.chat-widget-popup {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 48px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.chat-widget-popup.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.chat-widget-header {
  background: linear-gradient(135deg, #d93b3b 0%, #b91c1c 100%);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-widget-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-widget-header-content .material-symbols-outlined {
  font-size: 28px;
}

.chat-widget-header h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.chat-widget-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-widget-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.chat-widget-close .material-symbols-outlined {
  color: white;
  font-size: 20px;
}

/* Body */
.chat-widget-body {
  padding: 24px;
}

.chat-widget-description {
  color: #555555;
  font-size: 14px;
  margin: 0 0 20px 0;
  line-height: 1.6;
}

/* Chat Options */
.chat-widget-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid #f5f5f5;
  background: white;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.chat-option:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Facebook Option */
.facebook-option {
  border-color: #e7f3ff;
}

.facebook-option:hover {
  border-color: #1877f2;
  background: #f0f8ff;
}

.facebook-option .chat-option-icon {
  color: #1877f2;
}

/* LINE Option */
.line-option {
  border-color: #e8f5e9;
}

.line-option:hover {
  border-color: #06c755;
  background: #f1f8f4;
}

.line-option .chat-option-icon {
  color: #06c755;
}

/* WhatsApp Option */
.whatsapp-option {
  border-color: #e8f5e9;
}

.whatsapp-option:hover {
  border-color: #25d366;
  background: #f0f9f3;
}

.whatsapp-option .chat-option-icon {
  color: #25d366;
}

/* Option Icon */
.chat-option-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(217, 59, 59, 0.05);
  flex-shrink: 0;
  transition: all 0.3s;
}

.chat-option:hover .chat-option-icon {
  transform: scale(1.1);
}

.chat-option-icon svg {
  width: 28px;
  height: 28px;
}

/* Option Content */
.chat-option-content {
  flex: 1;
}

.chat-option-content h4 {
  font-size: 16px;
  font-weight: 700;
  color: #222222;
  margin: 0 0 4px 0;
}

.chat-option-content p {
  font-size: 13px;
  color: #888888;
  margin: 0;
}

/* Option Arrow */
.chat-option-arrow {
  color: #cccccc;
  font-size: 20px;
  transition: all 0.3s;
}

.chat-option:hover .chat-option-arrow {
  color: #d93b3b;
  transform: translateX(4px);
}

/* Footer Note */
.chat-widget-footer-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 12px;
  color: #666666;
}

.chat-widget-footer-note .material-symbols-outlined {
  font-size: 18px;
  color: #d93b3b;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 480px) {
  .chat-widget {
    bottom: 16px;
    right: 16px;
  }

  .chat-widget-button {
    width: 56px;
    height: 56px;
  }

  .chat-widget-button .material-symbols-outlined {
    font-size: 28px;
  }

  .chat-widget-popup {
    width: calc(100vw - 32px);
    bottom: 72px;
  }

  .chat-widget-body {
    padding: 16px;
  }

  .chat-option {
    padding: 12px;
  }

  .chat-option-icon {
    width: 40px;
    height: 40px;
  }

  .chat-option-icon svg {
    width: 24px;
    height: 24px;
  }

  .chat-option-content h4 {
    font-size: 14px;
  }

  .chat-option-content p {
    font-size: 12px;
  }
}

/* ========================================
   DRAGGING STATE
   ======================================== */

.chat-widget-button.dragging {
  cursor: grabbing;
  opacity: 0.8;
  box-shadow: 0 16px 48px rgba(217, 59, 59, 0.6);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .chat-widget-popup {
    background: #242424;
  }

  .chat-widget-description {
    color: #aaaaaa;
  }

  .chat-option {
    background: #1a1a1a;
    border-color: #333333;
  }

  .chat-option-content h4 {
    color: #e0e0e0;
  }

  .chat-option-content p {
    color: #888888;
  }

  .chat-widget-footer-note {
    background: #1a1a1a;
    color: #aaaaaa;
  }
}
