/* ============================================================
   Projax HRMS — Mobile Responsive & App-Like Experience
   ============================================================
   This stylesheet transforms the desktop application into a
   fully responsive, mobile-first, app-like experience.
   ============================================================ */

/* ── Base Mobile Resets ──────────────────────────────────── */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  overscroll-behavior: none;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: -webkit-fill-available;
}

/* Prevent pull-to-refresh on mobile (app-like feel) */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Enable hardware acceleration for smooth scrolling */
.content, .hrms-content, .sidebar, .hrms-sidebar, .hrms-sub-nav {
  -webkit-overflow-scrolling: touch;
}

/* Safe area insets for notched devices */
@supports (padding: env(safe-area-inset-top)) {
  .navbar {
    padding-top: env(safe-area-inset-top);
  }
  .sidebar, .hrms-sidebar {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .content, .hrms-content {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}

/* ── Touch-Friendly Targets ─────────────────────────────── */
/* Minimum 44px touch targets per WCAG/Apple HIG guidelines */
@media (max-width: 1024px) {
  .btn, button, [role="button"],
  .sidelink, .module-link, .sub-link,
  select, input[type="checkbox"], input[type="radio"] {
    min-height: 44px;
  }

  .sidelink {
    padding: 0.6rem 0.75rem !important;
    height: auto !important;
    font-size: 0.9rem !important;
  }

  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  .btn-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  /* Larger checkbox/radio */
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
  }

  /* Touch-friendly form inputs */
  .input, .form-control, input[type="text"], input[type="email"],
  input[type="password"], input[type="number"], input[type="date"],
  input[type="time"], input[type="search"], input[type="tel"],
  input[type="url"], textarea, select {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
    padding: 0.7rem 0.85rem;
    min-height: 44px;
    border-radius: 8px;
  }

  /* Prevent double-tap zoom */
  * {
    touch-action: manipulation;
  }
}

/* ── Navbar Mobile ──────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar {
    height: 56px !important;
    min-height: 56px !important;
    padding: 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .shell {
    margin-top: 56px !important;
    min-height: calc(100vh - 56px) !important;
  }

  .navbar-table tr {
    height: 56px;
  }

  .brand-cell {
    width: auto !important;
    min-width: 48px !important;
    max-width: 120px !important;
    padding-left: 8px !important;
  }

  .brand img {
    max-height: 36px !important;
  }

  .brand-toggle-cell {
    width: 48px !important;
    min-width: 48px !important;
  }

  .brand-middle-cell {
    display: none !important;
  }

  .brand-user-cell {
    width: auto !important;
    min-width: auto !important;
    padding-right: 8px !important;
  }

  .brand-user-cell .user-menu {
    gap: 0.25rem !important;
  }

  .nav-user {
    display: none !important;
  }

  /* Mobile menu button always visible */
  .mobile-menu-button {
    display: inline-flex !important;
  }
}

/* ── Sidebar Mobile Drawer ──────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000 !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    padding-top: 56px !important;
  }

  .sidebar.active {
    transform: translateX(0) !important;
  }

  .content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 12px !important;
  }

  body.sidebar-collapsed .content {
    margin-left: 0 !important;
  }

  /* Overlay for mobile menu */
  .menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  body.menu-open .menu-overlay {
    display: block;
    opacity: 1;
  }
}

/* ── Content Area Mobile ────────────────────────────────── */
@media (max-width: 768px) {
  .content {
    padding: 8px !important;
  }

  /* Page headers */
  .head {
    flex-direction: column !important;
    gap: 0.75rem !important;
    align-items: flex-start !important;
    padding: 0.5rem 0 !important;
  }

  .head h1, .head h2 {
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
  }

  .head .actions, .head .head-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.5rem !important;
  }

  .head .actions .btn, .head .head-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 0.85rem;
  }

  /* Container widths */
  .container {
    width: 100% !important;
    padding: 0 8px !important;
  }
}

