/* ==========================================
   MOBILE-SPECIFIC CSS
   ========================================== */

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-top)) {
  .header { padding-top: env(safe-area-inset-top); }
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
}

/* PWA Install Banner */
.pwa-install-banner {
  position: fixed;
  bottom: 70px;
  left: 0;
  right: 0;
  z-index: 150;
  padding: 12px 16px;
  background: linear-gradient(135deg, #002f34, #003940);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  animation: slideUp 0.4s ease;
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.pwa-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.pwa-banner-text {
  flex: 1;
  color: white;
}

.pwa-banner-text strong {
  display: block;
  font-size: 14px;
}

.pwa-banner-text span {
  font-size: 12px;
  opacity: 0.8;
}

.pwa-banner-actions {
  display: flex;
  gap: 8px;
}

.btn-pwa-install {
  background: #00adb5;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.btn-pwa-dismiss {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

/* Offline Indicator */
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #f59e0b;
  color: #78350f;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  z-index: 300;
  animation: fadeIn 0.3s ease;
}

/* Bottom Navigation */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e0e0e0;
  z-index: 100;
  padding: 6px 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #666;
  font-size: 10px;
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.2s;
}

.nav-item i {
  font-size: 18px;
}

.nav-item.active {
  color: #002f34;
}

.nav-item.active i {
  color: #00adb5;
}

.nav-post {
  background: #ff6b35;
  color: white !important;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin-top: -24px;
  box-shadow: 0 4px 12px rgba(255,107,53,0.4);
  justify-content: center;
}

.nav-post i {
  font-size: 22px;
  color: white !important;
}

.nav-post span {
  display: none;
}

/* Share Modal */
.share-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 0;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: transform 0.2s;
}

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

.share-btn.whatsapp { background: #25D366; }
.share-btn.facebook { background: #1877F2; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.copy { background: #6b7280; }

/* Notification Prompt */
.notification-prompt {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.notif-content {
  background: white;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  max-width: 320px;
  width: 100%;
}

.notif-content i {
  font-size: 48px;
  color: #00adb5;
  margin-bottom: 16px;
}

.notif-content p {
  margin-bottom: 20px;
  color: #333;
  font-size: 15px;
}

.notif-actions {
  display: flex;
  gap: 12px;
}

.notif-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.notif-actions button:first-child {
  background: #002f34;
  color: white;
}

.notif-actions button:last-child {
  background: #f1f2f6;
  color: #666;
}

/* Pull to refresh indicator */
.pull-indicator {
  text-align: center;
  padding: 16px;
  color: #999;
  font-size: 13px;
}

.pull-indicator .spinner {
  width: 24px;
  height: 24px;
  margin: 0 auto 8px;
}

/* Haptic feedback simulation */
@keyframes haptic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.98); }
}

.btn:active, .bike-card:active {
  animation: haptic 0.1s ease;
}

/* Swipe actions */
.swipe-actions {
  display: flex;
  gap: 0;
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ff6b35;
  color: white;
  border: none;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(255,107,53,0.4);
  cursor: pointer;
  z-index: 90;
  display: none;
  transition: transform 0.3s;
}

.fab:hover {
  transform: scale(1.1);
}

/* ==========================================
   MOBILE RESPONSIVE OVERRIDES
   ========================================== */

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    justify-content: space-around;
  }

  /* Add padding for bottom nav */
  .main-content {
    padding-bottom: 80px;
  }

  .footer {
    padding-bottom: 80px;
  }

  /* Hide desktop header buttons on mobile */
  .header-right .btn-admin {
    display: none;
  }

  .hero {
    padding: 32px 0;
  }

  .hero h1 {
    font-size: 24px;
  }

  .hero p {
    font-size: 14px;
  }

  .hero-stats {
    gap: 20px;
  }

  .hero-stats .stat span {
    font-size: 22px;
  }

  .hero-stats .stat label {
    font-size: 11px;
  }

  .filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
  }

  .filters select {
    min-width: 120px;
    flex-shrink: 0;
  }

  .btn-scraper {
    flex-shrink: 0;
  }

  .bike-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .bike-card .card-body {
    padding: 10px;
  }

  .bike-card .card-title {
    font-size: 13px;
    -webkit-line-clamp: 1;
  }

  .bike-card .card-price {
    font-size: 15px;
  }

  .bike-card .card-meta {
    font-size: 11px;
  }

  .section-header h2 {
    font-size: 18px;
  }

  .modal-content {
    margin: 10px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

@media (max-width: 380px) {
  .bike-grid {
    grid-template-columns: 1fr;
  }

  .header-top .container {
    padding: 0 10px;
  }

  .search-bar input {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --card-bg: #1a1a1a;
    --text: #ffffff;
    --text-light: #999;
    --border: #333;
  }

  .header {
    background: #001a1d;
  }

  .header-categories {
    background: #001215;
  }

  .filters-bar {
    background: #1a1a1a;
  }

  .filters select {
    background: #1a1a1a;
    color: white;
    border-color: #333;
  }

  .modal-content {
    background: #1a1a1a;
    color: white;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    background: #2a2a2a;
    color: white;
    border-color: #444;
  }

  .bottom-nav {
    background: #1a1a1a;
    border-color: #333;
  }

  .nav-item {
    color: #999;
  }

  .nav-item.active {
    color: #00adb5;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

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

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

/* Touch feedback */
@touch {
  .bike-card:active {
    transform: scale(0.98);
    transition: transform 0.1s;
  }
}
