/* ====================================
   Emergency Contact Button (Fixed)
   ==================================== */
.emergency-contact-btn {
  position: fixed;
  right: 24px;
  bottom: 160px;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.emergency-contact-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

.emergency-contact-btn:active {
  transform: translateY(-1px) scale(1);
}

/* Ripple Effect */
.emergency-contact-btn::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.emergency-contact-btn:active::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* Tooltip using title attribute (browser default) */

.emergency-icon {
  font-size: 28px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.emergency-text {
  display: none;
}

.emergency-label {
  display: none;
}

.emergency-sublabel {
  display: none;
}

/* ====================================
   WhatsApp Chat Button
   ==================================== */
.whatsapp-chat-btn {
  position: fixed;
  right: 24px;
  bottom: 88px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: white;
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.whatsapp-chat-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
}

.whatsapp-chat-btn:active {
  transform: translateY(-1px) scale(1);
}

/* Tooltip using title attribute (browser default) */

.whatsapp-icon {
  font-size: 32px;
}

.whatsapp-text {
  display: none;
}

.whatsapp-label {
  display: none;
}

.whatsapp-sublabel {
  display: none;
}

.whatsapp-sublabel {
  font-size: 9px;
  font-weight: 500;
  opacity: 0.9;
}

/* ====================================
   Emergency Contact Panel (Slide)
   ==================================== */
.emergency-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.emergency-panel.active {
  visibility: visible;
  opacity: 1;
}

.emergency-panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.emergency-panel-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 450px;
  max-width: 90%;
  height: 100%;
  background: white;
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.emergency-panel.active .emergency-panel-content {
  transform: translateX(0);
}

/* Panel Header */
.emergency-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  border-bottom: 3px solid #991b1b;
}

.emergency-panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.emergency-panel-title i {
  font-size: 28px;
}

.emergency-panel-title h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.emergency-panel-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
}

.emergency-panel-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Panel Body */
.emergency-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Emergency Info Card */
.emergency-info-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.emergency-info-icon {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
  font-size: 24px;
}

.emergency-info-text h4 {
  font-size: 18px;
  font-weight: 700;
  color: #92400e;
  margin: 0 0 8px 0;
}

.emergency-info-text p {
  font-size: 14px;
  color: #78350f;
  margin: 0;
  line-height: 1.5;
}

/* Contact Methods */
.emergency-contact-methods {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.emergency-contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.emergency-contact-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: all 0.3s ease;
}

.emergency-contact-card:hover {
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
  transform: translateX(-4px);
}

.emergency-contact-card:hover::before {
  background: #dc2626;
}

.emergency-contact-icon {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
}

