/* ============================================================
   OfferSwap Mobile App CSS — Native App-Like Experience
   Transforms the web app into a true mobile app feel
   ============================================================ */

/* ---- CSS Variables for App Theme ---- */
:root {
  --app-primary: #0095C8;
  --app-primary-dark: #0077A3;
  --app-accent: #facc15;
  --app-accent-dark: #e6b800;
  --app-bg: #f3f4f6;
  --app-card-bg: #ffffff;
  --app-text: #1f2937;
  --app-text-secondary: #6b7280;
  --app-border: #e5e7eb;
  --app-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --app-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --app-radius: 16px;
  --app-radius-sm: 10px;
  --app-radius-xs: 8px;
  --app-tab-height: 56px;
  --app-header-height: 56px;
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-safe-top: env(safe-area-inset-top, 0px);
  --app-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
* {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--app-bg);
  color: var(--app-text);
  overscroll-behavior: none;
}

/* ============================================================
   MOBILE BOTTOM TAB BAR — Like a real app
   ============================================================ */
@media (max-width: 1023px) {
  /* Add padding to main content to account for fixed bottom tab */
  main {
    padding-bottom: calc(var(--app-tab-height) + var(--app-safe-bottom) + 8px) !important;
  }

  /* Adjust the main padding from base.html */
  main .p-4, main .p-6, main .p-8 {
    padding-bottom: calc(var(--app-tab-height) + var(--app-safe-bottom) + 16px) !important;
  }
}

.app-tab-bar {
  display: none;
}

@media (max-width: 1023px) {
  .app-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: calc(var(--app-tab-height) + var(--app-safe-bottom));
    padding-bottom: var(--app-safe-bottom);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.05);
    justify-content: space-around;
    align-items: center;
  }

  .app-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    padding: 4px 0;
    text-decoration: none;
    color: var(--app-text-secondary);
    transition: color var(--app-transition);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .app-tab-item:active {
    transform: scale(0.92);
  }

  .app-tab-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    transition: transform var(--app-transition);
  }

  .app-tab-item span {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
    line-height: 1.2;
  }

  .app-tab-item.active {
    color: var(--app-primary);
  }

  .app-tab-item.active svg {
    transform: scale(1.05);
  }

  .app-tab-item .tab-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    margin-right: -20px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    border: 2px solid white;
  }

  /* Tab bar create button (prominent) */
  .app-tab-create {
    position: relative;
    top: -12px;
  }

  .app-tab-create .create-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--app-accent), var(--app-accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(250, 204, 21, 0.4);
    transition: transform var(--app-transition), box-shadow var(--app-transition);
    color: #1f2937;
  }

  .app-tab-create .create-btn:active {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(250, 204, 21, 0.3);
  }

  .app-tab-create .create-btn svg {
    width: 26px;
    height: 26px;
    margin-bottom: 0;
  }

  .app-tab-create span {
    margin-top: 4px;
  }
}

/* ============================================================
   APP-HEADER — Compact mobile header
   ============================================================ */
@media (max-width: 1023px) {
  header.fixed {
    height: var(--app-header-height) !important;
  }

  header.fixed > div {
    height: var(--app-header-height) !important;
  }

  header.fixed .flex.items-center.justify-between {
    height: var(--app-header-height) !important;
  }

  header.fixed .h-16 {
    height: var(--app-header-height) !important;
  }

  /* Hide desktop search on mobile */
  header .hidden.md\\:block {
    display: none !important;
  }
}

/* ============================================================
   APP CARDS — Native app card style
   ============================================================ */
.app-card {
  background: var(--app-card-bg);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  overflow: hidden;
  transition: transform var(--app-transition), box-shadow var(--app-transition);
  margin-bottom: 12px;
}

.app-card:active {
  transform: scale(0.98);
}

.app-card-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.app-card-body {
  padding: 16px;
}

.app-card-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--app-text);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-card-subtitle {
  font-size: 13px;
  color: var(--app-text-secondary);
  margin-bottom: 8px;
}

.app-card-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--app-primary);
}

