/* Interactive Chatbot Styles */

/* Quick Reply Buttons */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 12px 40px; /* Aligned with bot messages */
    animation: fadeIn 0.3s ease-out;
  }
  
  .quick-reply-btn {
    background-color: #f0f7ff;
    border: 1px solid #2563eb;
    color: #2563eb;
    border-radius: 18px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
  }
  
  .quick-reply-btn:hover {
    background-color: #2563eb;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
  }
  
  body:not(.theme-light) .quick-reply-btn {
    background-color: rgba(37, 99, 235, 0.1);
    border-color: #60a5fa;
    color: #60a5fa;
  }
  
  body:not(.theme-light) .quick-reply-btn:hover {
    background-color: #2563eb;
    color: white;
  }
  
  /* Typing Indicator Animation */
  .typing-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 20px;
    padding: 0 8px;
  }
  
  .typing-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #2563eb;
    border-radius: 50%;
    opacity: 0.6;
    animation: typingBounce 1.4s infinite ease-in-out both;
  }
  
  .typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
  }
  
  .typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
  }
  
  @keyframes typingBounce {
    0%, 80%, 100% { 
      transform: scale(0.6);
    }
    40% { 
      transform: scale(1);
      opacity: 1;
    }
  }
  
  body:not(.theme-light) .typing-dots span {
    background-color: #60a5fa;
  }
  
  /* Interactive Calculator Styles */
  .calculator-bubble {
    padding: 12px !important;
  }
  
  .chatbot-calculator {
    background-color: rgba(240, 247, 255, 0.7);
    border-radius: 12px;
    padding: 16px;
    margin-top: 8px;
    font-size: 14px;
  }
  
  body:not(.theme-light) .chatbot-calculator {
    background-color: rgba(17, 24, 39, 0.8);
  }
  
  .chatbot-calculator h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #2563eb;
    font-weight: 600;
  }
  
  body:not(.theme-light) .chatbot-calculator h4 {
    color: #60a5fa;
  }
  
  .calc-input-group {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  
  .calc-input-group label {
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
  }
  
  body:not(.theme-light) .calc-input-group label {
    color: #d1d5db;
  }
  
  .calc-input-group input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
    color: #1f2937;
  }
  
  body:not(.theme-light) .calc-input-group input {
    background-color: #374151;
    border-color: #4b5563;
    color: #f9fafb;
  }
  
  .chat-calc-btn {
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 4px;
    transition: all 0.2s;
  }
  
  .chat-calc-btn:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
  }
  
  .chat-calc-result {
    margin-top: 12px;
    background-color: rgba(255, 255, 255, 0.7);
    border-left: 3px solid #10b981;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
  }
  
  body:not(.theme-light) .chat-calc-result {
    background-color: rgba(55, 65, 81, 0.7);
    border-left-color: #10b981;
  }
  
  .chat-calc-result p {
    margin: 6px 0;
  }
  
  /* Animations */
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Enhanced Message Styles */
  .message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }
  
  .bot-message .message-bubble {
    background-color: #f0f7ff;
    border-top-left-radius: 4px;
    color: #1f2937;
  }
  
  body:not(.theme-light) .bot-message .message-bubble {
    background-color: #1e3a8a;
    color: #f9fafb;
  }
  
  .user-message .message-bubble {
    background-color: #2563eb;
    color: white;
    border-top-right-radius: 4px;
  }
  
  body:not(.theme-light) .user-message .message-bubble {
    background-color: #3b82f6;
  }
  
  /* Bot and User Message Layout */
  .bot-message, .user-message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 8px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
  }
  
  .user-message {
    flex-direction: row-reverse;
    align-self: flex-end;
    margin-left: auto;
  }
  
  /* Notification Animation */
  .ai-notification {
    animation: bounceIn 0.6s ease-out;
  }
  
  @keyframes bounceIn {
    0% {
      opacity: 0;
      transform: scale(0.8) translateY(10px);
    }
    60% {
      transform: scale(1.05) translateY(-5px);
    }
    100% {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }
  
  /* Chat Avatar Styles */
  .message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e0e7ff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 16px;
  }
  
  body:not(.theme-light) .message-avatar {
    background-color: #312e81;
  }
  
  .user-message .message-avatar {
    background-color: #2563eb;
  }
  
  body:not(.theme-light) .user-message .message-avatar {
    background-color: #2563eb;
  }
  
  /* Chat input container */
  .chat-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(209, 213, 219, 0.5);
    background-color: rgba(255, 255, 255, 0.8);
  }
  
  body:not(.theme-light) .chat-input-container {
    background-color: rgba(31, 41, 55, 0.8);
    border-top-color: rgba(75, 85, 99, 0.5);
  }
  
  .chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    background-color: white;
    color: #1f2937;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  
  body:not(.theme-light) .chat-input {
    background-color: #374151;
    border-color: #4b5563;
    color: #f9fafb;
  }
  
  .chat-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
  }
  
  .chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #2563eb;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
  }
  
  .chat-send-btn:hover {
    background-color: #1d4ed8;
    transform: scale(1.05);
  }
  
  /* Circle chat icon */
  .chat-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    animation: pulse 2s infinite;
  }
  
  .chat-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
  }
  
  .chat-icon {
    font-size: 24px;
    color: white;
  }
  
  @keyframes pulse {
    0% {
      box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }
    70% {
      box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
  }
  
  /* Make chat more responsive */
  @media (max-width: 480px) {
    .quick-replies {
      margin-left: 20px;
    }
    
    .bot-message, .user-message {
      max-width: 90%;
    }
    
    .chatbot-calculator {
      padding: 12px;
    }
    
    .chat-circle {
      width: 50px;
      height: 50px;
    }
  }
  
  /* Shake animation for chat circle */
  .shake {
    animation: shake 0.8s cubic-bezier(.36,.07,.19,.97) both;
  }
  
  @keyframes shake {
    10%, 90% {
      transform: translate3d(-1px, 0, 0);
    }
    
    20%, 80% {
      transform: translate3d(2px, 0, 0);
    }
  
    30%, 50%, 70% {
      transform: translate3d(-4px, 0, 0);
    }
  
    40%, 60% {
      transform: translate3d(4px, 0, 0);
    }
  }

/* Clean rebuild light-mode compatibility */
body.theme-light .quick-reply-btn { background-color: #f0f7ff; border-color: #2563eb; color: #2563eb; }
body.theme-light .quick-reply-btn:hover { background-color: #2563eb; color: white; }
