/* Floating Support Button */
.support-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: #000080; /* Navy blue to match website theme */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
}

.support-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

/* Base styling for social icons */
.social-icons-left, 
.social-icons-right {
  z-index: 900;
  position: fixed;
  transition: z-index 0.1s;
}

/* Chat Container */
.chat-container {
  display: none;
  position: fixed;
  bottom: 100px;
  right: 10px;
  width: 360px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  z-index: 99999; /* Super high z-index */
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  font-family: 'Poppins', 'Segoe UI', sans-serif; /* Match website font */
  overflow: hidden;
  max-height: calc(100vh - 120px); /* Prevent overflow on small screens */
}

.chat-container.active {
  display: block; 
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* When chatbot is open, force social icons to stay behind */
body.chat-open .social-icons-left,
body.chat-open .social-icons-right {
  z-index: 0 !important;
}

/* Remove the overlay */
.chat-overlay {
  display: none !important;
}

/* Header - Updated to match website navy blue theme */
.chat-header {
  background: #000080; /* Navy blue to match website header */
  color: white;
  padding: 15px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 100001; /* Ensure header is on top */
}

.header-text {
  display: flex;
  flex-direction: column; /* Stack vertically on small screens */
  align-items: flex-start;
}

.chat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px; /* Prevent long titles from overflowing */
}

.online-status {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 8px;
  border-radius: 12px;
  margin-left: 0;
  margin-top: 5px;
}

.close-chat {
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: white;
  padding: 0;
  margin-left: 10px;
  flex-shrink: 0;
}

/* Profile icon styling - Updated to match website navy blue theme */
.profile-icon {
  width: 70px;
  height: 70px;
  background-color: #000080; /* Navy blue to match website */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 100001; /* Ensure on top */
}

.profile-icon i {
  font-size: 40px;
  color: white;
}

/* Facebook icon styling */
.facebook-icon {
  width: 70px;
  height: 70px;
  background-color: #1877F2;
  border-radius: 20px; /* Rounded square like in the image */
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 25px; /* Position to the left like in the image */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 100001; /* Ensure on top */
}

.facebook-icon i {
  font-size: 40px;
  color: white;
}

/* Time */
.chat-time {
  text-align: center;
  color: #666;
  font-size: 12px;
  padding: 10px 0;
  margin-top: 5px;
  position: relative;
  z-index: 100001; /* Ensure on top */
}

/* Chat Content */
.chat-content {
  padding: 0 15px;
  position: relative;
  z-index: 100001; /* Ensure on top */
  max-height: 40vh; /* Limit height on small screens */
  overflow-y: auto; /* Allow scrolling if content is too long */
}

.chat-message {
  padding: 15px;
  margin: 5px 0;
  border-radius: 18px;
  background: #f0f0f0;
  color: #333;
  line-height: 1.5;
  position: relative;
  display: inline-block;
  text-align: left;
  max-width: 90%;
  word-wrap: break-word; /* Ensure long words don't overflow */
}

.message-text {
  font-size: 15px;
}

.chat-message strong {
  font-weight: 600;
  color: #000;
}

/* Button Styles - Updated to match modal section colors */
.contact-buttons {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 15px 15px 20px;
  width: 100%;
  box-sizing: border-box;
  gap: 10px;
  position: relative;
  z-index: 100001; /* Ensure on top */
}

.contact-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 0;
  border-radius: 50px; /* More rounded like in the image */
  text-decoration: none;
  transition: all 0.3s ease;
  color: white; /* Text color set to white */
  font-weight: 500;
  font-size: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  min-width: 0;
  text-align: center;
  gap: 8px; /* Space between icon and text */
}

