/**
 * Mobile App Banner Styles (Modern Design)
 * Inspired by Reddit, Twitter - Pickles Direct branding
 */

/* Import modern font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

#mobile-app-banner {
  /* Initially hidden, shown by JS if needed */
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;

  /* Styling */
  background: linear-gradient(135deg, #004E95 0%, #003366 100%);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);

  /* Animation */
  transform: translateY(100%);
  opacity: 0;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 300ms ease-out;
}

#mobile-app-banner.active {
  transform: translateY(0);
  opacity: 1;
}

/* Top placement fallback (Chrome on iOS when the bottom toolbar inset is unknown) */
#mobile-app-banner.banner-top {
  top: 0;
  bottom: auto;
  border-top: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-100%);
}

#mobile-app-banner.banner-top.active {
  transform: translateY(0);
}

#mobile-app-banner.banner-top #mobile-app-banner-wrapper {
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: 12px;
}

/* Banner wrapper - main container */
#mobile-app-banner-wrapper {
   display: flex;
   align-items: center;
   gap: 12px;
   padding: 12px 16px;
   padding-bottom: max(12px, env(safe-area-inset-bottom));
   padding-left: max(16px, env(safe-area-inset-left));
   padding-right: max(16px, env(safe-area-inset-right));
   font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* App Icon */
#banner-icon-container {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#banner-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Banner text content */
#banner-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

#banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#banner-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: white;
  letter-spacing: -0.3px;
}

#banner-subtitle {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: -0.2px;
}

/* Action buttons container */
#banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Banner button base styles */
.banner-btn {
   border: none;
   border-radius: 6px;
   font-family: 'Inter', inherit;
   font-size: 13px;
   font-weight: 600;
   cursor: pointer;
   transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
   outline: none;
   white-space: nowrap;
   padding: 8px 14px;
   height: 36px;
   display: flex;
   align-items: center;
   justify-content: center;
   user-select: none;
   -webkit-user-select: none;
   -webkit-tap-highlight-color: transparent;
}

/* Primary button (Get App / Open App) */
.banner-btn-primary {
  background: white;
  color: #004E95;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  letter-spacing: -0.3px;
}

.banner-btn-primary:hover {
  background: #f8f9fa;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.banner-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Dismiss button */
.banner-btn-dismiss {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.banner-btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.25);
}

.banner-btn-dismiss:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.95);
}

/* Responsive Layout - Small Screens */
@media (max-width: 380px) {
  #mobile-app-banner-wrapper {
    gap: 10px;
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  #mobile-app-banner.banner-top #mobile-app-banner-wrapper {
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: 10px;
  }

  #banner-icon-container {
    width: 40px;
    height: 40px;
  }

  #banner-icon {
    width: 28px;
    height: 28px;
  }

  #banner-title {
    font-size: 14px;
  }

  #banner-subtitle {
    font-size: 11px;
  }

  .banner-btn-primary {
    padding: 7px 12px;
    font-size: 12px;
    height: 32px;
  }
}

/* Responsive Layout - Medium Screens */
@media (min-width: 381px) and (max-width: 480px) {
  #mobile-app-banner-wrapper {
    gap: 12px;
  }

  #banner-icon-container {
    width: 48px;
    height: 48px;
  }

  .banner-btn-primary {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* Responsive Layout - Larger Screens (Tablet fallback) */
@media (min-width: 481px) {
  #mobile-app-banner {
    display: none !important;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  #mobile-app-banner {
    background: linear-gradient(135deg, #005AB5 0%, #003d7a 100%);
  }

  .banner-btn-primary {
    background: #ffffff;
    color: #004E95;
  }

  .banner-btn-primary:hover {
    background: #f0f0f0;
  }

  #banner-subtitle {
    color: rgba(255, 255, 255, 0.75);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  #mobile-app-banner {
    transform: none;
    opacity: 1;
    transition: none;
  }

  #mobile-app-banner:not(.active) {
    opacity: 0;
    pointer-events: none;
  }

  .banner-btn:hover,
  .banner-btn:active {
    transform: none;
  }
}

/* Print styles */
@media print {
  #mobile-app-banner {
    display: none !important;
  }
}

/* Landscape orientation (hide banner) */
@media (orientation: landscape) and (max-height: 500px) {
  #mobile-app-banner {
    display: none !important;
  }
}

