/* Mobile responsive adjustments */
@media (max-width: 991.98px) {
  .navbar-brand {
    margin: 0 auto;
  }

  .dropdown.d-lg-none {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
  }

  .hamburger-menu {
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    padding: 8px;
    cursor: pointer;
    transition: color 0.2s ease;
  }

  .hamburger-menu:hover {
    color: #e74c14;
  }

  .hamburger-menu:focus {
    outline: none;
    box-shadow: none;
  }

  .mobile-menu-dropdown {
    right: 0 !important;
    left: auto !important;
    transform: translateX(-8px);
  }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .container {
    padding: 0 0.5rem;
  }

  .chat-container {
    padding: 0;
    margin-top: 80px;
    height: calc(100vh - 80px);
  }

  .chat-messages {
    padding: 0.75rem;
    -webkit-overflow-scrolling: touch;
  }

  .message-sent,
  .message-received {
    max-width: 90vw;
    padding: 10px 14px;
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .chat-input {
    padding: 0.75rem;
    background: white;
    border-top: 1px solid #e9ecef;
  }

  .input-group .form-control {
    border-radius: 25px;
    padding: 0.625rem 0.875rem;
    height: auto;
    min-height: 50px;
    font-size: 0.95rem;
  }

  .btn-primary {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .btn-primary i {
    font-size: 18px;
  }

  /* Mobile header styles */
  .navbar {
    padding: 0.5rem;
  }

  .navbar-brand {
    margin: 0;
  }

  .navbar-brand img {
    height: 35px !important;
  }

  .nav-buttons {
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    min-height: 36px;
    min-width: 36px;
    flex-shrink: 0;
  }

  /* All buttons mobile centering */
  .btn-refresh,
  .btn-outline-primary,
  .btn-outline-secondary,
  .tts-btn,
  #dropdownMenuLang {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .btn-refresh i,
  .btn-outline-primary i,
  .btn-outline-secondary i,
  .tts-btn i {
    margin: 0 !important;
  }

  .btn-refresh span,
  .btn-outline-primary span,
  .btn-outline-secondary span,
  #dropdownMenuLang span {
    display: none !important;
  }

  #dropdownMenuLang img {
    margin: 0 !important;
  }

  .d-flex.align-items-center {
    gap: 0.25rem;
  }

  /* Mobile option buttons */
  .option-btn {
    min-width: 80px;
    padding: 8px 12px;
    font-size: 0.85rem;
    margin: 2px;
    min-height: 44px;
    touch-action: manipulation;
  }

  .message-options {
    padding-left: 32px;
    gap: 4px;
  }

  /* Mobile typing indicator */
  #chatTypingIndicator {
    padding-left: 0.75rem;
  }

  #chatTypingIndicator span {
    font-size: 0.9rem;
  }

  /* Mobile avatar */
  .message-wrapper.received img {
    width: 24px !important;
    height: 24px !important;
  }

  /* Prevent zoom on input focus */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Mobile navigation button optimizations */
@media (max-width: 768px) {

  .btn-outline-primary,
  .btn-outline-secondary {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-height: 36px;
    min-width: 36px;
  }

  .btn-outline-primary span,
  .btn-outline-secondary span {
    display: none;
  }

  .btn-outline-primary i,
  .btn-outline-secondary i {
    margin-right: 0 !important;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 0.25rem 0.5rem;
  }

  .navbar-brand img {
    height: 30px !important;
  }

  .nav-buttons {
    gap: 0.2rem;
  }

  .btn-outline-primary,
  .btn-outline-secondary {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    min-height: 32px;
    min-width: 32px;
  }

  .nav-buttons .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    min-height: 32px;
    min-width: 32px;
  }

  /* All buttons small mobile centering */
  .btn-refresh,
  .btn-outline-primary,
  .btn-outline-secondary,
  .tts-btn,
  #dropdownMenuLang {
    min-height: 32px !important;
    min-width: 32px !important;
  }
}

.image-options {
  gap: 8px;
  margin: 12px 0 20px 0;
}

.option-btn {
  padding: 6px 16px;
  font-size: 13px;
  min-width: 50px;
}

/* Mobile sent message container with image */
.sent-message-container {
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.sent-image-container img {
  width: 150px !important;
  height: 150px !important;
}
}

/* Extra small screens */
@media (max-width: 480px) {
  .header .container {
    padding: 0 0.25rem;
  }

  .chat-container {
    padding: 0 0.25rem;
  }

  .message-sent,
  .message-received {
    max-width: 95%;
    padding: 8px 0.5rem;
    font-size: 0.85rem;
  }

  .chat-input {
    padding: 0.5rem 0.25rem;
  }

  .nav-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
  }

  .navbar-brand img {
    height: 32px;
  }

  /* Hide navigation buttons on extra small screens */
  .btn-outline-primary,
  .btn-outline-secondary {
    display: none !important;
  }

  /* Extra small sent message container with image */
  .sent-image-container img {
    width: 120px !important;
    height: 120px !important;
  }
}