/* ============================================================
   AI CHATBOT WIDGET
   ============================================================ */

.df-chatbot {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9000;
  font-family: var(--font-body);
}

/* ── Toggle Button ───────────────────────────────────────── */
.df-chatbot__toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-navy), #0d2847);
  border: 2px solid var(--color-gold);
  color: var(--color-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(11,31,58,0.4), 0 0 0 0 rgba(201,166,70,0.4);
  transition: all var(--transition-base);
  animation: pulse-gold 3s ease-in-out infinite;
}

.df-chatbot__toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(11,31,58,0.5), var(--shadow-gold);
}

.df-chatbot__toggle svg {
  width: 26px;
  height: 26px;
  transition: transform var(--transition-base);
}

.df-chatbot__toggle.open svg.icon-chat {
  display: none;
}

.df-chatbot__toggle .icon-close {
  display: none;
}

.df-chatbot__toggle.open .icon-close {
  display: block;
}

.df-chatbot__toggle.open .icon-chat {
  display: none;
}

/* Notification dot */
.df-chatbot__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: var(--color-gold);
  border-radius: 50%;
  border: 2px solid var(--color-white);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--color-navy);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Chat Window ─────────────────────────────────────────── */
.df-chatbot__window {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 360px;
  height: 520px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.df-chatbot__window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header */
.df-chatbot__header {
  background: linear-gradient(135deg, var(--color-navy), #0d2847);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.df-chatbot__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(201,166,70,0.15);
  border: 1.5px solid rgba(201,166,70,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold);
  flex-shrink: 0;
}

.df-chatbot__avatar svg {
  width: 20px;
  height: 20px;
}

.df-chatbot__header-info {
  flex: 1;
}

.df-chatbot__name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-white);
  margin-bottom: 0.1rem;
}

.df-chatbot__status {
  font-size: 0.72rem;
  color: rgba(247,247,245,0.6);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.df-chatbot__status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  display: block;
}

/* Messages */
.df-chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
}

.df-chatbot__messages::-webkit-scrollbar {
  width: 4px;
}

.df-chatbot__messages::-webkit-scrollbar-track {
  background: transparent;
}

.df-chatbot__messages::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

.df-msg {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  max-width: 85%;
}

.df-msg--bot {
  align-self: flex-start;
}

.df-msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.df-msg__bubble {
  padding: 0.65rem 1rem;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.55;
}

.df-msg--bot .df-msg__bubble {
  background: var(--color-offwhite);
  color: var(--color-charcoal);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--color-border);
}

.df-msg--user .df-msg__bubble {
  background: var(--color-navy);
  color: var(--color-white);
  border-bottom-right-radius: 4px;
}

.df-msg__time {
  font-size: 0.65rem;
  color: var(--color-slate-light);
  margin-top: 0.2rem;
  text-align: center;
}

/* Typing indicator */
.df-typing {
  display: flex;
  gap: 4px;
  padding: 0.75rem 1rem;
  background: var(--color-offwhite);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--color-border);
  width: fit-content;
}

.df-typing span {
  width: 7px;
  height: 7px;
  background: var(--color-slate-light);
  border-radius: 50%;
  animation: typingDot 1.4s ease-in-out infinite;
}

.df-typing span:nth-child(2) { animation-delay: 0.2s; }
.df-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%            { transform: translateY(-6px); opacity: 1; }
}

/* Quick replies */
.df-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.5rem;
}

.df-quick-reply {
  padding: 0.35rem 0.85rem;
  background: transparent;
  border: 1px solid rgba(201,166,70,0.4);
  border-radius: 100px;
  font-size: 0.78rem;
  color: var(--color-gold-dark);
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: var(--font-body);
}

.df-quick-reply:hover {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: var(--color-navy);
}

/* Input */
.df-chatbot__input-wrap {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
  background: var(--color-white);
}

.df-chatbot__input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--color-border);
  border-radius: 100px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition-base);
  background: var(--color-offwhite);
  color: var(--color-charcoal);
}

.df-chatbot__input:focus {
  border-color: var(--color-gold);
}

.df-chatbot__send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-navy);
  border: none;
  color: var(--color-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.df-chatbot__send:hover {
  background: var(--color-gold);
  color: var(--color-navy);
}

.df-chatbot__send svg {
  width: 16px;
  height: 16px;
}

/* ============================================================
   APPOINTMENT CALENDAR MODAL
   ============================================================ */

.df-calendar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,31,58,0.85);
  backdrop-filter: blur(6px);
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.df-calendar-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.df-calendar-modal {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition-base);
}

.df-calendar-overlay.open .df-calendar-modal {
  transform: scale(1) translateY(0);
}

.df-calendar-modal::-webkit-scrollbar {
  width: 4px;
}

.df-calendar-modal::-webkit-scrollbar-thumb {
  background: var(--color-border);
}

.df-cal__header {
  background: linear-gradient(135deg, var(--color-navy), #0d2847);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.df-cal__header h3 {
  color: var(--color-white);
  margin: 0;
  font-size: 1.2rem;
}

.df-cal__close {
  background: none;
  border: none;
  color: rgba(247,247,245,0.7);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition-base);
}

.df-cal__close:hover {
  color: var(--color-gold);
}

.df-cal__body {
  padding: var(--space-lg);
}

.df-cal__steps {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.df-cal__step {
  flex: 1;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-slate-light);
  background: var(--color-offwhite);
  border-right: 1px solid var(--color-border);
  transition: all var(--transition-base);
}

.df-cal__step:last-child {
  border-right: none;
}

.df-cal__step.active {
  background: var(--color-navy);
  color: var(--color-gold);
}

.df-cal__step.done {
  background: rgba(201,166,70,0.1);
  color: var(--color-gold-dark);
}

/* Calendar grid */
.df-cal__month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.df-cal__month-nav button {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: var(--color-slate);
  font-size: 1rem;
  transition: all var(--transition-base);
}

.df-cal__month-nav button:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.df-cal__month-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-navy);
}

.df-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: var(--space-md);
}

.df-cal__day-name {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-slate-light);
  padding: 0.4rem 0;
}

.df-cal__day {
  text-align: center;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-base);
  color: var(--color-charcoal);
  border: 1px solid transparent;
}

.df-cal__day:hover:not(.disabled):not(.empty) {
  background: rgba(201,166,70,0.1);
  border-color: rgba(201,166,70,0.3);
  color: var(--color-gold-dark);
}

.df-cal__day.selected {
  background: var(--color-navy);
  color: var(--color-gold);
  border-color: var(--color-gold);
  font-weight: 700;
}

.df-cal__day.today {
  border-color: var(--color-gold);
  font-weight: 700;
}

.df-cal__day.disabled {
  color: var(--color-border);
  cursor: not-allowed;
}

.df-cal__day.empty {
  cursor: default;
}

/* Time slots */
.df-cal__time-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.df-cal__time-slot {
  padding: 0.6rem;
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-base);
  color: var(--color-charcoal);
}

.df-cal__time-slot:hover {
  border-color: var(--color-gold);
  color: var(--color-gold-dark);
  background: rgba(201,166,70,0.05);
}

.df-cal__time-slot.selected {
  background: var(--color-navy);
  border-color: var(--color-gold);
  color: var(--color-gold);
  font-weight: 600;
}

.df-cal__section-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-slate);
  margin-bottom: 0.75rem;
}

.df-cal__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .df-chatbot__window {
    width: calc(100vw - 2rem);
    right: -0.5rem;
    height: 480px;
  }

  .df-chatbot {
    bottom: 1.25rem;
    right: 1.25rem;
  }

  .df-cal__time-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