/* Offer card specific mobile styles */
@media (max-width: 640px) {
  .offer-card-mobile {
    border-radius: var(--app-radius-sm);
    overflow: hidden;
    background: white;
    box-shadow: var(--app-shadow);
    margin-bottom: 12px;
    transition: transform 0.2s ease;
  }

  .offer-card-mobile:active {
    transform: scale(0.97);
  }

  .offer-card-mobile .offer-image-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: linear-gradient(135deg, #374151, #1f2937);
    overflow: hidden;
  }

  .offer-card-mobile .offer-image-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .offer-card-mobile .offer-image-wrap .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.7));
  }

  .offer-card-mobile .offer-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    color: white;
    z-index: 2;
  }

  .offer-card-mobile .offer-content .offer-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
  }

  .offer-card-mobile .offer-content .offer-price-tag {
    font-size: 22px;
    font-weight: 800;
    color: var(--app-accent);
  }

  .offer-card-mobile .offer-content .offer-meta {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
  }
}

/* ============================================================
   DESKTOP OFFER CARDS — lg: screens and up
   Clean product card layout for cases with/without images
   ============================================================ */
@media (min-width: 1024px) {
  .offer-card-desktop {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  .offer-card-desktop:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  }

  /* Card with image */
  .offer-card-desktop .card-image-section {
    position: relative;
    width: 100%;
    padding-top: 60%; /* ~5:3 aspect ratio */
    overflow: hidden;
    background: linear-gradient(135deg, #374151, #1f2937);
    flex-shrink: 0;
  }

  .offer-card-desktop .card-image-section img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
  }

  .offer-card-desktop:hover .card-image-section img {
    transform: scale(1.05);
  }

  .offer-card-desktop .card-image-section .image-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 50%);
    z-index: 1;
  }

  /* Card without image — gradient + icon */
  .offer-card-desktop .card-no-image {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 50%, #1e3a5f 100%);
    z-index: 1;
  }

  .offer-card-desktop .card-no-image svg {
    width: 56px;
    height: 56px;
    opacity: 0.25;
    margin-bottom: 8px;
  }

  .offer-card-desktop .card-no-image .no-image-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.3);
  }

  /* Card badge on image */
  .offer-card-desktop .card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
  }

  .offer-card-desktop .card-badge span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  }

  /* Card content (below image) */
  .offer-card-desktop .card-body {
    padding: 16px 20px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
  }

  .offer-card-desktop .card-body .card-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9ca3af;
    margin-bottom: 2px;
  }

  .offer-card-desktop .card-body .card-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: #1f2937;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .offer-card-desktop .card-body .card-price {
    font-size: 22px;
    font-weight: 800;
    color: #0095C8;
    margin-bottom: 4px;
  }

  .offer-card-desktop .card-body .card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #9ca3af;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
  }

  .offer-card-desktop .card-body .card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .offer-card-desktop .card-body .card-meta svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }

  .offer-card-desktop .card-body .card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
  }

  .offer-card-desktop .card-actions .action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fef3c7;
    color: #92400e;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
  }

  .offer-card-desktop .card-actions .action-btn:hover {
    background: #fde68a;
    transform: scale(1.1);
  }

  .offer-card-desktop .card-actions .action-btn svg {
    width: 18px;
    height: 18px;
  }

  .offer-card-desktop .card-actions .action-btn.wishlisted {
    background: #fde68a;
    opacity: 0.6;
    cursor: default;
  }

  .offer-card-desktop .card-actions .action-btn.wishlisted:hover {
    transform: none;
  }

  /* Pending responses indicator */
  .offer-card-desktop .pending-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(250, 204, 21, 0.15);
    color: #92400e;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
  }

  .offer-card-desktop .pending-badge .pulse-dot {
    width: 6px;
    height: 6px;
    background: #f59e0b;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
  }

  @keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
  }
}

/* ============================================================
   APP LIST ITEMS — Native iOS/Android list style
   ============================================================ */
.app-list {
  background: white;
  border-radius: var(--app-radius);
  overflow: hidden;
  box-shadow: var(--app-shadow);
}

.app-list-item {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 0.5px solid var(--app-border);
  transition: background 0.15s ease;
  cursor: pointer;
}

.app-list-item:last-child {
  border-bottom: none;
}

.app-list-item:active {
  background: #f9fafb;
}

.app-list-item .list-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  flex-shrink: 0;
}

.app-list-item .list-content {
  flex: 1;
  min-width: 0;
}

.app-list-item .list-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--app-text);
}

.app-list-item .list-subtitle {
  font-size: 13px;
  color: var(--app-text-secondary);
  margin-top: 2px;
}

