/* responsive.css - Mobile-first overrides for TahaPayam */

/* General tweaks for tablets and down */
@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
    gap: 0;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-header {
    flex: 0 0 230px;
    border-bottom: none;
    border-left: 1px solid var(--border);
  }

  .status-list {
    display: grid;
    grid-template-columns: 1fr;
    flex: 1;
    padding: 12px 16px;
    gap: 12px;
  }

  .status-card {
    width: 100%;
    min-width: unset;
    height: auto;
  }

  .main-chat {
    min-height: calc(100vh - 120px);
  }

  .messages-wrapper {
    padding: 16px 5%;
  }

  .msg-bubble {
    max-width: 85%;
  }

  .chat-input-box {
    padding: 12px 16px;
  }
}

/* Mobile-first adjustments */
@media (max-width: 768px) {
  body {
    overflow: hidden;
  }

  .sidebar {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 64px; /* space for nav */
    z-index: 60;
    background: rgba(10, 12, 18, 0.97);
    overflow-y: auto;
  }

   /* نمایش سایدبار در حالت موبایل وقتی تب انتخاب می‌شود */
  .sidebar.mobile-visible {
    display: block;
  }

  .chat-topbar {
    height: 64px;
    padding: 0 14px;
  }

  .typing-indicator {
    min-width: unset;
    padding: 6px 10px;
    font-size: 12px;
  }

  .messages-wrapper {
    padding: 14px 4% 80px;
    gap: 12px;
    height: calc(100vh - 220px);
  }

  .jump-latest {
    bottom: 120px;
    right: 14px;
  }

  .msg-bubble {
    max-width: 88%;
    padding: 12px 14px;
    font-size: 13px;
  }

  .msg-footer {
    font-size: 10px;
  }

  .chat-input-box {
    position: sticky;
    bottom: 64px; /* بالای نوار تب */
    padding: 10px 12px 14px;
    background: linear-gradient(180deg, rgba(10, 12, 18, 0.9), rgba(10, 12, 18, 1));
    z-index: 55;
  }

  .input-container {
    padding: 8px;
    gap: 8px;
  }

  .action-btn {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 18px;
  }

  .text-field {
    min-height: 48px;
    font-size: 14px;
  }

  .upload-progress {
    padding: 8px 10px;
    margin-bottom: 8px;
  }

  .modal-card {
    width: 94%;
    max-width: 500px;
    padding: 16px;
  }

  /* Context menu: full-width safe area on mobile */
  #ctx-menu {
    left: 8px !important;
    right: 8px !important;
    top: auto !important;
    bottom: 16px !important;
    width: auto !important;
  }

  /* نوار ناوبری پایین موبایل */
  #mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(10, 12, 18, 0.96);
    border-top: 1px solid var(--border);
    z-index: 80;
  }
  #mobile-nav button {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
  }
  #mobile-nav button i {
    font-size: 16px;
  }
  #mobile-nav button.active {
    color: var(--primary);
  }
}

/* Small phones */
@media (max-width: 520px) {
  .chat-topbar h2 {
    font-size: 16px;
  }

  .messages-wrapper {
    padding: 12px 3%;
    height: calc(100vh - 150px);
  }

  .msg-bubble {
    max-width: 92%;
  }

  .action-btn {
    width: 44px;
    height: 44px;
    font-size: 17px;
  }

  .text-field {
    min-height: 50px;
    font-size: 13px;
  }

  .modal .action-btn {
    min-width: 100px;
  }
}
