/**
 * PakMakan Real Estate Portal - Native Mobile App Experience
 * Automatically switches mobile browsers to a native iOS/Android App UI
 */

/* Hide mobile app elements on desktop */
@media (min-width: 769px) {
  .mobile-app-bottom-bar,
  .mobile-app-top-header,
  .mobile-sticky-actions,
  .mobile-only {
    display: none !important;
  }
}

/* Dedicated Mobile View (Screens <= 768px) */
@media (max-width: 768px) {
  body {
    /* Safe padding so bottom nav never cuts off content or forms */
    padding-bottom: 85px !important;
    background-color: #f7f9f8;
  }

  /* Hide bulky desktop header elements on mobile */
  .desktop-only,
  .top-utility-bar {
    display: none !important;
  }

  /* Sleek Native Mobile App Top Header */
  .mobile-app-top-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: sticky;
    top: 0;
    z-index: 1020;
    border-bottom: 1px solid rgba(0, 79, 39, 0.08);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
  }

  .mobile-app-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-app-brand img {
    height: 34px;
    width: auto;
  }

  .mobile-app-brand .brand-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    letter-spacing: -0.5px;
  }

  .mobile-app-brand .brand-subtitle {
    font-size: 10px;
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
  }

  /* Fixed Native Bottom App Navigation Bar */
  .mobile-app-bottom-bar {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 68px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid #e5eaf0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 1060;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #64748b;
    text-decoration: none !important;
    transition: all 0.2s ease;
    padding: 6px 0;
    position: relative;
    user-select: none;
  }

  .mobile-nav-item .material-symbols-outlined {
    font-size: 24px;
    transition: transform 0.2s ease, color 0.2s ease;
  }

  .mobile-nav-item span.nav-label {
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
    line-height: 1;
  }

  .mobile-nav-item.active {
    color: var(--primary) !important;
  }

  .mobile-nav-item.active .material-symbols-outlined {
    transform: translateY(-2px);
    font-variation-settings: 'FILL' 1;
  }

  /* Elevated Central "Add Listing / Post" Floating Button */
  .mobile-nav-fab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    position: relative;
    top: -14px;
    flex: 1;
  }

  .fab-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #004f27 0%, #0d6938 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 79, 39, 0.35);
    border: 3.5px solid #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .fab-circle .material-symbols-outlined {
    font-size: 28px;
  }

  .mobile-nav-fab:active .fab-circle {
    transform: scale(0.92);
  }

  .mobile-nav-fab span.nav-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 2px;
  }

  /* Mobile Property Cards Enhancements */
  .property-card {
    border-radius: 16px !important;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  }

  .card-img-wrap {
    height: 200px !important;
  }

  .property-price {
    font-size: 20px;
  }

  /* Mobile Hero Section Optimization */
  .hero-pakmakan {
    padding: 30px 16px 40px !important;
    border-radius: 0 0 24px 24px;
  }

  .search-matrix-card {
    margin-top: 20px;
    padding: 16px;
    border-radius: 18px;
  }

  /* Sticky Bottom Bar on Property Detail Page */
  .mobile-sticky-actions {
    display: flex !important;
    position: fixed;
    bottom: 68px; /* sits right above bottom nav */
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    padding: 10px 16px;
    border-top: 1px solid #e2e8f0;
    z-index: 1055;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-sticky-price {
    display: flex;
    flex-direction: column;
  }

  .mobile-sticky-price .label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
  }

  .mobile-sticky-price .val {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
  }

  .mobile-sticky-buttons {
    display: flex;
    gap: 8px;
  }

  .btn-whatsapp-mobile {
    background-color: #25D366;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .btn-call-mobile {
    background-color: var(--primary);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* Compact Footer on Mobile */
  .site-footer {
    padding: 30px 16px 40px !important;
    margin-top: 30px;
    border-radius: 20px 20px 0 0;
  }
}
