/* Custom styles for Nhà Đẹp Plus Landing Page */

/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --brand-orange: #F48A1F;
  --brand-orange-light: #FF9E3D;
  --brand-orange-dark: #D96C0F;
  --brand-brown: #3C2E25;
  --brand-cream: #FDF7F1;
  --brand-dark: #2A2A2A;
  --brand-gray: #7A7A7A;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--brand-cream);
  color: var(--brand-brown);
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--brand-cream);
}
::-webkit-scrollbar-thumb {
  background: var(--brand-orange);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-orange-dark);
}

/* Base custom classes */
.bg-brand-cream {
  background-color: var(--brand-cream);
}

.bg-brand-brown {
  background-color: var(--brand-brown);
}

.bg-brand-orange {
  background-color: var(--brand-orange);
}

.bg-brand-cream\/60 {
  background-color: rgba(253, 247, 241, 0.6);
}

.bg-brand-dark {
  background-color: var(--brand-dark);
}

.text-brand-orange {
  color: var(--brand-orange);
}

.text-brand-orange-dark {
  color: var(--brand-orange-dark);
}

.text-brand-brown {
  color: var(--brand-brown);
}

.hover\:text-brand-orange:hover {
  color: var(--brand-orange);
}

.hover\:text-brand-orange-dark:hover {
  color: var(--brand-orange-dark);
}

.hover\:bg-brand-dark:hover {
  background-color: var(--brand-dark);
}

.border-brand-orange\/15 {
  border-color: rgba(244, 138, 31, 0.15);
}

.border-brand-orange\/20 {
  border-color: rgba(244, 138, 31, 0.2);
}

.border-brand-orange {
  border-color: var(--brand-orange);
}

.shadow-brand-brown\/5 {
  --tw-shadow-color: rgba(60, 46, 37, 0.05);
  --tw-shadow: var(--tw-shadow-colored);
}

.bg-brand-gradient {
  background: linear-gradient(135deg, var(--brand-orange-light) 0%, var(--brand-orange-dark) 100%);
}

.text-brand-gradient {
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glassmorphism card */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Floating contact buttons */
.floating-contact {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
}

.floating-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  position: relative;
}

.floating-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-zalo {
  background-color: #0068FF;
}

.btn-phone {
  background-color: var(--brand-orange);
}

/* Pulsing effect for buttons */
.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: pulse-animation 2s infinite;
  box-shadow: 0 0 0 0 rgba(244, 138, 31, 0.7);
}

.btn-zalo .pulse-ring {
  box-shadow: 0 0 0 0 rgba(0, 104, 255, 0.7);
}

@keyframes pulse-animation {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(244, 138, 31, 0.7);
  }
  70% {
    transform: scale(1.3);
    box-shadow: 0 0 0 15px rgba(244, 138, 31, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(244, 138, 31, 0);
  }
}

.btn-zalo .pulse-ring {
  animation: pulse-animation-zalo 2s infinite;
}

@keyframes pulse-animation-zalo {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 104, 255, 0.7);
  }
  70% {
    transform: scale(1.3);
    box-shadow: 0 0 0 15px rgba(0, 104, 255, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 104, 255, 0);
  }
}

/* Accordion design */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
}

.faq-item.active .faq-answer {
  max-height: 1000px;
  transition: max-height 0.5s ease-in-out;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

/* Gallery image transitions */
.gallery-item {
  transition: all 0.4s ease;
}

.gallery-item.hidden {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

/* Form inputs */
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-orange) !important;
  box-shadow: 0 0 0 3px rgba(244, 138, 31, 0.15) !important;
}

.form-error {
  border-color: #EF4444 !important;
}

.form-error-msg {
  color: #EF4444;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  margin-left: 0.25rem;
}

/* --- BEFORE/AFTER SLIDER STYLES --- */
.before-after-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.before-after-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.before-after-overlay-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.before-after-overlay-img img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: none;
}

.before-after-slider-range {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 30;
}

.before-after-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: white;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.before-after-handle-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background-color: var(--brand-orange);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  border: 3px solid white;
}

.before-after-badge {
  position: absolute;
  bottom: 16px;
  padding: 6px 12px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
}

.badge-before {
  left: 16px;
}

.badge-after {
  right: 16px;
}

/* --- INTERACTIVE CALCULATOR STYLES --- */
.calc-range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #E5E7EB;
  outline: none;
}

.calc-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-orange);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease;
}

.calc-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

/* --- VIRTUAL ASSISTANT CHAT WIDGET --- */
.kts-chat-widget {
  position: fixed;
  bottom: 96px;
  left: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: translateY(100px) scale(0.8);
  opacity: 0;
  pointer-events: none;
}

.kts-chat-widget.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.kts-avatar-container {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 3px solid white;
  background-color: var(--brand-cream);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.kts-avatar-container:hover {
  transform: scale(1.05);
}

.kts-online-dot {
  position: absolute;
  bottom: 0px;
  right: 2px;
  width: 12px;
  height: 12px;
  background-color: #22C55E;
  border: 2px solid white;
  border-radius: 50%;
  z-index: 10;
}

.kts-chat-bubble {
  background-color: white;
  color: var(--brand-brown);
  padding: 12px 16px;
  border-radius: 1rem 1rem 1rem 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  max-width: 250px;
  font-size: 0.825rem;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid rgba(0, 0, 0, 0.04);
  position: relative;
}

.kts-chat-bubble::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -8px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 8px 8px 0;
  border-color: transparent white transparent transparent;
}

/* --- SCROLL PROGRESS BAR --- */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-orange-light), var(--brand-orange-dark));
  z-index: 9999;
  transition: width 0.05s linear;
  box-shadow: 0 0 8px rgba(244, 138, 31, 0.4);
}

/* --- FADE-IN ANIMATION --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

/* --- SCROLL-TRIGGERED ANIMATIONS --- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* --- RESPONSIVE TWEAKS --- */
@media (max-width: 768px) {
  .kts-chat-widget {
    bottom: 80px;
    left: 12px;
  }
  
  .kts-chat-bubble {
    max-width: 200px;
    font-size: 0.75rem;
  }
  
  .floating-contact {
    bottom: 16px;
    right: 16px;
  }
  
  .floating-btn {
    width: 48px;
    height: 48px;
  }
}

/* --- REUSABLE DYNAMIC BEFORE-AFTER SLIDER CLASS --- */
.before-after-slider {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.slider-after-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.slider-overlay {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  overflow: hidden;
  z-index: 10;
}

.slider-before-img {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  object-fit: cover;
  max-width: none;
}

.slider-range {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 30;
}

.slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: white;
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}
