/* WP Call to Action Frontend Styles */
:root {
  /* --alo-primary: #00aff2; */
  --alo-primary: #0072c9;
  --alo-primary-50: rgba(0, 175, 242, 0.5);
  --alo-green: #75eb50;
  --alo-green-50: rgba(117, 235, 80, 0.5);
  --alo-gray: #ccc;
  --alo-gray-50: rgba(204, 204, 204, 0.5);
  --alo-border: #63b3d3;
  --alo-fill: #7dc6e0;
  --alo-dark: rgba(30, 30, 30, 0.4);
}
.wp-cta-container {
  position: fixed;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

i.fab {
  font-family: "Font Awesome 5 Brands" !important;
}
i.fas {
  font-family: "Font Awesome 5 Free" !important;
}

/* Toggle Button */
.cta-toggle {
  width: 60px;
  height: 60px;
  background: #007cba;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  margin-bottom: 10px;
}

.cta-toggle:hover {
  background: #005a87;
  transform: scale(1.1);
}

.cta-toggle i {
  color: white;
  font-size: 24px;
}

/* Buttons Container */
.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Toggle button removed - buttons always visible */

/* Individual Buttons */
.cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.cta-button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cta-button i {
  color: white;
  font-size: 18px;
}

.cta-button img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Layout: Horizontal Circle */
.cta-layout-horizontal-circle .cta-buttons {
  flex-direction: row;
  gap: 8px;
}

.cta-layout-horizontal-circle .cta-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #007cba;
}