.app-list-item .list-chevron {
  color: #d1d5db;
  flex-shrink: 0;
}

/* ============================================================
   APP BUTTONS — Native app button styles
   ============================================================ */
.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
  min-height: 48px;
}

.app-btn:active {
  transform: scale(0.96);
}

.app-btn-primary {
  background: var(--app-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(0, 149, 200, 0.3);
}

.app-btn-accent {
  background: linear-gradient(135deg, var(--app-accent), var(--app-accent-dark));
  color: #1f2937;
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.3);
}

.app-btn-danger {
  background: #ef4444;
  color: white;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.app-btn-sm {
  padding: 8px 16px;
  font-size: 14px;
  min-height: 36px;
  border-radius: 10px;
}

.app-btn-lg {
  padding: 16px 32px;
  font-size: 18px;
  border-radius: 14px;
}

/* ============================================================
   APP FLOATING ACTION BUTTON (FAB)
   ============================================================ */
.app-fab {
  position: fixed;
  bottom: calc(var(--app-tab-height) + var(--app-safe-bottom) + 20px);
  right: 20px;
  z-index: 100;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 149, 200, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  border: none;
}

.app-fab:active {
  transform: scale(0.9);
  box-shadow: 0 3px 10px rgba(0, 149, 200, 0.3);
}

.app-fab svg {
  width: 24px;
  height: 24px;
}

/* ============================================================
   APP PULL TO REFRESH INDICATOR (visual)
   ============================================================ */
.app-pull-indicator {
  text-align: center;
  padding: 16px;
  color: var(--app-text-secondary);
  font-size: 13px;
  display: none;
}

/* ============================================================
   APP TOGGLE / SWITCH — iOS style
   ============================================================ */
.app-toggle {
  position: relative;
  width: 50px;
  height: 30px;
  cursor: pointer;
}

.app-toggle input {
  display: none;
}

.app-toggle .toggle-track {
  position: absolute;
  inset: 0;
  background: #e5e7eb;
  border-radius: 15px;
  transition: background 0.3s ease;
}

.app-toggle input:checked + .toggle-track {
  background: var(--app-primary);
}

.app-toggle .toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.app-toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

/* ============================================================
   APP MODAL / SHEET — Bottom sheet style
   ============================================================ */
.app-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.app-sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.app-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  background: white;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  padding-bottom: calc(20px + var(--app-safe-bottom));
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 80vh;
  overflow-y: auto;
}

.app-sheet.open {
  transform: translateY(0);
}

.app-sheet-handle {
  width: 36px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 0 auto 16px;
}

/* ============================================================
   APP SECTION HEADER
   ============================================================ */
.app-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 12px;
}

.app-section-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--app-text);
}

.app-section-header a {
  font-size: 14px;
  font-weight: 600;
  color: var(--app-primary);
}

/* ============================================================
   APP STATS CARD (Dashboard)
   ============================================================ */
.app-stat-card {
  background: white;
  border-radius: var(--app-radius-sm);
  padding: 16px;
  box-shadow: var(--app-shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.app-stat-card .stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--app-text);
}

.app-stat-card .stat-label {
  font-size: 13px;
  color: var(--app-text-secondary);
  font-weight: 500;
}

.app-stat-card .stat-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

/* ============================================================
   APP BADGE / PILL
   ============================================================ */
