/**
 * Turix Rental - Assistance (Modern Minimalist Concierge Widget)
 * Glassmorphism, Luxury Boutique Aesthetic, Responsive
 */

:root {
  --tx-primary-wine: #800000;
  --tx-primary-wine-dark: #4c0a03;
  --tx-terracotta: #c05621;
  --tx-emerald: #15803d;
  --tx-emerald-glow: rgba(34, 197, 94, 0.4);
  --tx-glass-bg: rgba(255, 255, 255, 0.82);
  --tx-glass-border: rgba(255, 255, 255, 0.55);
  --tx-text-main: #1f2937;
  --tx-text-muted: #64748b;
  --tx-shadow-elevated: 0 20px 45px rgba(15, 23, 42, 0.18), 0 8px 16px rgba(15, 23, 42, 0.08);
}

/* Floating Trigger Button */
.tx-floating-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99998;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 50px;
  box-shadow: 0 10px 25px rgba(18, 140, 126, 0.35);
  cursor: pointer;
  border: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none !important;
}

.tx-floating-trigger:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 30px rgba(18, 140, 126, 0.45);
  color: #ffffff;
}

.tx-floating-trigger i {
  font-size: 20px;
}

/* Pulse animation dot */
.tx-pulse-dot {
  width: 9px;
  height: 9px;
  background-color: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 var(--tx-emerald-glow);
  animation: txPulse 2s infinite;
}

@keyframes txPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Modal Overlay Backdrop */
.tx-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tx-modal-overlay.tx-visible {
  opacity: 1;
  visibility: visible;
}

/* Glassmorphism Concierge Card (Aislado dentro de .tx-modal-overlay) */
.tx-modal-overlay .tx-card,
.tx-assistant-card {
  width: 100%;
  max-width: 460px;
  background: var(--tx-glass-bg);
  border: 1px solid var(--tx-glass-border);
  border-radius: 24px;
  box-shadow: var(--tx-shadow-elevated);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 26px 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--tx-text-main);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.tx-modal-overlay.tx-visible .tx-card,
.tx-modal-overlay.tx-visible .tx-assistant-card {
  transform: translateY(0) scale(1);
}

/* Top Header Bar */
.tx-modal-overlay .tx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  padding-bottom: 14px;
}

.tx-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tx-status-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #15803d;
  background: rgba(220, 252, 231, 0.85);
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tx-title {
  font-family: 'Playfair Display', Georgia, serif, -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  letter-spacing: -0.2px;
}

.tx-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Language Switch Pill */
.tx-lang-switch {
  display: flex;
  background: rgba(241, 245, 249, 0.9);
  padding: 2px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
}

.tx-lang-btn {
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  padding: 3px 8px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tx-lang-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.tx-close-btn {
  background: rgba(241, 245, 249, 0.8);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}

.tx-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Hero Experience Copy */
.tx-modal-overlay .tx-hero-copy {
  margin-bottom: 22px;
}

.tx-modal-overlay .tx-headline {
  font-family: 'Playfair Display', Georgia, serif, -apple-system, sans-serif;
  font-size: 21px;
  line-height: 1.35;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 6px 0;
}

.tx-modal-overlay .tx-subheadline {
  font-size: 13.5px;
  color: var(--tx-text-muted);
  margin: 0;
  font-weight: 400;
  line-height: 1.45;
}

/* 2x2 Grid of Actions */
.tx-modal-overlay .tx-grid-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.tx-modal-overlay .tx-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 3px 8px rgba(0,0,0,0.04);
  text-align: center;
}

.tx-modal-overlay .tx-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.09);
}

/* Button Variants */
.tx-modal-overlay .tx-btn-today {
  background: #15803d;
  color: #ffffff !important;
}
.tx-modal-overlay .tx-btn-today:hover {
  background: #166534;
}

.tx-modal-overlay .tx-btn-booking {
  background: #ffffff;
  color: #1e293b !important;
  border-color: #e2e8f0;
}
.tx-modal-overlay .tx-btn-booking:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.tx-modal-overlay .tx-btn-scooter {
  background: #c05621;
  color: #ffffff !important;
}
.tx-modal-overlay .tx-btn-scooter:hover {
  background: #9c4215;
}

.tx-modal-overlay .tx-btn-car {
  background: #800000;
  background: linear-gradient(135deg, #4c0a03 0%, #800000 100%);
  color: #ffffff !important;
}
.tx-modal-overlay .tx-btn-car:hover {
  background: #660000;
}

/* Bottom Input Bar for Free Text */
.tx-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 4px 6px 4px 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tx-input-wrapper:focus-within {
  border-color: var(--tx-terracotta);
  box-shadow: 0 0 0 3px rgba(192, 86, 33, 0.15);
}

.tx-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  color: #1e293b;
  background: transparent;
  padding: 8px 0;
}

.tx-input::placeholder {
  color: #94a3b8;
}

.tx-send-btn {
  background: var(--tx-terracotta);
  color: #ffffff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.tx-send-btn:hover {
  background: #9c4215;
  transform: scale(1.05);
}

/* Drag handle for mobile */
.tx-drag-handle {
  display: none;
  width: 44px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 10px;
  margin: 0 auto 14px auto;
}

/* Mobile Responsiveness (Native Bottom Sheet Experience) */
@media (max-width: 768px) {
  .tx-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .tx-modal-overlay .tx-card,
  .tx-modal-overlay .tx-assistant-card {
    width: 100%;
    max-width: 100%;
    border-radius: 28px 28px 0 0;
    max-height: 85vh;
    max-height: 85dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 20px calc(24px + env(safe-area-inset-bottom, 16px)) 20px;
    margin: 0;
    box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.25);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .tx-modal-overlay.tx-visible .tx-card,
  .tx-modal-overlay.tx-visible .tx-assistant-card {
    transform: translateY(0);
  }

  .tx-modal-overlay .tx-drag-handle {
    display: block;
  }

  .tx-modal-overlay .tx-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .tx-modal-overlay .tx-title {
    font-size: 16px;
  }

  .tx-modal-overlay .tx-hero-copy {
    margin-bottom: 18px;
  }

  .tx-modal-overlay .tx-headline {
    font-size: 19px;
  }

  .tx-modal-overlay .tx-subheadline {
    font-size: 13px;
  }

  .tx-modal-overlay .tx-grid-buttons {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
    margin-bottom: 18px;
  }

  .tx-modal-overlay .tx-btn {
    width: 100%;
    min-height: 50px;
    padding: 14px 18px;
    font-size: 15px;
    border-radius: 14px;
    justify-content: flex-start;
    text-align: left;
  }

  .tx-modal-overlay .tx-input-wrapper {
    min-height: 48px;
    border-radius: 14px;
    margin-bottom: 8px;
  }

  .tx-modal-overlay .tx-input {
    font-size: 15px;
  }

  .tx-floating-trigger {
    bottom: 20px;
    right: 16px;
    padding: 10px 16px;
    font-size: 13px;
  }
}