.cta-layout-horizontal-circle .cta-button:hover {
  background: var(--hover-color, #005a87);
}

/* Layout: Vertical Square */
.cta-layout-vertical-square .cta-button {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: #007cba;
}

.cta-layout-vertical-square .cta-button:hover {
  background: var(--hover-color, #005a87);
}

/* Layout: Vertical Rectangle */
.cta-layout-vertical-rectangle .cta-button {
  width: 120px;
  height: 40px;
  border-radius: 8px;
  background: #007cba;
  justify-content: flex-start;
  padding: 0 12px;
  gap: 8px;
}

.cta-layout-vertical-rectangle .cta-button:hover {
  background: var(--hover-color, #005a87);
}

.cta-layout-vertical-rectangle .button-text {
  color: white;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Animation */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cta-buttons {
  animation: slideIn 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cta-toggle {
    width: 50px;
    height: 50px;
  }

  .cta-toggle i {
    font-size: 20px;
  }

  .cta-layout-horizontal-circle .cta-button {
    width: 45px;
    height: 45px;
  }

  .cta-layout-vertical-square .cta-button {
    width: 45px;
    height: 45px;
  }

  .cta-layout-vertical-rectangle .cta-button {
    width: 100px;
    height: 35px;
    padding: 0 8px;
  }

  .cta-layout-vertical-rectangle .button-text {
    font-size: 11px;
  }

  .cta-button i {
    font-size: 16px;
  }

  .cta-button img {
    width: 20px;
    height: 20px;
  }
}

/* Accessibility */
.cta-button:focus {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .cta-toggle,
  .cta-button {
    border: 2px solid #000;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cta-toggle,
  .cta-button,
  .cta-buttons {
    transition: none;
    animation: none;
  }

  .cta-button:hover {
    transform: none;
  }

  .cta-toggle:hover {
    transform: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .cta-toggle {
    background: #005a87;
  }

  .cta-toggle:hover {
    background: #004085;
  }

  .cta-button {
    background: #005a87;
  }

  .cta-button:hover {
    background: var(--hover-color, #004085);
  }
}

/* Print styles */
@media print {
  .wp-cta-container {
    display: none !important;
  }
}

/* Loading state */
.wp-cta-container.loading .cta-toggle {
  pointer-events: none;
  opacity: 0.7;
}

.wp-cta-container.loading .cta-toggle i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Custom hover effects for different button types */
.cta-button[href*="facebook"]:hover {
  background: #1877f2 !important;
}

.cta-button[href*="instagram"]:hover {
  background: #e4405f !important;
}

.cta-button[href*="twitter"]:hover {
  background: #1da1f2 !important;
}

.cta-button[href*="youtube"]:hover {
  background: #ff0000 !important;
}

.cta-button[href*="pinterest"]:hover {
  background: #bd081c !important;
}

.cta-button[href*="zalo"]:hover {
  background: #0068ff !important;
}

.cta-button[href*="skype"]:hover {
  background: #00aff0 !important;
}

.cta-button[href^="mailto:"]:hover {
  background: #ea4335 !important;
}

.cta-button[href^="tel:"]:hover,
.cta-button[href^="sms:"]:hover {
  background: #28a745 !important;
}

/* Tooltip */
.cta-button::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  margin-bottom: 5px;
}

.cta-button:hover::after {
  opacity: 1;
}

/* Mobile touch improvements */
@media (hover: none) and (pointer: coarse) {
  .cta-button:hover {
    transform: none;
  }

  .cta-toggle:hover {
    transform: none;
  }

  .cta-button::after {
    display: none;
  }
}

/* ===== HOTLINE BUTTON STYLES ===== */

.wp-hotline-container {
  position: fixed;
  z-index: 9998;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  border-radius: 50px;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); */
  transition: all 0.3s ease;
  overflow: hidden;
  cursor: pointer;
  /* Border sẽ được override bởi inline styles từ PHP */
}

.hotline-button {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 12px 20px;
  gap: 8px;
  min-width: 60px;
  min-height: 60px;
}

.hotline-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.hotline-button i {
  font-size: 20px;
  color: inherit;
}

.hotline-number {
  font-size: 14px;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
}

/* Hotline Layout: Always show number */
.hotline-button {
  border-radius: 50px;
  padding: 12px 20px;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

/* Hotline Animation */
@keyframes hotlinePulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.wp-hotline-container:hover {
  animation: hotlinePulse 1s ease-in-out;
}

/* Hotline Responsive */
@media (max-width: 768px) {
  .wp-hotline-container {
    min-width: 50px;
    min-height: 50px;
  }

  .hotline-button {
    padding: 10px 16px;
    min-width: 50px;
    min-height: 50px;
  }

  .hotline-button i {
    font-size: 18px;
  }

  .hotline-number {
    font-size: 12px;
  }
}

/* Hotline Accessibility */
.hotline-button:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Hotline High contrast mode */
@media (prefers-contrast: high) {
  .wp-hotline-container {
    border: 2px solid #000;
  }
}

/* Hotline Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .wp-hotline-container,
  .hotline-button {
    transition: none;
    animation: none;
  }

  .hotline-button:hover {
    transform: none;
  }

  .wp-hotline-container:hover {
    animation: none;
  }
}

/* Hotline Dark mode support */
@media (prefers-color-scheme: dark) {
  .wp-hotline-container {
    filter: brightness(0.9);
  }
}

/* Hotline Print styles */
@media print {
  .wp-hotline-container {
    display: none !important;
  }
}

/* Hotline Tooltip */
.hotline-button::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  margin-bottom: 5px;
}

.hotline-button:hover::after {
  opacity: 1;
}

/* Hotline Mobile touch improvements */
@media (hover: none) and (pointer: coarse) {
  .hotline-button:hover {
    transform: none;
  }

  .wp-hotline-container:hover {
    animation: none;
  }

  .hotline-button::after {
    display: none;
  }
}

/* Tắt chuyển động nếu người dùng chọn hạn chế animation */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =================== Button Phone ================== */

/* ============= Container ============= */
.quick-alo-phone {
  position: fixed;
  background-color: transparent;
  width: 200px;
  height: 200px;
  cursor: pointer;
  z-index: 200000 !important;
  /* right: 150px;
  top: 30px; */
  overflow: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  transition: visibility 0.5s, opacity 0.3s;
}

.quick-alo-phone.quick-alo-static {
  opacity: 0.6;
}

.quick-alo-phone.quick-alo-hover,
.quick-alo-phone:hover {
  opacity: 1;
}

/* ============= Vòng ngoài (stroke) ============= */
.quick-alo-ph-circle {
  position: absolute;
  width: 160px;
  height: 160px;
  top: 20px;
  left: 20px;
  background-color: transparent;
  border-radius: 100%;
  border: 2px solid var(--alo-border);
  opacity: 0.1;
  animation: quick-alo-circle-anim 1.2s infinite ease-in-out;
  transition: all 0.5s;
  transform-origin: 50% 50%;
}

/* Trạng thái */
.quick-alo-phone.quick-alo-active .quick-alo-ph-circle {
  animation: quick-alo-circle-anim 1.1s infinite ease-in-out !important;
}

.quick-alo-phone.quick-alo-static .quick-alo-ph-circle {
  animation: quick-alo-circle-anim 2.2s infinite ease-in-out !important;
}

/* Hover theo theme */
.quick-alo-phone.quick-alo-hover .quick-alo-ph-circle,
.quick-alo-phone:hover .quick-alo-ph-circle {
  border-color: var(--alo-primary);
  opacity: 0.5;
}

.quick-alo-phone.quick-alo-green.quick-alo-hover .quick-alo-ph-circle,
.quick-alo-phone.quick-alo-green:hover .quick-alo-ph-circle {
  border-color: var(--alo-green);
  opacity: 0.5;
}

.quick-alo-phone.quick-alo-gray.quick-alo-hover .quick-alo-ph-circle,
.quick-alo-phone.quick-alo-gray:hover .quick-alo-ph-circle {
  border-color: var(--alo-gray);
  opacity: 0.5;
}

/* Màu mặc định theo theme */
.quick-alo-phone.quick-alo-green .quick-alo-ph-circle {
  border-color: var(--alo-border);
}

.quick-alo-phone.quick-alo-gray .quick-alo-ph-circle {
  border-color: var(--alo-green);
}

/* ============= Vòng fill ============= */
.quick-alo-ph-circle-fill {
  position: absolute;
  width: 100px;
  height: 100px;
  top: 50px;
  left: 50px;
  background-color: #000;
  border-radius: 100%;
  border: 2px solid transparent;
  opacity: 0.1;
  animation: quick-alo-circle-fill-anim 2.3s infinite ease-in-out;
  transition: all 0.5s;
  transform-origin: 50% 50%;
}

.quick-alo-phone.quick-alo-active .quick-alo-ph-circle-fill {
  animation: quick-alo-circle-fill-anim 1.7s infinite ease-in-out !important;
}

.quick-alo-phone.quick-alo-static .quick-alo-ph-circle-fill {
  animation: quick-alo-circle-fill-anim 2.3s infinite ease-in-out !important;
  opacity: 0 !important;
}

/* Hover fill */
.quick-alo-phone.quick-alo-hover .quick-alo-ph-circle-fill,
.quick-alo-phone:hover .quick-alo-ph-circle-fill {
  background-color: var(--alo-primary-50);
  opacity: 0.75 !important;
}

.quick-alo-phone.quick-alo-green.quick-alo-hover .quick-alo-ph-circle-fill,
.quick-alo-phone.quick-alo-green:hover .quick-alo-ph-circle-fill {
  background-color: var(--alo-green-50);
  opacity: 0.75 !important;
}

.quick-alo-phone.quick-alo-gray.quick-alo-hover .quick-alo-ph-circle-fill,
.quick-alo-phone.quick-alo-gray:hover .quick-alo-ph-circle-fill {
  background-color: var(--alo-gray-50);
  opacity: 0.75 !important;
}

/* Màu mặc định theo theme */
.quick-alo-phone.quick-alo-green .quick-alo-ph-circle-fill {
  background-color: var(--alo-fill);
  opacity: 0.75 !important;
}

.quick-alo-phone.quick-alo-gray .quick-alo-ph-circle-fill {
  background-color: var(--alo-green-50);
  opacity: 0.75 !important;
}

/* ============= Icon tròn giữa ============= */
/* Gợi ý: thay url(...) bằng SVG của bạn để nét hơn */
.quick-alo-ph-img-circle {
  position: absolute;
  width: 60px;
  height: 60px;
  top: 70px;
  left: 70px;
  background: rgba(30, 30, 30, 0.1) url("https://i.imgur.com/sM1nubF.png")
    no-repeat center center/36px 36px;
  border-radius: 100%;
  border: 2px solid transparent;
  opacity: 0.7;
  animation: quick-alo-circle-img-anim 1s infinite ease-in-out;
  transform-origin: 50% 50%;
}

/* Trạng thái img */
.quick-alo-phone.quick-alo-active .quick-alo-ph-img-circle {
  animation: quick-alo-circle-img-anim 1s infinite ease-in-out !important;
}

.quick-alo-phone.quick-alo-static .quick-alo-ph-img-circle {
  animation: none !important;
}

/* Hover img theo theme */
.quick-alo-phone.quick-alo-hover .quick-alo-ph-img-circle,
.quick-alo-phone:hover .quick-alo-ph-img-circle {
  background-color: var(--alo-primary);
}

.quick-alo-phone.quick-alo-green.quick-alo-hover .quick-alo-ph-img-circle,
.quick-alo-phone.quick-alo-green:hover .quick-alo-ph-img-circle {
  background-color: var(--alo-green);
}

.quick-alo-phone.quick-alo-gray.quick-alo-hover .quick-alo-ph-img-circle,
.quick-alo-phone.quick-alo-gray:hover .quick-alo-ph-img-circle {
  background-color: var(--alo-gray);
}

/* ============= Keyframes chuẩn ============= */
@keyframes quick-alo-circle-anim {
  0% {
    transform: rotate(0) scale(0.5) skew(1deg);
    opacity: 0.1;
  }

  30% {
    transform: rotate(0) scale(0.7) skew(1deg);
    opacity: 0.5;
  }

  100% {
    transform: rotate(0) scale(1) skew(1deg);
    opacity: 0.1;
  }
}

@keyframes quick-alo-circle-fill-anim {
  0% {
    transform: rotate(0) scale(0.7) skew(1deg);
    opacity: 0.2;
  }

  50% {
    transform: rotate(0) scale(1) skew(1deg);
    opacity: 0.2;
  }

  100% {
    transform: rotate(0) scale(0.7) skew(1deg);
    opacity: 0.2;
  }
}

@keyframes quick-alo-circle-img-anim {
  0% {
    transform: rotate(0) scale(1) skew(1deg);
  }

  10% {
    transform: rotate(-25deg) scale(1) skew(1deg);
  }

  20% {
    transform: rotate(25deg) scale(1) skew(1deg);
  }

  30% {
    transform: rotate(-25deg) scale(1) skew(1deg);
  }

  40% {
    transform: rotate(25deg) scale(1) skew(1deg);
  }

  50% {
    transform: rotate(0) scale(1) skew(1deg);
  }

  100% {
    transform: rotate(0) scale(1) skew(1deg);
  }
}

.quick-alo-ph-img-circle {
  background: var(--alo-primary)
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.86 19.86 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.86 19.86 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.12.9.33 1.78.62 2.63a2 2 0 0 1-.45 2.11L8 9a16 16 0 0 0 7 7l.54-.28a2 2 0 0 1 2.11-.45c.85.29 1.73.5 2.63.62A2 2 0 0 1 22 16.92z"/></svg>')
    no-repeat center center/36px 36px;
}
