/* Premium Contact Widget Styles */

:root {
  --cw-primary: #ff6600;
  --cw-primary-light: #ff983f;
  --cw-secondary: #00aff2;
  --cw-white: #ffffff;
  --cw-shadow: rgba(0, 0, 0, 0.15);
  --cw-gradient: linear-gradient(135deg, #ff6600 0%, #ffbb00 100%);
  --cw-zalo-color: #0068ff;
  --cw-call-color: #c91bb4;
}

.cw-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Greeting Bubble */
.cw-greeting {
  background: var(--cw-white);
  padding: 10px 18px;
  border-radius: 20px 20px 0 20px;
  box-shadow: 0 4px 15px var(--cw-shadow);
  margin-bottom: 15px;
  font-weight: 600;
  color: #333;
  font-size: 15px;
  position: relative;
  animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  cursor: pointer;
  white-space: normal;
  max-width: 260px;
  line-height: 1.4;
  text-align: right;
  pointer-events: auto;
  border: 1px solid rgba(0,0,0,0.05);
  transition: opacity 0.5s ease, transform 0.5s ease;
  visibility: visible;
  opacity: 1;
}

.cw-greeting.cw-fade {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
}

.cw-greeting.cw-hide {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: scale(0.8);
}

.cw-greeting::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 15px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--cw-white);
}

/* Main Toggle Button */
.cw-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 65px !important;
  height: 65px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  position: relative !important;
  background: var(--cw-gradient) !important;
  box-shadow: 0 8px 25px rgba(255, 102, 0, 0.4) !important;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease !important;
  z-index: 10 !important;
  border: none !important;
  padding: 0 !important;
  outline: none !important;
  overflow: visible !important;
  -webkit-appearance: none;
  appearance: none;
  aspect-ratio: 1 / 1 !important;
  box-sizing: border-box !important;
}

.cw-toggle:hover {
  transform: scale(1.08) rotate(5deg) !important;
  box-shadow: 0 12px 30px rgba(255, 102, 0, 0.5) !important;
}

.cw-toggle img {
  width: 35px !important;
  height: 35px !important;
  filter: brightness(0) invert(1) !important;
  transition: transform 0.3s ease !important;
  display: block !important;
  margin: 0 !important;
}

.cw-widget.active .cw-toggle img {
  transform: rotate(90deg) scale(0.8);
}

/* Pulse Effect */
.cw-pulse-ring,
.cw-pulse-fill {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  border-radius: 50% !important;
  transform: translate(-50%, -50%) !important;
  pointer-events: none !important;
}

.cw-pulse-ring {
  width: 90px !important;
  height: 90px !important;
  border: 2px solid rgba(255, 102, 0, 0.4) !important;
  animation: cw-pulse-ring 1.6s infinite ease-in-out !important;
  z-index: 1 !important;
}

.cw-pulse-fill {
  width: 65px !important;
  height: 65px !important;
  background-color: rgba(255, 102, 0, 0.2) !important;
  animation: cw-pulse-fill 2s infinite ease-in-out !important;
  z-index: 2 !important;
}

@keyframes cw-pulse-ring {
  0%   { transform: translate(-50%, -50%) scale(0.85); opacity: 0.7; }
  50%  { transform: translate(-50%, -50%) scale(1);    opacity: 0.3; }
  100% { transform: translate(-50%, -50%) scale(1.2);  opacity: 0.1; }
}

@keyframes cw-pulse-fill {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.8; }
}

/* Contact Box */
.cw-box {
  position: absolute;
  bottom: 85px;
  right: 0;
  width: 280px;
  background: var(--cw-white);
  border-radius: 18px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  overflow: hidden;
  transform-origin: bottom right;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  opacity: 0;
  transform: scale(0.8) translateY(20px);
  pointer-events: none;
  visibility: hidden;
}

.cw-widget.active .cw-box {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.cw-header {
  background: var(--cw-gradient);
  color: var(--cw-white);
  padding: 18px;
  font-weight: 700;
  text-align: center;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.cw-actions {
  display: flex;
  flex-direction: column;
  padding: 15px;
  gap: 12px;
}

.cw-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  color: var(--cw-white);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.cw-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.1);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.cw-btn:hover::before {
  transform: translateX(0);
}

.cw-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.cw-btn img {
  width: 24px;
  height: 24px;
}

.cw-zalo { background: var(--cw-zalo-color); }
.cw-call { background: var(--cw-call-color); }

/* Animations */
@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3) translateY(20px); }
  50% { opacity: 1; transform: scale(1.05) translateY(-5px); }
  70% { transform: scale(0.9) translateY(2px); }
  100% { transform: scale(1) translateY(0); }
}

@media (max-width: 480px) {
  .cw-widget {
    bottom: 20px;
    right: 20px;
  }
  .cw-box {
    width: 240px;
  }
}
