/* Mobile Responsive Foundation - Phase 1 */

/* Touch-friendly targets and base improvements */
@media (max-width: 768px) {
  
  /* Base touch-friendly targets */
  .btn, .btn-primary, .btn-secondary, .btn-action, .navbar-toggler {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 12px 16px !important;
    font-size: 16px !important; /* Prevent zoom on iOS */
  }
  
  /* Form inputs touch-friendly */
  input[type="text"], input[type="email"], input[type="password"], 
  input[type="search"], textarea, select {
    min-height: 44px !important;
    font-size: 16px !important; /* Prevent zoom on iOS */
    padding: 12px 16px !important;
  }
  
  /* Navigation improvements */
  .navbar .nav-link {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
  }
  
  .navbar-collapse {
    margin-top: 10px;
  }
  
  /* Container spacing improvements */
  .container, .container-fluid {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  
  /* Text scaling improvements */
  body {
    font-size: 16px !important;
    line-height: 1.5 !important;
  }
  
  h1 {
    font-size: 2rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1rem !important;
  }
  
  h2 {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.875rem !important;
  }
  
  h3 {
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.75rem !important;
  }
  
  h4 {
    font-size: 1.25rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.625rem !important;
  }
  
  p, li {
    font-size: 16px !important;
    line-height: 1.6 !important;
    margin-bottom: 1rem !important;
  }
  
  /* Card and content improvements */
  .card, .feature-card, .style-card {
    margin-bottom: 16px !important;
    border-radius: 12px !important;
  }
  
  .card-body {
    padding: 16px !important;
  }
  
  /* Grid improvements */
  .row > div {
    margin-bottom: 16px;
  }
  
  /* Image responsive improvements */
  img {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Building detail page sticky sidebar fix */
  .building-detail .sidebar {
    position: static !important;
    width: 100% !important;
    margin-top: 20px !important;
  }
  
  /* Modal improvements */
  .modal-dialog {
    margin: 16px !important;
  }
  
  .modal-content {
    border-radius: 12px !important;
  }
  
  .modal-header, .modal-body, .modal-footer {
    padding: 16px !important;
  }
  
  /* Table improvements */
  .table-responsive {
    font-size: 14px;
  }
  
  /* Badge improvements */
  .badge, .style-pill {
    font-size: 14px !important;
    padding: 6px 12px !important;
    margin: 2px !important;
  }
  
  /* Scroll improvements */
  .scroll-row, .horizontal-scroll {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .scroll-row::-webkit-scrollbar,
  .horizontal-scroll::-webkit-scrollbar {
    display: none;
  }
  
  /* Fix Bootstrap responsive utilities */
  .d-md-flex {
    display: block !important;
  }
  
  /* Navbar brand improvement */
  .navbar-brand {
    font-size: 18px !important;
    padding: 12px 0 !important;
  }
  
  /* Spacing utilities for mobile */
  .mt-mobile {
    margin-top: 16px !important;
  }
  
  .mb-mobile {
    margin-bottom: 16px !important;
  }
  
  .p-mobile {
    padding: 16px !important;
  }
  
  /* Hide elements that don't work well on mobile */
  .d-none-mobile {
    display: none !important;
  }
  
  /* Architecture Explorer specific improvements */
  .hero-row .col-md-5,
  .hero-row .col-md-7 {
    margin-bottom: 20px !important;
  }
  
  .building-card {
    min-width: 280px !important;
    max-width: 300px !important;
  }
  
  .building-card img {
    height: 200px !important;
  }
  
  /* Style badge improvements */
  .style-badge-list {
    margin: 16px 0 !important;
  }
  
  .style-badge-item {
    margin-bottom: 16px !important;
  }
  
  .confidence-bar {
    height: 10px !important;
  }
  
  /* Action buttons improvements */
  .action-buttons {
    flex-direction: column !important;
    gap: 12px !important;
    margin-top: 16px !important;
  }
  
  .btn-action {
    width: 100% !important;
    justify-content: center !important;
  }
  
  /* Address container improvements */
  .address-container {
    margin: 20px -16px 0 -16px !important;
    border-radius: 0 !important;
    padding: 16px !important;
  }
  
  .address-container .form-control {
    margin-bottom: 12px !important;
  }
  
  .btn-address-update {
    width: 100% !important;
    padding: 12px !important;
    font-size: 16px !important;
  }
  
  /* Places index improvements */
  .filter-bar-inner {
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  .search-box {
    min-width: unset !important;
    width: 100% !important;
  }
  
  .filter-tabs {
    justify-content: center !important;
    overflow-x: auto !important;
  }
  
  .sort-select {
    width: 100% !important;
  }
  
  .sort-select select {
    width: 100% !important;
  }
  
  /* Home page improvements */
  .landing-section {
    flex-direction: column !important;
    text-align: center !important;
    padding: 20px 0 !important;
  }
  
  .landing-section img {
    width: 50% !important;
    margin-top: 20px !important;
  }
  
  /* Building library improvements */
  .image-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 16px !important;
    padding: 0 !important;
  }
  
  .stat-card {
    width: 100% !important;
    margin-bottom: 16px !important;
  }
  
  .parent-container {
    flex-direction: column !important;
    margin: 16px 0 !important;
  }
  
  /* Search and filter improvements */
  .form-inline .form-control {
    width: 100% !important;
    margin-bottom: 12px !important;
  }
  
  .form-inline .btn {
    width: 100% !important;
  }
  
  .button-container {
    margin-bottom: 20px !important;
  }
  
  /* Lightbox improvements */
  .lightbox-overlay img {
    max-width: 95vw !important;
    max-height: 80vh !important;
  }
  
}

/* Extra small devices (phones in portrait) */
@media (max-width: 576px) {
  
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  h1 {
    font-size: 1.75rem !important;
  }
  
  h2 {
    font-size: 1.5rem !important;
  }
  
  /* Make cards full width with minimal margins */
  .card, .feature-card, .style-card {
    margin-left: -12px !important;
    margin-right: -12px !important;
    border-radius: 0 !important;
  }
  
  /* Building cards smaller */
  .building-card {
    min-width: 240px !important;
    max-width: 260px !important;
  }
  
  /* Reduce padding on small screens */
  .p-mobile {
    padding: 12px !important;
  }
  
  /* Hero stats stack vertically on very small screens */
  .hero-stats {
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  .hero-stat-divider {
    display: none !important;
  }
  
  /* Featured cards smaller */
  .featured-image {
    height: 180px !important;
  }
  
  .featured-content {
    padding: 16px !important;
  }
  
  .featured-content h3 {
    font-size: 1.25rem !important;
  }
  
}

/* Landscape phones */
@media (max-width: 768px) and (orientation: landscape) {
  
  /* Adjust hero section for landscape */
  .hero-section {
    padding: 40px 0 30px !important;
  }
  
  .hero-section h1 {
    font-size: 2rem !important;
  }
  
  /* Make featured cards shorter in landscape */
  .featured-image {
    height: 200px !important;
  }
  
}

/* High DPI screens - make touch targets even larger */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
  
  .btn, .btn-primary, .btn-secondary, .btn-action {
    min-height: 48px !important;
    min-width: 48px !important;
  }
  
  input[type="text"], input[type="email"], input[type="password"], 
  input[type="search"], textarea, select {
    min-height: 48px !important;
  }
  
}

/* Accessibility improvements for mobile */
@media (max-width: 768px) {
  
  /* Focus states more visible on mobile */
  .btn:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid #0056b3 !important;
    outline-offset: 2px !important;
  }
  
  /* Make sure links are touch-friendly */
  a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 4px 0;
  }
  
  /* Exception for links in paragraphs */
  p a, li a {
    min-height: unset;
    display: inline;
    padding: 0;
  }
  
}
/* Mobile App Polish - Phase 7 Enhancements */

/* PWA-specific improvements */
@media (display-mode: standalone) {
  .container {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }
  
  .mobile-nav {
    padding-top: env(safe-area-inset-top, 12px);
    background: linear-gradient(135deg, #F4F7FA 0%, #ffffff 100%);
  }
  
  /* Hide elements not needed in standalone mode */
  .pwa-hide {
    display: none !important;
  }
}

/* Enhanced touch interactions */
.touch-friendly {
  min-height: 48px;
  min-width: 48px;
  padding: 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.touch-friendly:active {
  transform: scale(0.97);
  opacity: 0.8;
}

/* App-like loading states */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
}

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

/* Enhanced native app detection styling */
.native-app-body {
  background: #F4F7FA;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Bottom safe area for devices with home indicator */
.mobile-nav,
.sticky-bottom {
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

/* Enhanced card interactions for mobile */
.building-card,
.mobile-card {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  overflow: hidden;
  background: #ffffff;
}

.building-card:hover,
.mobile-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.building-card:active,
.mobile-card:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Floating action button for camera */
.fab-camera {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  background: #336699;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(51, 102, 153, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  text-decoration: none;
  transition: all 0.3s ease;
  z-index: 1000;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.fab-camera:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(51, 102, 153, 0.4);
  color: white;
  text-decoration: none;
}

/* Enhanced form styling for mobile */
.mobile-form .form-group {
  margin-bottom: 20px;
}

.mobile-form input,
.mobile-form textarea,
.mobile-form select {
  font-size: 16px; /* Prevent zoom on iOS */
  padding: 16px;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  transition: border-color 0.2s ease;
}

.mobile-form input:focus,
.mobile-form textarea:focus,
.mobile-form select:focus {
  border-color: #336699;
  box-shadow: 0 0 0 3px rgba(51, 102, 153, 0.1);
  outline: none;
}

/* Pull-to-refresh indicator */
.pull-to-refresh {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  color: #6c757d;
  font-size: 14px;
  border-radius: 0 0 12px 12px;
  transform: translateY(-60px);
  transition: transform 0.3s ease;
}

.pull-to-refresh.active {
  transform: translateY(0);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .mobile-nav {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-bottom-color: #404040;
  }
  
  .mobile-nav-brand {
    color: #ffffff !important;
  }
  
  .native-app-body {
    background: #1a1a1a;
    color: #ffffff;
  }
  
  .building-card,
  .mobile-card {
    background: #2d2d2d;
    border-color: #404040;
  }
  
  .mobile-form input,
  .mobile-form textarea,
  .mobile-form select {
    background: #2d2d2d;
    border-color: #404040;
    color: #ffffff;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .building-card,
  .mobile-card {
    border: 2px solid #000000;
  }
  
  .fab-camera {
    border: 2px solid #ffffff;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *


 */

/* Styles for custom icons */
.custom-icon {
  font-size: 48px; /* Adjust the size as needed */
}

/* Styles for centering content */
.center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Add application-wide styles to this file */
/* Styles you add here take precedence over styles defined in any other CSS */

/* If you want to include other stylesheets or import external CSS frameworks, you can do so below */