/* ── Grid Systems Mobile ────────────────────────────────── */
@media (max-width: 768px) {
  .grid,
  .card-grid,
  .stats-grid,
  .dashboard-layout,
  .project-grid,
  .metric-row,
  .grid-balanced {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .grid-two-column {
    grid-template-columns: 1fr !important;
  }

  .form-grid,
  .schedule-form-grid,
  .settings-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .card.span-2 {
    grid-column: span 1 !important;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .stats-grid,
  .metric-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ── Cards Mobile ───────────────────────────────────────── */
@media (max-width: 768px) {
  .card {
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    margin-bottom: 0.5rem;
  }

  .card:hover {
    transform: none !important; /* Disable hover lift on touch devices */
  }

  .card-header {
    padding: 0.75rem 1rem !important;
    flex-direction: column;
    gap: 0.5rem;
  }

  .card-body {
    padding: 0.75rem 1rem !important;
  }

  .card-footer {
    padding: 0.75rem 1rem !important;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .metric-card {
    padding: 1rem !important;
  }

  .metric .value {
    font-size: 1.4rem !important;
  }

  .project-card:hover {
    transform: none !important;
  }
}

/* ── Tables → Mobile Card View ──────────────────────────── */
@media (max-width: 768px) {
  /* Force tables to be scrollable */
  .table-wrapper,
  .table-responsive,
  .table-surface {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 0 -8px;
    padding: 0 8px;
    width: calc(100% + 16px);
  }

  /* Compact table cells */
  .table th,
  .table td {
    padding: 0.5rem 0.6rem !important;
    font-size: 0.8rem !important;
    white-space: nowrap;
  }

  .table-compact th,
  .table-compact td {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.75rem !important;
  }

  /* Auto-card transform for simple tables */
  .mobile-card-table thead {
    display: none !important;
  }

  .mobile-card-table tbody tr {
    display: block !important;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }

  .mobile-card-table tbody td {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0 !important;
    border: none !important;
    border-bottom: 1px solid #f3f4f6;
    white-space: normal !important;
    text-align: right;
  }

  .mobile-card-table tbody td:last-child {
    border-bottom: none !important;
  }

  .mobile-card-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.78rem;
    color: #6b7280;
    text-align: left;
    flex-shrink: 0;
    margin-right: 1rem;
  }

  /* Scroll indicator shadow for tables */
  .table-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to left, rgba(249, 250, 251, 0.9), transparent);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s;
  }

  .table-wrapper.scrolled-end::after {
    opacity: 0;
  }
}

/* ── Modals Mobile ──────────────────────────────────────── */
@media (max-width: 768px) {
  .modal-dialog {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 92vh !important;
    margin: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    animation: slideUpModal 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  @keyframes slideUpModal {
    from {
      transform: translateY(100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .modal-body {
    max-height: 60vh !important;
    overflow-y: auto !important;
    padding: 1rem !important;
  }

  .modal-header, .modal-footer {
    padding: 0.75rem 1rem !important;
  }

  .modal-footer {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .modal-footer .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  /* Tailwind modals (used in newer templates) */
  .fixed.inset-0 .relative.w-full {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    max-height: 90vh !important;
  }
}

/* ── Filter Panels Mobile ───────────────────────────────── */
@media (max-width: 768px) {
  .filter-panel,
  .filter-toolbar,
  .filter-row {
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding: 0.75rem !important;
  }

  .filter-panel > *, 
  .filter-toolbar > *,
  .filter-row > * {
    width: 100% !important;
    min-width: 0 !important;
  }

  .filter-panel .btn,
  .filter-toolbar .btn {
    width: 100% !important;
    justify-content: center;
  }

  /* Collapsible filter on mobile */
  .filter-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-bottom: 0.75rem;
  }
}

/* ── Forms Mobile ───────────────────────────────────────── */
@media (max-width: 768px) {
  .form-group {
    margin-bottom: 0.75rem !important;
  }

  .form-group label {
    font-size: 0.85rem !important;
    margin-bottom: 0.35rem;
  }

  .compact-form {
    max-width: 100% !important;
  }

  .input-with-button {
    flex-direction: column !important;
  }

  .input-with-button .btn {
    width: 100%;
    justify-content: center;
  }

  /* Auth forms */
  .auth-layout {
    grid-template-columns: 1fr !important;
    padding: 1rem !important;
  }

  .auth-form {
    padding: 1.5rem !important;
  }

  /* Choices.js dropdown */
  .choices {
    min-height: 44px !important;
  }

  .choices__inner {
    min-height: 44px !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 16px !important;
  }
}

/* ── Kanban Board Mobile ────────────────────────────────── */
@media (max-width: 768px) {
  .kanban-grid,
  .kanban-board {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    overflow-x: visible !important;
  }

  .kanban-column {
    min-width: 0 !important;
    width: 100% !important;
  }

  .kanban-column .card-body {
    max-height: none !important;
  }
}

/* Allow horizontal scroll on tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .kanban-grid,
  .kanban-board {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
    flex-wrap: nowrap !important;
  }

  .kanban-column {
    min-width: 260px !important;
    flex-shrink: 0 !important;
  }
}

/* ── Calendar Mobile ────────────────────────────────────── */
@media (max-width: 768px) {
  .calendar-week,
  .calendar-month {
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 1px !important;
    font-size: 0.7rem !important;
  }

  .calendar-week > *,
  .calendar-month > * {
    min-width: 0 !important;
    padding: 4px 2px !important;
    overflow: hidden;
  }

  .calendar-day-header {
    font-size: 0.6rem !important;
    padding: 4px 0 !important;
  }
}

/* ── HRMS Layout Mobile ─────────────────────────────────── */
@media (max-width: 1024px) {
  .hrms-container {
    flex-direction: column !important;
    position: relative;
  }

  /* HRMS Icon Sidebar → Horizontal scrollable strip */
  .hrms-sidebar {
    width: 100% !important;
    height: auto !important;
    position: sticky !important;
    top: 52px;
    flex-direction: row !important;
    padding: 8px 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    z-index: 30;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .hrms-sidebar::-webkit-scrollbar {
    display: none;
  }

  .hrms-module-nav {
    flex-direction: row !important;
    gap: 4px !important;
    height: auto !important;
    width: max-content !important;
    align-items: center !important;
  }

  .nav-divider {
    width: 1px !important;
    height: 32px !important;
    margin: 0 6px !important;
    flex-shrink: 0;
  }

  .module-link {
    flex-direction: column !important;
    width: auto !important;
    min-width: 64px !important;
    min-height: auto !important;
    padding: 6px 8px !important;
    border-radius: 10px !important;
    font-size: 9px !important;
    flex-shrink: 0;
  }

  .module-link i {
    width: 20px !important;
    height: 20px !important;
  }

  .module-link-utility {
    margin-top: 0 !important;
    margin-left: auto !important;
  }

  /* HRMS Sub Navigation → Bottom sheet or horizontal tabs */
  .hrms-sub-nav {
    display: flex !important;
    width: 100% !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 8px 12px !important;
    gap: 6px !important;
    background: white;
    border-right: none !important;
    border-bottom: 1px solid #f1f5f9;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .hrms-sub-nav::-webkit-scrollbar {
    display: none;
  }

  .sub-nav-group {
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    flex-shrink: 0;
    align-items: center;
  }

  .sub-nav-title {
    display: none !important; /* Hide section titles in horizontal mode */
  }

  .sub-link {
    white-space: nowrap !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
    border-radius: 20px !important;
    gap: 6px !important;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
    min-height: 36px;
  }

  .sub-link:hover {
    transform: none !important;
  }

  .sub-link.active {
    background: #2563eb !important;
    color: white !important;
    border-color: #2563eb !important;
  }

  /* HRMS Main content */
  .hrms-main {
    flex-direction: column !important;
  }

  .hrms-content {
    padding: 12px !important;
  }
}

@media (max-width: 480px) {
  .hrms-sidebar {
    top: 56px; /* Matches mobile navbar height */
  }

  .module-link {
    min-width: 56px !important;
    font-size: 8px !important;
    padding: 4px 6px !important;
  }

  .module-link i {
    width: 18px !important;
    height: 18px !important;
  }

  .sub-link {
    font-size: 11px !important;
    padding: 6px 12px !important;
  }

  .hrms-content {
    padding: 8px !important;
  }
}

/* ── Chips & Badges Mobile ──────────────────────────────── */
@media (max-width: 768px) {
  .chip {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.5rem !important;
  }

  .badge-pill {
    font-size: 0.65rem !important;
  }

  .meta-row {
    gap: 0.35rem !important;
  }
}

/* ── Tabs Mobile ────────────────────────────────────────── */
@media (max-width: 768px) {
  .tabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 0.75rem;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tabs .tab, .tabs a, .tabs button {
    white-space: nowrap !important;
    flex-shrink: 0;
    padding: 0.6rem 1rem !important;
    font-size: 0.85rem !important;
  }
}

/* ── Progress Bars Mobile ───────────────────────────────── */
@media (max-width: 768px) {
  .progress-container, .progress-bar-bg {
    height: 8px !important;
    border-radius: 4px !important;
  }
}

/* ── Flash Messages Mobile ──────────────────────────────── */
@media (max-width: 768px) {
  .flash {
    margin-bottom: 0.75rem !important;
  }

  .flash-item {
    padding: 0.6rem 0.75rem !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
  }
}

/* ── Chatbot Widget Mobile ──────────────────────────────── */
@media (max-width: 768px) {
  .chatbot-container {
    width: 100% !important;
    max-width: 100% !important;
    right: 0 !important;
    bottom: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    max-height: 85vh !important;
  }

  .chatbot-toggle {
    right: 16px !important;
    bottom: 16px !important;
    width: 52px !important;
    height: 52px !important;
  }
}

/* ── Utility: Responsive Helpers ─────────────────────────── */
/* Hide on mobile */
@media (max-width: 768px) {
  .hide-mobile, .desktop-only { display: none !important; }
}

/* Hide on tablet and below */
@media (max-width: 1024px) {
  .hide-tablet { display: none !important; }
}

/* Show only on mobile */
@media (min-width: 769px) {
  .mobile-only, .show-mobile { display: none !important; }
}

/* ── Responsive Typography ──────────────────────────────── */
@media (max-width: 768px) {
  h1, .text-2xl { font-size: 1.25rem !important; }
  h2, .text-xl { font-size: 1.125rem !important; }
  h3, .text-lg { font-size: 1rem !important; }

  /* Smaller text for dense data */
  .text-sm, small { font-size: 0.8rem !important; }
  .text-xs { font-size: 0.7rem !important; }
}

/* ── Tailwind Override for Mobile ────────────────────────── */
@media (max-width: 768px) {
  /* Fix Tailwind grid classes that don't collapse on mobile */
  .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-5, .grid-cols-6 {
    grid-template-columns: 1fr !important;
  }

  .sm\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  /* Flex-wrap on mobile */
  .flex-nowrap {
    flex-wrap: wrap !important;
  }

  /* Gap reductions */
  .gap-6 { gap: 0.75rem !important; }
  .gap-8 { gap: 1rem !important; }

  /* Padding reductions */
  .p-6, .p-8 { padding: 0.75rem !important; }
  .px-6, .px-8 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
  .py-6, .py-8 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
}

@media (min-width: 481px) and (max-width: 768px) {
  .grid-cols-2, .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ── Standalone PWA Styles ──────────────────────────────── */
@media all and (display-mode: standalone) {
  /* When running as installed PWA */
  .navbar {
    padding-top: env(safe-area-inset-top) !important;
  }

  /* Hide browser-specific UI elements */
  .nav-logout {
    margin-right: env(safe-area-inset-right);
  }
}

/* ── Pull-to-Refresh Indicator ──────────────────────────── */
.pull-refresh-indicator {
  display: none;
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.pull-refresh-indicator.active {
  display: flex;
}

.pull-refresh-indicator .spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e5e7eb;
  border-top-color: #163988;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Bottom Navigation Bar (Mobile App-Like) ────────────── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  border-top: 1px solid #e5e7eb;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex !important;
    align-items: center;
    justify-content: space-around;
  }

  /* Add padding to content bottom so it's not hidden by bottom nav */
  .content {
    padding-bottom: 72px !important;
  }

  .hrms-content {
    padding-bottom: 72px !important;
  }
}

.mobile-bottom-nav .bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0;
  color: #6b7280;
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  flex: 1;
  min-height: 44px;
  transition: color 0.2s;
  position: relative;
}

.mobile-bottom-nav .bottom-nav-item i,
.mobile-bottom-nav .bottom-nav-item svg {
  width: 22px;
  height: 22px;
}

.mobile-bottom-nav .bottom-nav-item.active {
  color: #163988;
}

.mobile-bottom-nav .bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: #163988;
  border-radius: 0 0 3px 3px;
}

.mobile-bottom-nav .bottom-nav-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 16px);
  background: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ── Swipeable Views Indicator ──────────────────────────── */
.swipe-indicator {
  display: none;
}

@media (max-width: 768px) {
  .swipe-indicator {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px 0;
    margin-bottom: 8px;
  }

  .swipe-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    transition: all 0.3s;
  }

  .swipe-dot.active {
    background: #163988;
    width: 24px;
    border-radius: 4px;
  }
}

/* ── Floating Action Button ─────────────────────────────── */
.fab {
  display: none;
}

@media (max-width: 768px) {
  .fab {
    display: flex;
    position: fixed;
    bottom: 76px; /* above bottom nav */
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #163988;
    color: white;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(22, 57, 136, 0.35);
    z-index: 900;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .fab:active {
    transform: scale(0.92);
  }

  .fab i, .fab svg {
    width: 24px;
    height: 24px;
  }
}

/* ── Skeleton Loading Placeholders ──────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 80%;
}

.skeleton-title {
  height: 20px;
  margin-bottom: 12px;
  width: 60%;
}

.skeleton-card {
  height: 120px;
  margin-bottom: 12px;
}

/* ── Smooth Page Transitions ────────────────────────────── */
@media (max-width: 768px) {
  .content {
    animation: fadeInUp 0.25s ease-out;
  }

  @keyframes fadeInUp {
    from {
      opacity: 0.8;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ── Print Reset ────────────────────────────────────────── */
@media print {
  .mobile-bottom-nav,
  .fab,
  .pull-refresh-indicator,
  .chatbot-toggle,
  .chatbot-container,
  .menu-overlay {
    display: none !important;
  }
}
