/**
* Template Name: Arsha - v4.3.0
* Template URL: https://bootstrapmade.com/arsha-free-bootstrap-html-template-corporate/
* Author: BootstrapMade.com
* License: https://bootstrapmade.com/license/
*/

/*--------------------------------------------------------------
# General
--------------------------------------------------------------*/





/* Chatbot Container */
.chatbot-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2));
}

/* Chatbox */
.chatbox {
  display: none;
  width: 480px;
  height: 70vh;           /* 80% of viewport height on larger screens */
  min-height: 400px;      /* Minimum height for usability */
  background: rgba(255,255,255,0.97);
  border-radius: 25px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  display: flex;          /* Enable flex for internal layout */
  flex-direction: column;
  position: absolute;
  bottom: 100px;
  right: 30px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.3);
  transform-origin: bottom right; /* Adjusted for better animation */
  overflow: hidden;
}

.chatbox::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.05) 0px,
    rgba(255,255,255,0.05) 1px,
    transparent 1px,
    transparent 4px
  );
  pointer-events: none;
}

/* Chatbox Header */
.chatbox-header {
  background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
  color: white;
  padding: 18px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.chatbox-header::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(180deg, rgba(102,126,234,0.3) 0%, transparent 100%);
}

.chatbox-header span {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.chatbox-header button {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbox-header button:hover {
  background: rgba(255,255,255,0.25);
  transform: rotate(90deg) scale(1.1);
}

/* Chatbox Body */
.chatbox-body {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: rgba(245,247,250,0.6);
}

/* Message Styles */
.message {
  margin: 5px 0;
  padding: 14px 18px;
  border-radius: 18px;
  max-width: 85%;
  font-size: 15px;
  line-height: 1.5;
  position: relative;
  animation: messageFloat 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes messageFloat {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.bot-message {
  background: #FFFFFF;
  color: #2D3748;
  align-self: flex-start;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.05);
}

.bot-message ul, .bot-message ol {
  padding-left: 20px;
  margin: 10px 0;
}

.bot-message li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.bot-message strong {
  font-weight: 700;
  color: #4A5568;
}

.bot-message em {
  font-style: italic;
  color: #718096;
}

.bot-message code {
  background: #EDF2F7;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
  color: #E53E3E;
}

.bot-message pre {
  background: #2D3748;
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  margin: 10px 0;
}

.user-message {
  background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
  color: white;
  align-self: flex-end;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Chatbox Footer */
.chatbox-footer {
  padding: 18px;
  display: flex;
  gap: 12px;
  background: rgba(255,255,255,0.9);
  border-top: 1px solid rgba(0,0,0,0.08);
}

.chatbox-footer input {
  flex-grow: 1;
  padding: 12px 20px;
  border: 2px solid rgba(102,126,234,0.3);
  border-radius: 15px;
  font-size: 15px;
  transition: all 0.3s ease;
  background: rgba(255,255,255,0.9);
}

.chatbox-footer input:focus {
  outline: none;
  border-color: #667EEA;
  box-shadow: 0 0 0 4px rgba(102,126,234,0.15);
}

.chatbox-footer button {
  background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 15px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 3px;
}

.chatbox-footer button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102,126,234,0.3);
}

/* Chatbot Icon */
.chatbot-icon {
  width: 90px;
  height: 90px;
  cursor: pointer;
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

.chatbot-icon::before {
  content: '';
  position: absolute;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle at 50% 0%, #7F00FF 0%, #00B4DB 100%);
  border-radius: 50%;
  top: -10%;
  left: -10%;
  opacity: 0.3;
  filter: blur(20px);
  animation: pulse 3s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.2); opacity: 0.2; }
}

.chatbot-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.2);
  background: linear-gradient(45deg, #667EEA, #764BA2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  position: relative;
}

.chatbot-icon:hover img {
  transform: scale(1.15) rotate(15deg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

/* Chatbot Message */
.chatbot-message {
  position: absolute;
  top: -60px;
  right: 90px;
  background: rgba(255,255,255,0.95);
  color: #2D3748;
  padding: 12px 20px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  animation: slideInOut 3s infinite;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.05);
  backdrop-filter: blur(4px);
}

@keyframes slideInOut {
  0%, 100% { 
    transform: translateX(-20px) rotate(-3deg);
    opacity: 0;
  }
  20%, 80% { 
    transform: translateX(0) rotate(0);
    opacity: 1;
  }
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 15px;
  background: rgba(255,255,255,0.9);
  border-radius: 15px;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  align-self: flex-start;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #667EEA;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

@keyframes typing {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Miscellaneous Styles */
.shadow {
  box-shadow: 0 0 15px 55px rgba(255, 255, 255, 0.8);
  transition: box-shadow 0.3s ease;
}

.shadow:hover {
  box-shadow: 0 0 25px 10px rgba(255, 255, 255, 1);
}

.img-fluid {
  max-width: 100%;
  height: auto;
}

.portfolio-info {
  position: relative;
  padding: 15px;
  text-align: left;
}

.details-link i {
  font-size: 34px;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
  .chatbox {
    width: 85vw;
    height: 70vh;
    min-height: 300px;
    bottom: 80px;
    right: 15px;
    border-radius: 20px;
  }

  .chatbot-container {
    bottom: 20px;
    right: 20px;
  }

  .chatbot-icon {
    width: 70px;
    height: 70px;
    animation: bounce 2.5s ease-in-out infinite;
  }

  .chatbot-icon::before {
    width: 110%;
    height: 110%;
    top: -5%;
    left: -5%;
  }

  .chatbot-message {
    top: -55px;
    right: 70px;
    padding: 10px 15px;
    font-size: 14px;
    border-radius: 15px;
  }
}

@media (max-width: 480px) {
  .chatbox {
    width: 85vw;
    height: 70vh;
    min-height: 250px;
    bottom: 70px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  }

  .chatbot-container {
    bottom: 15px;
    right: 15px;
  }

  .chatbot-icon {
    width: 60px;
    height: 60px;
    /* Bounce animation retained on mobile */
    animation: bounce 2s ease-in-out infinite;
  }

  .chatbot-icon::before {
    display: none;
  }

  .chatbot-icon:hover img {
    transform: scale(1.1);
    /* Keeping hover effect minimal on mobile */
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  }

  /* Adjusted chatbot-message for mobile */
  .chatbot-message {
    position: absolute;
    bottom: 60px; /* Positioned above the icon */
    /* left: 50%; */
    /* transform: translateX(-50%); */
    padding: 10px 15px;
    font-size: 14px;
    border-radius: 15px;
    animation: slideInOut 3s infinite;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.05);
    backdrop-filter: blur(4px);
    background: rgba(255,255,255,0.95);
    color: #2D3748;
  }

  .chatbox-header {
    padding: 15px 20px;
  }

  .chatbox-header span {
    font-size: 18px;
  }

  .chatbox-header button {
    width: 30px;
    height: 30px;
  }

  .chatbox-body {
    padding: 15px;
  }

  .message {
    padding: 10px 14px;
    font-size: 14px;
  }

  .chatbox-footer {
    padding: 15px;
  }

  .chatbox-footer input {
    padding: 10px 5px;
    font-size: 12px;
  }

  .chatbox-footer button {
    padding: 10px 15px;
  }
}
