/* ============================================
   GHAR.PK - MOBILE RESPONSIVE IMPROVEMENTS
   ============================================ */

/* Fix dashboard layout on mobile */
@media (max-width: 768px) {
  .dashboard-layout {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .dashboard-sidebar {
    position: relative;
    top: 0 !important;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  .sidebar-item {
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .stat-box {
    grid-template-columns: 1fr !important;
  }

  .stat-item {
    padding: 1rem !important;
  }

  .stat-value {
    font-size: 2rem !important;
  }

  .plan-section {
    padding: 1.5rem !important;
  }

  .upgrade-btn {
    width: 100% !important;
  }
}

/* Fix post-property form on mobile */
@media (max-width: 768px) {
  .post-layout {
    padding: 1rem !important;
  }

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

  .form-group.full-width {
    grid-column: 1 !important;
  }

  .form-section-title {
    font-size: 1.1rem !important;
    padding: 0.75rem !important;
  }

  .steps-indicator {
    gap: 0.5rem !important;
    padding: 1rem !important;
  }

  .step-item {
    flex-shrink: 0;
  }

  .step-circle {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.8rem !important;
  }

  .step-label {
    font-size: 0.7rem !important;
    display: none;
  }

  .step-connector {
    width: 8px !important;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px !important; /* Prevents zoom on iOS */
  }

  .btn-next,
  .btn-submit {
    width: 100% !important;
    padding: 12px 24px !important;
    font-size: 1rem !important;
  }

  .step-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .step-actions button {
    flex: 1;
    min-width: 120px;
  }
}

/* Fix pricing page on mobile */
@media (max-width: 768px) {
  .pricing-toggle {
    margin-bottom: 1.5rem !important;
  }

  .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .pricing-card {
    padding: 1.5rem !important;
  }

  .pricing-card-header {
    margin-bottom: 1rem !important;
  }

  .pricing-card-price {
    font-size: 1.8rem !important;
  }

  .pricing-card-period {
    font-size: 0.85rem !important;
  }

  .pricing-card-features {
    gap: 0.5rem;
    margin-bottom: 1rem !important;
  }

  .pricing-card-feature {
    font-size: 0.85rem !important;
    padding: 0.5rem 0 !important;
  }

  .pricing-card-btn {
    width: 100% !important;
    padding: 12px !important;
    font-size: 0.95rem !important;
  }
}

/* Fix login/signup forms on mobile */
@media (max-width: 768px) {
  .auth-container {
    padding: 1rem !important;
  }

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

  .form-group {
    margin-bottom: 1rem !important;
  }

  .auth-button {
    width: 100% !important;
    padding: 12px 16px !important;
    font-size: 1rem !important;
  }

  .auth-divider {
    margin: 1.5rem 0 !important;
  }

  .social-buttons {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .social-btn {
    width: 100% !important;
  }
}

/* Fix listings layout on mobile */
@media (max-width: 768px) {
  .listings-page {
    display: grid;
    grid-template-columns: 1fr !important;
  }

  aside {
    grid-column: 1 !important;
    max-height: 400px;
    overflow-y: auto;
  }

  main {
    grid-column: 1 !important;
  }

  .listings-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .property-card {
    max-width: 100% !important;
  }

  .property-card-img {
    height: 180px !important;
  }

  .filter-select {
    flex: 1 1 48% !important;
  }

  .filter-bar {
    padding: 0.75rem !important;
  }
}

/* Fix navbar on mobile */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 0 !important;
  }

  .nav-container {
    padding: 0 1rem !important;
  }

  .nav-logo {
    font-size: 1.2rem !important;
  }

  .nav-links {
    display: none;
  }

  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    z-index: 999;
  }

  .mobile-menu-btn {
    display: block !important;
  }

  .nav-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav-actions a,
  .nav-actions button {
    width: 100%;
    font-size: 0.9rem !important;
  }
}

/* Fix hero section on mobile */
@media (max-width: 768px) {
  .hero-content {
    padding: 2rem 1rem !important;
  }

  .hero-title {
    font-size: 1.8rem !important;
    line-height: 1.3 !important;
  }

  .hero-subtitle {
    font-size: 0.95rem !important;
    margin-bottom: 1.5rem !important;
  }

  .search-box {
    padding: 1rem !important;
  }

  .search-form {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .search-field {
    width: 100% !important;
  }

  .search-btn {
    width: 100% !important;
  }

  .hero-stats {
    flex-direction: column !important;
    padding: 1.5rem 1rem !important;
    gap: 1rem !important;
  }

  .stat-item {
    padding: 0.75rem !important;
  }

  .stat-number {
    font-size: 1.8rem !important;
  }

  .stat-label {
    font-size: 0.8rem !important;
  }

  .stat-divider {
    height: 0 !important;
  }
}

/* Fix property detail page on mobile */
@media (max-width: 768px) {
  .detail-layout {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .detail-gallery {
    gap: 0.5rem !important;
  }

  .gallery-main {
    height: 200px !important;
  }

  .gallery-thumb {
    width: 50px !important;
    height: 50px !important;
  }

  .detail-price {
    font-size: 1.5rem !important;
  }

  .amenity-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  .amenity-item {
    font-size: 0.85rem !important;
    padding: 0.5rem !important;
  }
}

/* General improvements for all mobile views */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  h1 {
    font-size: 1.5rem !important;
  }

  h2 {
    font-size: 1.3rem !important;
  }

  h3 {
    font-size: 1.1rem !important;
  }

  .btn-primary,
  .btn-ghost,
  button {
    padding: 10px 16px !important;
    font-size: 0.95rem !important;
  }

  .section {
    padding: 2rem 0 !important;
  }

  .section-title {
    font-size: 1.5rem !important;
  }

  .section-subtitle {
    font-size: 0.95rem !important;
  }

  /* Prevent horizontal scroll */
  body,
  html {
    overflow-x: hidden;
  }

  /* Better touch targets */
  button,
  a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Improved spacing */
  .dashboard-card,
  .plan-section {
    margin-bottom: 1rem !important;
  }

  /* Fix modals on mobile */
  .modal {
    width: 90% !important;
    max-width: 90vw !important;
  }

  .modal-content {
    padding: 1.5rem !important;
  }
}

/* High resolution mobile fixes */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.4rem !important;
  }

  .search-field input,
  .search-field select {
    font-size: 16px !important;
  }

  .pricing-card-price {
    font-size: 1.5rem !important;
  }

  .stat-number {
    font-size: 1.5rem !important;
  }

  .detail-price {
    font-size: 1.3rem !important;
  }

  .sidebar-item {
    font-size: 0.8rem !important;
    padding: 8px 12px !important;
  }

  .step-circle {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.7rem !important;
  }
}