.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.app-badge-success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.app-badge-warning {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.app-badge-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.app-badge-info {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

/* ============================================================
   APP TOAST / SNACKBAR
   ============================================================ */
.app-toast {
  position: fixed;
  bottom: calc(var(--app-tab-height) + var(--app-safe-bottom) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1f2937;
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 99999;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: all 0.4s ease;
  white-space: nowrap;
  max-width: 90%;
  text-align: center;
}

.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   APP SEARCH BAR
   ============================================================ */
.app-search {
  display: flex;
  align-items: center;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 10px 16px;
  margin: 0;
  transition: box-shadow 0.2s ease;
}

.app-search:focus-within {
  box-shadow: 0 0 0 3px rgba(0, 149, 200, 0.2);
  background: white;
}

.app-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  outline: none;
  padding: 0 8px;
  color: var(--app-text);
}

.app-search input::placeholder {
  color: #9ca3af;
}

.app-search svg {
  width: 20px;
  height: 20px;
  color: #9ca3af;
  flex-shrink: 0;
}

/* ============================================================
   APP DIVIDER
   ============================================================ */
.app-divider {
  height: 0.5px;
  background: var(--app-border);
  margin: 16px 0;
}

/* ============================================================
   SKELETON LOADING (native app shimmer)
   ============================================================ */
.app-skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

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

/* ============================================================
   PAGE TRANSITIONS (native push animation)
   ============================================================ */
.app-page-enter {
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.app-slide-up {
  animation: slideUp 0.4s ease;
}

/* ============================================================
   NATIVE SCROLLING — momentum for iOS
   ============================================================ */
.app-scroll {
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
}

/* Hide scrollbar on mobile */
@media (max-width: 1023px) {
  ::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}

/* ============================================================
   TOUCH FEEDBACK
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
  .touchable:active {
    transform: scale(0.97);
    opacity: 0.9;
  }

  /* Remove hover effects on touch devices */
  .hover\:shadow-2xl:hover {
    box-shadow: var(--app-shadow) !important;
  }

  .hover\:scale-110:hover {
    transform: none !important;
  }
}

/* ============================================================
   MOBILE-FIRST GRID FOR OFFERS (app feed style)
   ============================================================ */
@media (max-width: 639px) {
  .offer-feed-mobile .relative.bg-white {
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  }

  .offer-feed-mobile .relative.bg-white .p-4 {
    padding: 14px !important;
  }
}

/* ============================================================
   APP PAGINATION — native style
   ============================================================ */
.app-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px 0;
}

.app-pagination a,
.app-pagination span {
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.app-pagination a {
  background: white;
  color: var(--app-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.app-pagination a:active {
  transform: scale(0.92);
}

.app-pagination span.current {
  background: var(--app-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 149, 200, 0.3);
}

/* ============================================================
   MOBILE ICON SIZE CONSISTENCY (mobile only)
   Prevents oversized icons — only on small screens
   ============================================================ */
@media (max-width: 1023px) {
  /* Cap decorative inline SVGs in content areas */
  main svg.w-8.h-8,
  main svg.h-8.w-8 {
    max-width: 28px !important;
    max-height: 28px !important;
  }

  main svg.w-10.h-10,
  main svg.h-10.w-10 {
    max-width: 32px !important;
    max-height: 32px !important;
  }

  /* Cap empty-state icons */
  main svg.w-16.h-16,
  main svg.h-16.w-16 {
    max-width: 48px !important;
    max-height: 48px !important;
  }

  /* Cap action button containers at page bottoms */
  main .w-12.h-12.rounded-full,
  main .h-12.w-12.rounded-full {
    max-width: 44px !important;
    max-height: 44px !important;
  }

  /* Quick link buttons */
  .quick-link-btn svg,
  a[class*="rounded-full"] svg.w-8.h-8,
  a[class*="rounded-full"] svg.h-8.w-8 {
    max-width: 24px !important;
    max-height: 24px !important;
  }

  /* Image placeholder icons in cards */
  .overflow-hidden svg.w-16.h-16,
  .h-56 svg.w-16.h-16 {
    max-width: 40px !important;
    max-height: 40px !important;
  }
}

/* ============================================================
   RESPONSIVE FIXES FOR LARGER SCREENS
   When tab bar is hidden, restore normal padding
   ============================================================ */
@media (min-width: 1024px) {
  main {
    padding-bottom: 2rem !important;
  }
}

/* ============================================================
   APP HERO SECTION (for landing page)
   ============================================================ */
.app-hero {
  background: linear-gradient(135deg, #0077A3 0%, #0095C8 50%, #00B4D8 100%);
  padding: 24px 20px;
  border-radius: 0 0 24px 24px;
  color: white;
  position: relative;
  overflow: hidden;
}

.app-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.app-hero h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
  position: relative;
}

.app-hero p {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 16px;
  position: relative;
}

.app-hero .hero-actions {
  display: flex;
  gap: 10px;
  position: relative;
}

.app-hero .hero-btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.app-hero .hero-btn:active {
  transform: scale(0.95);
}

.app-hero .hero-btn-primary {
  background: var(--app-accent);
  color: #1f2937;
}

.app-hero .hero-btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  backdrop-filter: blur(10px);
}
