/* ====================================================
   Responsive Design for Nexora AI Chatbot
   Chatbot uses top+bottom anchoring from style.css:
     Desktop default: top: 80px, bottom: 110px, right: 30px
   ==================================================== */

/* ===== Desktop (> 991px) ===== */
@media (min-width: 992px) {
  .chatbot {
    width: 380px;
    top: var(--shared-header-offset, 90px);
    bottom: 110px;
    right: 30px;
  }
}

/* ===== Tablets (768px - 991px) ===== */
@media (max-width: 991px) {
  .chatbot {
    width: 370px;
    top: var(--shared-header-offset, 90px);
    bottom: 110px;
    right: 25px;
  }

  .chat-header {
    padding: 16px 18px;
  }

  .header-left h3 {
    font-size: 16px;
  }

  .welcome-card h2 {
    font-size: 22px;
  }

  .demo-btn {
    font-size: 14px;
    padding: 14px;
  }
}

/* ===== Small Tablets (641px - 767px) ===== */
@media (max-width: 767px) {
  .chatbot {
    width: 350px;
    max-width: calc(100vw - 40px);
    top: var(--shared-header-offset, 90px);
    bottom: 105px;
    right: 20px;
  }

  .chat-launcher {
    width: 60px;
    height: 60px;
    font-size: 26px;
    right: 25px;
    bottom: 25px;
  }

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

  .header-left h3 {
    font-size: 16px;
  }

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

  .chat-footer {
    padding: 12px 14px;
  }

  .chat-footer input {
    height: 42px;
    font-size: 13px;
    padding: 0 16px;
  }

  #send-btn {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .quick-actions {
    margin-left: 38px;
    gap: 6px;
  }

  .quick-btn {
    font-size: 12px;
    padding: 7px 14px;
  }

  .welcome-card {
    padding: 20px;
  }

  .welcome-card h2 {
    font-size: 20px;
  }

  .welcome-stats div {
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* ===== Mobile Landscape / Large Phones (481px - 640px) ===== */
@media (max-width: 640px) {
  .chatbot {
    width: calc(100vw - 30px);
    right: 15px;
    top: var(--shared-header-offset, 90px);
    bottom: 100px;
    border-radius: 18px;
  }

  .chat-launcher {
    right: 20px;
    bottom: 22px;
    width: 58px;
    height: 58px;
  }

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

  .bot-avatar {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .header-left h3 {
    font-size: 15px;
  }

  .ai-status {
    font-size: 11px;
  }

  .chat-body {
    padding: 14px 12px;
  }

  .message-content {
    max-width: 82%;
    padding: 12px 14px;
  }

  .message-content p {
    font-size: 13px;
  }

  .quick-actions {
    margin-left: 36px;
    gap: 6px;
  }

  .quick-btn {
    font-size: 12px;
    padding: 6px 12px;
  }

  .chat-footer {
    padding: 10px 12px;
  }

  .chat-footer input {
    height: 40px;
    font-size: 13px;
    padding: 0 14px;
  }

  #send-btn {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }

  .cta-section {
    margin-left: 38px;
  }

  .demo-btn {
    font-size: 14px;
    padding: 14px;
  }
}

/* ===== Mobile Portrait (≤ 480px) ===== */
@media (max-width: 480px) {
  .chatbot {
    width: calc(100vw - 20px);
    right: 10px;
    left: 10px;
    top: var(--shared-header-offset, 90px);
    bottom: 90px;
    border-radius: 16px;
  }

  .chat-launcher {
    right: 16px;
    bottom: 18px;
    width: 54px;
    height: 54px;
    font-size: 22px;
  }

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

  .header-left h3 {
    font-size: 15px;
  }

  .header-left img {
    height: 24px !important;
  }

  .chat-body {
    padding: 12px 10px;
  }

  .message .avatar {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .message-content {
    padding: 10px 12px;
    max-width: 85%;
  }

  .message-content p {
    font-size: 13px;
    line-height: 1.5;
  }

  .message-time {
    font-size: 10px;
    margin-top: 3px;
  }

  .quick-actions {
    margin-left: 32px;
    gap: 5px;
  }

  .quick-btn {
    font-size: 11px;
    padding: 6px 11px;
  }

  .chat-footer {
    padding: 10px 12px;
  }

  .chat-footer input {
    height: 40px;
    font-size: 13px;
    padding: 0 14px;
    border-radius: 20px;
  }

  #send-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .welcome-card {
    padding: 16px;
  }

  .welcome-card h2 {
    font-size: 17px;
  }

  .welcome-card p {
    font-size: 13px;
  }

  .welcome-stats {
    gap: 6px;
  }

  .welcome-stats div {
    font-size: 11px;
    padding: 6px 10px;
  }

  .cta-section {
    margin-left: 32px;
    margin-right: 8px;
  }

  .floating-notification {
    top: 10px;
    right: 10px;
    padding: 12px 16px;
    font-size: 13px;
  }

  .notification-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

/* ===== Small Mobile (≤ 360px) ===== */
@media (max-width: 360px) {
  .chatbot {
    right: 6px;
    left: 6px;
    top: var(--shared-header-offset, 90px);
    bottom: 85px;
    border-radius: 14px;
  }

  .chat-launcher {
    right: 12px;
    bottom: 14px;
    width: 50px;
    height: 50px;
  }

  .chat-header {
    padding: 10px 12px;
  }

  .header-left h3 {
    font-size: 14px;
  }

  .welcome-card h2 {
    font-size: 15px;
  }

  .quick-btn {
    font-size: 10px;
    padding: 5px 10px;
  }

  .demo-btn {
    font-size: 12px;
    padding: 11px;
  }
}

/* ===== Height-based responsive (Short screens) ===== */
@media (max-height: 700px) {
  .chatbot {
    top: var(--shared-header-offset, 90px);
  }

  .welcome-card {
    padding: 14px;
    margin-bottom: 14px;
  }

  .chat-body {
    padding: 14px 12px;
  }

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

  .chat-footer {
    padding: 8px 12px;
  }

  .chat-footer input {
    height: 38px;
  }

  #send-btn {
    width: 38px;
    height: 38px;
  }
}

@media (max-height: 600px) {
  .chatbot {
    top: var(--shared-header-offset, 90px);
    bottom: 80px;
  }

  .chat-header {
    padding: 8px 12px;
  }

  .header-left h3 {
    font-size: 14px;
  }

  .welcome-card h2 {
    font-size: 16px;
    margin-bottom: 6px;
  }

  .welcome-stats {
    display: none;
  }

  .message {
    margin-bottom: 10px;
  }

  .message-content {
    padding: 8px 12px;
  }
}

/* ===== Landscape Mode on phones ===== */
@media (max-height: 500px) and (orientation: landscape) {
  .chatbot {
    top: var(--shared-header-offset, 90px);
    bottom: 65px;
    right: 15px;
    width: 360px;
    border-radius: 14px;
  }

  .chat-launcher {
    bottom: 10px;
    right: 15px;
    width: 48px;
    height: 48px;
  }

  .welcome-card {
    display: none;
  }

  .chat-header {
    padding: 8px 12px;
  }

  .chat-body {
    padding: 10px;
  }

  .chat-footer {
    padding: 6px 10px;
  }

  .chat-footer input {
    height: 36px;
    font-size: 12px;
  }

  #send-btn {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
}