.emergency-contact-icon.phone {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.emergency-contact-icon.whatsapp {
  background: linear-gradient(135deg, #25D366 0%, #20ba5a 100%);
}

.emergency-contact-icon.email {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.emergency-contact-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.emergency-contact-label {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.emergency-contact-value {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.emergency-contact-arrow {
  flex-shrink: 0;
  color: #9ca3af;
  font-size: 16px;
  transition: all 0.3s ease;
}

.emergency-contact-card:hover .emergency-contact-arrow {
  color: #dc2626;
  transform: translateX(4px);
}

/* Emergency Tips */
.emergency-tips {
  background: #f9fafb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.emergency-tips h5 {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.emergency-tips h5 i {
  color: #f59e0b;
}

.emergency-tips ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.emergency-tips li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #4b5563;
}

.emergency-tips li i {
  color: #10b981;
  font-size: 16px;
}

/* Emergency Hours */
.emergency-hours {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.emergency-hours-icon {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3b82f6;
  font-size: 24px;
}

.emergency-hours-text strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 4px;
}

.emergency-hours-text p {
  font-size: 14px;
  color: #1e3a8a;
  margin: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .emergency-contact-btn {
    width: 56px;
    height: 56px;
    right: 20px;
    bottom: 140px;
  }

  .emergency-contact-btn::before,
  .emergency-contact-btn::after {
    display: none;
  }

  .emergency-icon {
    font-size: 24px;
  }

  .whatsapp-chat-btn {
    width: 56px;
    height: 56px;
    right: 20px;
    bottom: 76px;
  }

  .whatsapp-chat-btn::before,
  .whatsapp-chat-btn::after {
    display: none;
  }

  .whatsapp-icon {
    font-size: 28px;
  }

  .emergency-panel-content {
    width: 100%;
    max-width: 100%;
  }

  .emergency-panel-header {
    padding: 20px;
  }

  .emergency-panel-title h3 {
    font-size: 20px;
  }

  .emergency-panel-body {
    padding: 20px;
  }

  .emergency-contact-card {
    padding: 16px;
  }
}

/* Smooth Scrollbar */
.emergency-panel-body::-webkit-scrollbar {
  width: 8px;
}

.emergency-panel-body::-webkit-scrollbar-track {
  background: #f3f4f6;
}

.emergency-panel-body::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.emergency-panel-body::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ====================================
   WhatsApp Chat Panel
   ==================================== */
.whatsapp-chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.whatsapp-chat-panel.active {
  visibility: visible;
  opacity: 1;
}

.whatsapp-chat-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.whatsapp-chat-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 90%;
  height: 100%;
  background: #ECE5DD;
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.whatsapp-chat-panel.active .whatsapp-chat-content {
  transform: translateX(0);
}

/* WhatsApp Header */
.whatsapp-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #075E54;
  color: white;
}

.whatsapp-chat-close {
  background: transparent;
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s ease;
}

.whatsapp-chat-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.whatsapp-chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366, #128C7E);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
}

.whatsapp-chat-info {
  flex: 1;
}

.whatsapp-chat-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.whatsapp-chat-status {
  font-size: 12px;
  opacity: 0.8;
}

/* WhatsApp Body */
.whatsapp-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48cGF0dGVybiBpZD0icGF0dGVybiIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48cGF0aCBkPSJNMjAgMjBMMjAgMjAiIHN0cm9rZT0iI2QxZDFkMSIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIi8+PC9wYXR0ZXJuPjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI3BhdHRlcm4pIi8+PC9zdmc+');
}

.whatsapp-welcome-message {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 16px;
}

.whatsapp-message-bubble {
  background: white;
  padding: 12px 14px;
  border-radius: 8px;
  max-width: 85%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
}

.whatsapp-message-bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 12px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 8px 8px 0;
  border-color: transparent white transparent transparent;
}

.whatsapp-message-text {
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  margin-bottom: 4px;
}

.whatsapp-message-time {
  font-size: 11px;
  color: #667781;
  text-align: right;
}

/* WhatsApp Footer */
.whatsapp-chat-footer {
  padding: 12px 16px;
  background: #F0F0F0;
  border-top: 1px solid #DDD;
}

.whatsapp-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border-radius: 24px;
  padding: 8px 16px;
}

.whatsapp-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  background: transparent;
}

.whatsapp-input::placeholder {
  color: #999;
}

.whatsapp-send-btn {
  background: #25D366;
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.whatsapp-send-btn:hover {
  background: #128C7E;
  transform: scale(1.05);
}

.whatsapp-send-btn:active {
  transform: scale(0.95);
}

/* WhatsApp Scrollbar */
.whatsapp-chat-body::-webkit-scrollbar {
  width: 6px;
}

.whatsapp-chat-body::-webkit-scrollbar-track {
  background: #ECE5DD;
}

.whatsapp-chat-body::-webkit-scrollbar-thumb {
  background: #B3B3B3;
  border-radius: 3px;
}

.whatsapp-chat-body::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Mobile Responsive - WhatsApp Panel */
@media (max-width: 768px) {
  .whatsapp-chat-content {
    width: 100%;
    max-width: 100%;
  }

  .whatsapp-chat-header {
    padding: 14px;
  }

  .whatsapp-chat-body {
    padding: 16px;
  }
}

/* Hide emergency and WhatsApp buttons on mobile (991px and below) */
@media (max-width: 991px) {
  .emergency-contact-btn,
  .whatsapp-btn,
  .whatsapp-chat-btn {
    display: none !important;
  }
}
