/* ==========================================================================
   ALLYNOTE — RESPONSIVE DESIGN & MOBILE LAYOUTS
   ========================================================================== */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 240px;
  }

  .main-content {
    padding: 20px 24px 36px 24px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .context-pill {
    max-width: 340px;
  }
}

/* Mobile & Small Tablets (max-width: 768px) */
@media (max-width: 768px) {
  :root {
    --header-height: 58px;
    --mobile-nav-height: 62px;
  }

  /* Mobile Drawer Sidebar */
  .app-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 280px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    transform: translateX(-100%) !important;
    box-shadow: none !important;
    z-index: 9999 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-left: 0 !important;
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1),
                box-shadow 0.25s ease !important;
  }

  .app-sidebar.drawer-open {
    transform: translateX(0) !important;
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.6) !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
  }

  /* Show Drawer backdrop when open (no blur!) */
  .drawer-backdrop.open {
    display: block !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Show Mobile Nav Bar */
  .mobile-nav-bar {
    display: flex;
  }

  .main-content {
    padding: 16px 16px calc(var(--mobile-nav-height) + 24px) 16px;
  }

  .app-header {
    padding: 0 16px;
  }

  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .search-trigger-btn span,
  .search-trigger-btn .kbd-shortcut {
    display: none;
  }

  .search-trigger-btn {
    padding: 8px;
    border-radius: var(--radius-sm);
  }

  .context-pill {
    max-width: 200px;
    padding: 5px 10px;
    font-size: 0.775rem;
  }

  .context-pill .pill-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .btn-quick-add span:not(.quick-add-plus) {
    display: none;
  }

  .btn-quick-add {
    padding: 6px 8px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Modals on mobile fill the screen nicely */
  .modal-overlay {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-content {
    max-height: 92vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .modal-body {
    padding: 18px 16px;
  }

  .modal-footer {
    padding: 12px 16px;
  }

  /* Larger touch targets for mobile/Android */
  .btn,
  .form-control,
  .form-select,
  .nav-item {
    min-height: 40px;
  }

  .filter-tab-btn {
    min-height: 32px;
    padding: 5px 12px;
    flex-shrink: 0;
  }
}

/* Small Screens (max-width: 480px) */
@media (max-width: 480px) {
  .header-actions {
    gap: 6px;
  }

  .context-pill {
    max-width: 140px;
  }
}