/* WhatsApp button styling - Updated to match modal section */
.contact-btn.whatsapp {
  background: linear-gradient(to bottom right, #25D366, #20ba57);
}

.contact-btn.whatsapp:hover {
  background: linear-gradient(to bottom right, #28E76A, #25D366);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4);
}

/* Telegram button styling - Updated to match modal section */
.contact-btn.telegram {
  background: linear-gradient(to bottom right, #0088cc, #0077b3);
}

.contact-btn.telegram:hover {
  background: linear-gradient(to bottom right, #0099dd, #0088cc);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 136, 204, 0.4);
}

/* WhatsApp icon */
.contact-btn.whatsapp::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.45 2.13 11.91C2.13 13.66 2.59 15.36 3.45 16.86L2.05 22L7.3 20.62C8.75 21.41 10.38 21.83 12.04 21.83C17.5 21.83 21.95 17.38 21.95 11.92C21.95 9.27 20.92 6.78 19.05 4.91C17.18 3.03 14.69 2 12.04 2M12.05 3.67C14.25 3.67 16.31 4.53 17.87 6.09C19.42 7.65 20.28 9.72 20.28 11.92C20.28 16.46 16.58 20.15 12.04 20.15C10.56 20.15 9.11 19.76 7.85 19L7.55 18.83L4.43 19.65L5.26 16.61L5.06 16.29C4.24 15 3.8 13.47 3.8 11.91C3.81 7.37 7.5 3.67 12.05 3.67M8.53 7.33C8.37 7.33 8.1 7.39 7.87 7.64C7.65 7.89 7 8.5 7 9.71C7 10.93 7.89 12.1 8 12.27C8.14 12.44 9.76 14.94 12.25 16C12.84 16.27 13.3 16.42 13.66 16.53C14.25 16.72 14.79 16.69 15.22 16.63C15.7 16.56 16.68 16.03 16.89 15.45C17.1 14.87 17.1 14.38 17.04 14.27C16.97 14.17 16.81 14.11 16.56 14C16.31 13.86 15.09 13.26 14.87 13.18C14.64 13.1 14.5 13.06 14.31 13.3C14.15 13.55 13.67 14.11 13.53 14.27C13.38 14.44 13.24 14.46 13 14.34C12.74 14.21 11.94 13.95 11 13.11C10.26 12.45 9.77 11.64 9.62 11.39C9.5 11.15 9.61 11 9.73 10.89C9.84 10.78 10 10.6 10.1 10.45C10.23 10.31 10.27 10.2 10.35 10.04C10.43 9.87 10.39 9.73 10.33 9.61C10.27 9.5 9.77 8.26 9.56 7.77C9.36 7.29 9.16 7.35 9 7.34C8.86 7.34 8.7 7.33 8.53 7.33Z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: 8px;
  vertical-align: middle;
}

/* Telegram icon */
.contact-btn.telegram::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9.78,18.65L10.06,14.42L17.74,7.5C18.08,7.19 17.67,7.04 17.22,7.31L7.74,13.3L3.64,12C2.76,11.75 2.75,11.14 3.84,10.7L19.81,4.54C20.54,4.21 21.24,4.72 20.96,5.84L18.24,18.65C18.05,19.56 17.5,19.78 16.74,19.36L12.6,16.3L10.61,18.23C10.38,18.46 10.19,18.65 9.78,18.65Z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: 8px;
  vertical-align: middle;
}

/* Enhanced Responsive Styling */

/* Large Desktop Screens */
@media (min-width: 1600px) {
  .support-button {
    bottom: 40px;
    left: 40px;
    width: 70px;
    height: 70px;
    font-size: 28px;
  }
  
  .chat-container {
    bottom: 120px;
    left: 20px;
    width: 400px;
  }
}

/* Standard Desktop */
@media (max-width: 1200px) {
  .chat-container {
    max-height: calc(100vh - 150px);
  }
}

/* Tablet Landscape */
@media (max-width: 992px) {
  .support-button {
    bottom: 25px;
    left: 25px;
    width: 55px;
    height: 55px;
    font-size: 22px;
  }
  
  .chat-container {
    bottom: 90px;
  }
}

/* Tablet Portrait */
@media (max-width: 768px) {
  .support-button {
    bottom: 20px;
    left: 20px;
  }
  
  .chat-container {
    bottom: 85px;
    left: 5px;
    width: 350px;
  }
  
  .profile-icon, .facebook-icon {
    width: 60px;
    height: 60px;
  }
  
  .profile-icon i, .facebook-icon i {
    font-size: 35px;
  }
}

/* Mobile Landscape */
@media (max-width: 576px) {
  .support-button {
    bottom: 15px;
    left: 15px;
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
  
  .chat-container {
    width: 330px;
    bottom: 75px;
    left: 5px;
    max-height: 80vh;
  }
  
  .chat-header h3 {
    font-size: 15px;
    max-width: 200px;
  }
  
  .online-status {
    font-size: 11px;
  }
  
  .contact-btn {
    padding: 12px 0;
  }
}

/* Mobile Portrait */
@media (max-width: 480px) {
  .chat-container {
    width: calc(100% - 20px); /* Full width minus margins */
    left: 10px;
    right: 10px;
    bottom: 70px;
  }
  
  .chat-content {
    max-height: 35vh;
  }
  
  .contact-buttons {
    padding: 10px 10px 15px;
    gap: 8px;
  }
  
  .contact-btn {
    padding: 12px 0;
    font-size: 14px;
  }
  
  .header-text {
    max-width: calc(100% - 30px);
  }
  
  /* Stack header items on very small screens */
  .chat-header {
    padding: 10px;
  }
  
  .profile-icon, .facebook-icon {
    width: 50px;
    height: 50px;
    margin: 8px auto;
  }
  
  .profile-icon i, .facebook-icon i {
    font-size: 30px;
  }
}

/* Very Small Mobile Screens */
@media (max-width: 380px) {
  .support-button {
    bottom: 10px;
    left: 10px;
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
  
  .chat-container {
    bottom: 65px;
  }
  
  .contact-btn {
    font-size: 13px;
    padding: 10px 0;
  }
  
  .chat-message {
    padding: 12px;
  }
  
  .message-text {
    font-size: 14px;
  }
  
  .chat-header h3 {
    font-size: 14px;
    max-width: 180px;
  }
}

/* Extra Small Screens */
@media (max-width: 320px) {
  .chat-container {
    width: calc(100% - 10px);
    left: 5px;
    right: 5px;
  }
  
  .contact-buttons {
    flex-direction: column; /* Stack buttons on extremely small screens */
    gap: 5px;
  }
  
  .contact-btn {
    width: 100%;
  }
  
  .chat-header h3 {
    max-width: 150px;
  }
  
  .online-status {
    padding: 2px 6px;
    margin-top: 3px;
  }
}

/* Handle Landscape Orientation on Mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .support-button {
    bottom: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .chat-container {
    bottom: 60px;
    max-height: 80vh;
    width: 300px;
  }
  
  .profile-icon, .facebook-icon {
    width: 45px;
    height: 45px;
    margin: 5px auto;
  }
  
  .profile-icon i, .facebook-icon i {
    font-size: 25px;
  }
  
  .chat-content {
    max-height: 30vh;
  }
}

/* Mobile Optimization for Chatbot - Added 2025-05-31 */
@media screen and (max-width: 768px) {
  /* Make support button visible on mobile */
  .support-button {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 20px;
    z-index: 999; /* Ensure it's above other elements */
    display: flex !important; /* Force display */
  }
  
  /* Adjust chat container for mobile */
  .chat-container {
    width: 90% !important; /* Width relative to screen */
    max-width: 350px;
    right: 5% !important;
    bottom: 80px !important; /* Position above the support button */
    max-height: 70vh !important; /* Limit height */
  }
  
  /* Make sure chat content is scrollable */
  .chat-content {
    max-height: 40vh;
    overflow-y: auto;
  }
}