/* ==========================================================================
   MODERN CROVEAXA AI CHATBOT UI
   ========================================================================== */

    /* --- Chatbot Floating Trigger Button --- */
    .chatbot-toggler {
      position: fixed;
      bottom: 28px;
      right: 28px;
      width: 62px;
      height: 62px;
      background: linear-gradient(135deg, #0d6efd 0%, #00b4d8 100%);
      color: #ffffff;
      border: none;
      border-radius: 50%;
      box-shadow: 0 10px 30px rgba(13, 110, 253, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.65rem;
      transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
      z-index: 9999;
      animation: chatbotPulse 3s ease-in-out infinite;
    }

    .chatbot-toggler:hover {
      transform: scale(1.1) translateY(-4px);
      box-shadow: 0 14px 38px rgba(13, 110, 253, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
      animation: none;
    }

    .chatbot-toggler:active {
      transform: scale(0.95);
    }

    @keyframes chatbotPulse {

      0%,
      100% {
        box-shadow: 0 10px 30px rgba(13, 110, 253, 0.4);
        transform: scale(1);
      }

      50% {
        box-shadow: 0 14px 40px rgba(13, 110, 253, 0.6);
        transform: scale(1.04);
      }
    }

    .show-chatbot .chatbot-toggler {
      transform: rotate(90deg) scale(0.8);
      opacity: 0;
      pointer-events: none;
    }

    /* Unread Notification Badge */
    .unread-badge {
      position: absolute;
      top: -2px;
      right: -2px;
      background: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%);
      color: #ffffff;
      font-size: 0.75rem;
      font-weight: 800;
      width: 24px;
      height: 24px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 2px solid #ffffff;
      animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
      z-index: 11;
      box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    }

    @keyframes popIn {
      0% {
        transform: scale(0);
        opacity: 0;
      }

      100% {
        transform: scale(1);
        opacity: 1;
      }
    }

    .show-chatbot .unread-badge {
      display: none !important;
    }

    /* --- Chatbot Window Container --- */
    .chatbot-window {
      position: fixed;
      bottom: 28px;
      right: 28px;
      width: 385px;
      height: 590px;
      max-width: calc(100vw - 32px);
      max-height: calc(100vh - 40px);
      background-color: #f8fafc;
      border-radius: 22px;
      box-shadow: 0 25px 60px -10px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);
      overflow: hidden;
      opacity: 0;
      pointer-events: none;
      transform: translateY(24px) scale(0.94);
      transform-origin: bottom right;
      transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
      z-index: 9998;
      display: flex;
      flex-direction: column;
    }

    .show-chatbot .chatbot-window {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0) scale(1);
    }

    /* --- Chat Header --- */
    .chat-header {
      padding: 14px 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: #ffffff;
      border-bottom: 1px solid #f1f5f9;
      z-index: 10;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    }

    .chat-brand-info {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .chat-avatar-status {
      position: relative;
      width: 40px;
      height: 40px;
    }

    .chat-header-avatar {
      width: 40px;
      height: 40px;
      border-radius: 12px;
      background: linear-gradient(135deg, #0d6efd 0%, #00d2ff 100%);
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.25rem;
      box-shadow: 0 4px 14px rgba(13, 110, 253, 0.35);
      transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .chat-header:hover .chat-header-avatar {
      transform: scale(1.08) rotate(-4deg);
      box-shadow: 0 6px 18px rgba(13, 110, 253, 0.45);
    }

    .chat-header-avatar i {
      display: inline-block;
      transition: transform 0.3s ease;
      filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
    }

    .status-dot {
      position: absolute;
      bottom: -2px;
      right: -2px;
      width: 11px;
      height: 11px;
      background-color: #10b981;
      border: 2px solid #ffffff;
      border-radius: 50%;
      box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
    }

    .chat-header-details {
      display: flex;
      flex-direction: column;
    }

    .chat-title {
      font-family: 'Plus Jakarta Sans', sans-serif !important;
      font-size: 1rem !important;
      font-weight: 700 !important;
      color: #0f172a;
      margin: 0;
      line-height: 1.2;
    }

    .chat-status-text {
      font-size: 0.75rem;
      color: #10b981;
      font-weight: 600;
      margin-top: 2px;
      display: flex;
      align-items: center;
      gap: 4px;
    }

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

    .action-btn {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      color: #475569;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.05rem;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .action-btn:hover {
      background: #f1f5f9;
      color: #0f172a;
      border-color: #cbd5e1;
      transform: translateY(-1px);
    }

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

    /* --- Chat Body & Messages --- */
    .chat-body {
      flex-grow: 1;
      padding: 16px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 16px;
      background-color: #f8fafc;
    }

    .chat-body::-webkit-scrollbar {
      width: 5px;
    }

    .chat-body::-webkit-scrollbar-track {
      background: transparent;
    }

    .chat-body::-webkit-scrollbar-thumb {
      background: #cbd5e1;
      border-radius: 10px;
    }

    .message-block {
      display: flex;
      gap: 10px;
      animation: msgFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    @keyframes msgFadeIn {
      0% {
        opacity: 0;
        transform: translateY(8px);
      }

      100% {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .bot-block {
      align-items: flex-start;
    }

    .user-block {
      align-items: flex-end;
      justify-content: flex-end;
    }

    .bot-content-wrapper {
      display: flex;
      flex-direction: column;
      gap: 4px;
      max-width: 82%;
    }

    .user-block .bot-content-wrapper {
      align-items: flex-end;
      max-width: 82%;
    }

    .bot-avatar {
      width: 30px;
      height: 30px;
      border-radius: 9px;
      background: linear-gradient(135deg, #0d6efd 0%, #00d2ff 100%);
      color: #ffffff;
      font-size: 0.95rem;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      margin-top: 2px;
      box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
      transition: transform 0.25s ease;
    }

    .bot-avatar i {
      filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
    }

    .message-block:hover .bot-avatar {
      transform: scale(1.1) rotate(-5deg);
    }

    /* Message Bubbles */
    .msg-bubble {
      padding: 12px 16px;
      font-size: 0.92rem;
      font-weight: 500;
      line-height: 1.55;
      position: relative;
      word-wrap: break-word;
    }

    .bot-block .msg-bubble {
      background: #ffffff;
      color: #1e293b;
      border-radius: 18px 18px 18px 4px;
      border: 1px solid #e2e8f0;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    }

    .user-block .msg-bubble {
      background: linear-gradient(135deg, #0d6efd 0%, #0099ff 100%);
      color: #ffffff;
      border-radius: 18px 18px 4px 18px;
      box-shadow: 0 4px 14px rgba(13, 110, 253, 0.22);
    }

    .msg-time {
      font-size: 0.68rem;
      color: #94a3b8;
      margin: 2px 4px 0 4px;
      font-weight: 500;
    }

    .user-block .msg-time {
      text-align: right;
    }

    /* Typing Indicator */
    .typing-indicator {
      display: flex;
      align-items: center;
      gap: 5px;
      padding: 4px 2px;
    }

    .typing-indicator span {
      width: 7px;
      height: 7px;
      background: #0d6efd;
      border-radius: 50%;
      opacity: 0.4;
      animation: typingBounce 1.4s infinite ease-in-out both;
    }

    .typing-indicator span:nth-child(1) {
      animation-delay: -0.32s;
    }

    .typing-indicator span:nth-child(2) {
      animation-delay: -0.16s;
    }

    @keyframes typingBounce {

      0%,
      80%,
      100% {
        transform: scale(0.6);
        opacity: 0.3;
      }

      40% {
        transform: scale(1);
        opacity: 1;
      }
    }

    /* --- Inline Interactive Card (Forms, Input, Options) --- */
    .inline-action-card {
      background: #ffffff;
      border: 1.5px solid #e2e8f0;
      border-radius: 16px;
      padding: 16px;
      box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
      position: relative;
      margin-top: 6px;
      width: 100%;
      min-width: 250px;
      animation: cardPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }

    @keyframes cardPopIn {
      0% {
        transform: scale(0.92);
        opacity: 0;
      }

      100% {
        transform: scale(1);
        opacity: 1;
      }
    }

    .inline-action-close {
      position: absolute;
      top: -9px;
      right: -9px;
      background: #ef4444;
      color: #ffffff;
      border: 2px solid #ffffff;
      border-radius: 50%;
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 0.9rem;
      box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
      transition: transform 0.2s ease;
      z-index: 2;
    }

    .inline-action-close:hover {
      transform: scale(1.15);
    }

    .inline-action-input-wrapper {
      display: flex;
      align-items: center;
      background: #f8fafc;
      border-radius: 50px;
      border: 1.5px solid #0ea5e9;
      padding: 4px 6px 4px 16px;
      box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
      transition: all 0.25s ease;
      position: relative;
    }

    .inline-action-input-wrapper.error-state {
      border-color: #ef4444;
      background: #fef2f2;
      box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
    }

    .inline-action-input-wrapper:focus-within {
      background: #ffffff;
      border-color: #0d6efd;
      box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
    }

    .inline-action-input-wrapper input {
      flex-grow: 1;
      border: none;
      background: transparent;
      padding: 8px 40px 8px 0;
      font-family: 'Plus Jakarta Sans', sans-serif;
      font-size: 0.88rem;
      outline: none;
      color: #0f172a;
      font-weight: 500;
    }

    .inline-action-input-wrapper input::placeholder {
      color: #94a3b8;
    }

    .inline-action-input-wrapper button {
      background: linear-gradient(135deg, #0d6efd 0%, #00d2ff 100%);
      color: #ffffff;
      border: none;
      border-radius: 50%;
      width: 34px;
      height: 34px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 0.95rem;
      box-shadow: 0 2px 8px rgba(13, 110, 253, 0.35);
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      flex-shrink: 0;
      position: absolute;
      right: 5px;
    }

    .inline-action-input-wrapper button:hover {
      transform: scale(1.08);
      box-shadow: 0 4px 12px rgba(13, 110, 253, 0.5);
    }

    .inline-error-text {
      font-size: 0.75rem;
      color: #ef4444;
      font-weight: 600;
      margin-top: 6px;
      margin-left: 10px;
      display: none;
    }

    /* Pricing Tier Options */
    .pricing-tier-btn {
      background: #ffffff;
      border: 1.5px solid #e2e8f0;
      padding: 11px 14px;
      border-radius: 12px;
      font-size: 0.85rem;
      font-weight: 600;
      font-family: 'Plus Jakarta Sans', sans-serif;
      cursor: pointer;
      text-align: left;
      color: #1e293b;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      display: block;
      width: 100%;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    }

    .pricing-tier-btn:hover {
      background: #f0f7ff;
      border-color: #38bdf8;
      color: #0284c7;
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(14, 165, 233, 0.12);
    }

    /* Support Form Card */
    .support-form-card {
      background: #ffffff;
      border-radius: 16px;
      padding: 20px;
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
      width: 100%;
      border: 1px solid #e2e8f0;
      position: relative;
    }

    .support-form-card .form-group {
      margin-bottom: 12px;
    }

    .support-form-card label {
      display: block;
      font-size: 0.82rem;
      font-weight: 600;
      color: #0f172a;
      margin-bottom: 4px;
    }

    .support-form-card .text-danger {
      color: #ef4444;
      margin-left: 2px;
    }

    .support-form-card input,
    .support-form-card select,
    .support-form-card textarea {
      width: 100%;
      border: 1.5px solid #e2e8f0;
      background: #f8fafc;
      border-radius: 10px;
      padding: 9px 12px;
      font-family: 'Plus Jakarta Sans', sans-serif;
      font-size: 0.88rem;
      color: #1e293b;
      outline: none;
      transition: all 0.25s ease;
      box-sizing: border-box;
    }

    .support-form-card input:focus,
    .support-form-card select:focus,
    .support-form-card textarea:focus {
      border-color: #0d6efd;
      background: #ffffff;
      box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
    }

    .form-actions {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      margin-top: 14px;
    }

    .support-btn {
      background: linear-gradient(135deg, #0d6efd 0%, #00d2ff 100%);
      color: #ffffff;
      border: none;
      border-radius: 10px;
      padding: 10px 20px;
      font-size: 0.9rem;
      font-weight: 600;
      cursor: pointer;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      box-shadow: 0 4px 14px rgba(13, 110, 253, 0.25);
    }

    .support-btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 6px 18px rgba(13, 110, 253, 0.35);
    }

    /* --- Chat Footer & Input Controls --- */
    .chat-footer-wrapper {
      padding: 0 16px 12px;
      background: #ffffff;
      border-top: 1px solid #f1f5f9;
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding-top: 10px;
    }

    .quick-replies {
      display: flex;
      gap: 8px;
      overflow-x: auto;
      scrollbar-width: none;
      padding-bottom: 2px;
    }

    .quick-replies::-webkit-scrollbar {
      display: none;
    }

    .quick-reply-btn {
      background: #ffffff;
      border: 1.5px solid #e2e8f0;
      padding: 7px 14px;
      border-radius: 999px;
      font-size: 0.82rem;
      font-weight: 600;
      font-family: 'Plus Jakarta Sans', sans-serif;
      color: #334155;
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .quick-reply-btn:hover {
      border-color: #38bdf8;
      color: #0284c7;
      background: #f0f9ff;
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(14, 165, 233, 0.16);
    }

    .input-wrapper {
      display: flex;
      align-items: center;
      background: #f8fafc;
      border-radius: 999px;
      height: 48px;
      padding: 0 6px 0 16px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
      border: 1.5px solid #e2e8f0;
      transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
      position: relative;
      box-sizing: border-box;
    }

    .input-wrapper.disabled-wrapper {
      opacity: 0.55;
      pointer-events: none;
      filter: grayscale(100%);
      box-shadow: none;
      border-color: #cbd5e1;
    }

    .input-wrapper:focus-within {
      background: #ffffff;
      border-color: #0d6efd;
      box-shadow: 0 0 0 3.5px rgba(13, 110, 253, 0.12);
    }

    .input-wrapper input {
      flex-grow: 1;
      border: none;
      background: transparent;
      font-family: 'Plus Jakarta Sans', sans-serif;
      font-size: 0.88rem;
      padding-right: 44px;
      outline: none;
      color: #0f172a;
      font-weight: 500;
      height: 100%;
    }

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

    .send-btn {
      width: 36px;
      height: 36px;
      background: linear-gradient(135deg, #0d6efd 0%, #00d2ff 100%);
      color: #ffffff;
      border: none;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.95rem;
      cursor: pointer;
      flex-shrink: 0;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      position: absolute;
      right: 6px;
      box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
    }

    .send-btn:hover {
      transform: scale(1.08);
      box-shadow: 0 4px 14px rgba(13, 110, 253, 0.5);
    }

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

    .watermark {
      text-align: center;
      font-size: 0.72rem;
      color: #94a3b8;
      padding-bottom: 8px;
      background: #ffffff;
    }

    .watermark strong {
      color: #0d6efd;
    }

    /* Mobile Responsive Optimizations */
    @media (max-width: 480px) {
      .chatbot-window {
        bottom: 12px;
        right: 12px;
        left: 12px;
        width: calc(100% - 24px);
        max-width: 100%;
        height: calc(100vh - 80px);
        max-height: 600px;
        border-radius: 18px;
      }

      .chatbot-toggler {
        bottom: 18px;
        right: 18px;
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
      }
    }
