/**
 * ============================================
 * PWA INSTALL PROMPT STYLING
 * ============================================
 * Beautiful, Android-optimized install banner
 * Mobile-first responsive design with dark mode support
 */

/* ============================================
   INSTALL BANNER - MAIN CONTAINER
   ============================================ */

.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  padding: 1rem;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.install-banner.show {
  transform: translateY(0);
}

/* Desktop positioning */
@media (min-width: 768px) {
  .install-banner {
    top: 1rem;
    right: 1rem;
    bottom: auto;
    left: auto;
    max-width: 420px;
    border-radius: 1rem;
    transform: translateY(-120%);
    animation: slideDown 0.4s ease-out forwards;
  }
  
  .install-banner.show {
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-120%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================
   BANNER CONTENT
   ============================================ */

.install-banner-content {
  position: relative;
}

.install-banner-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.install-banner-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.install-banner-icon svg {
  width: 24px;
  height: 24px;
}

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

.install-banner-text h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.install-banner-subtitle {
  font-size: 0.875rem;
  opacity: 0.95;
  margin: 0;
  line-height: 1.4;
}

.install-banner-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.install-banner-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* ============================================
   BENEFITS LIST
   ============================================ */

.install-banner-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (max-width: 480px) {
  .install-banner-benefits {
    grid-template-columns: 1fr;
    gap: 0.375rem;
  }
}

.install-benefit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: white;
  font-size: 0.813rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

.install-benefit svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.9;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.install-banner-actions {
  display: flex;
  gap: 0.5rem;
}

.install-btn-primary,
.install-btn-secondary {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.938rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  white-space: nowrap;
}

.install-btn-primary {
  background: white;
  color: #667eea;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.install-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.install-btn-primary:active {
  transform: translateY(0);
}

.install-btn-primary svg {
  width: 18px;
  height: 18px;
}

.install-btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.install-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 480px) {
  .install-banner-actions {
    flex-direction: column;
  }
  
  .install-btn-primary,
  .install-btn-secondary {
    width: 100%;
  }
}

/* ============================================
   IOS INSTRUCTIONS
   ============================================ */

.install-ios-instructions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.install-ios-instructions p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.813rem;
  line-height: 1.5;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.install-ios-instructions svg {
  display: inline-block;
  vertical-align: middle;
}

/* ============================================
   IOS INSTRUCTIONS MODAL
   ============================================ */

.install-ios-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.3s ease-out;
}

.install-ios-modal-content {
  background: white;
  border-radius: 1.5rem;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

.install-ios-modal-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.5rem 0;
  color: #1f2937;
  text-align: center;
}

.install-ios-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.install-ios-steps li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: #f3f4f6;
  border-radius: 0.75rem;
}

.install-ios-steps li:last-child {
  margin-bottom: 0;
}

.step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.938rem;
}

.install-ios-steps li span:last-child {
  flex: 1;
  color: #374151;
  line-height: 1.6;
  padding-top: 0.25rem;
}

.install-ios-close {
  width: 100%;
  padding: 0.875rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.install-ios-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.install-ios-close:active {
  transform: translateY(0);
}

/* ============================================
   SUCCESS MODAL
   ============================================ */

.install-success-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.install-success-modal.show {
  opacity: 1;
}

.install-success-content {
  background: white;
  border-radius: 1.5rem;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.3s ease-out;
}

.install-success-modal.show .install-success-content {
  transform: translateY(0);
}

.install-success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.install-success-icon svg {
  width: 48px;
  height: 48px;
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.install-success-content h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  color: #1f2937;
}

.install-success-content > p {
  color: #6b7280;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 1.5rem 0;
}

.install-success-tips {
  background: #f9fafb;
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.install-success-tips h4 {
  font-size: 0.938rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: #374151;
}

.install-success-tips ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.install-success-tips li {
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
}

.install-success-tips li:last-child {
  margin-bottom: 0;
}

.install-success-tips li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #667eea;
  font-weight: 700;
}

.install-success-btn {
  width: 100%;
  padding: 0.875rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.install-success-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.install-success-btn:active {
  transform: translateY(0);
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
  .install-ios-modal-content,
  .install-success-content {
    background: #1f2937;
  }
  
  .install-ios-modal-content h3,
  .install-success-content h3 {
    color: #f9fafb;
  }
  
  .install-success-content > p,
  .install-ios-steps li span:last-child {
    color: #d1d5db;
  }
  
  .install-ios-steps li {
    background: #374151;
  }
  
  .install-success-tips {
    background: #374151;
  }
  
  .install-success-tips h4 {
    color: #f3f4f6;
  }
  
  .install-success-tips li {
    color: #d1d5db;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.install-banner:focus-within {
  outline: 2px solid white;
  outline-offset: 2px;
}

.install-btn-primary:focus-visible,
.install-btn-secondary:focus-visible,
.install-banner-close:focus-visible,
.install-ios-close:focus-visible,
.install-success-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .install-banner,
  .install-banner.show,
  .install-btn-primary,
  .install-btn-secondary,
  .install-success-icon,
  .install-success-modal,
  .install-success-content {
    animation: none;
    transition: none;
  }
  
  .install-btn-primary:hover,
  .install-btn-secondary:hover,
  .install-ios-close:hover,
  .install-success-btn:hover {
    transform: none;
  }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 360px) {
  .install-banner-text h3 {
    font-size: 1rem;
  }
  
  .install-banner-subtitle {
    font-size: 0.813rem;
  }
  
  .install-btn-primary,
  .install-btn-secondary {
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .install-banner {
    border: 2px solid white;
  }
  
  .install-btn-primary {
    border: 2px solid #667eea;
  }
  
  .install-btn-secondary {
    border: 2px solid white;
  }
}

/* ============================================
   ANDROID NEXT-DAY SPECIAL PROMPT
   ============================================ */

.install-banner-android-special {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  padding: 1.5rem;
  border-radius: 1.25rem;
  max-height: 90vh;
  overflow-y: auto;
}

.install-banner-android-hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.install-banner-icon-large {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s ease-in-out infinite;
}

.install-banner-icon-large svg {
  width: 2rem;
  height: 2rem;
  color: white;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }
}

.install-android-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin: 0 0 0.5rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.install-android-subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.5;
  margin: 0;
}

/* Benefits grid for Android prompt */
.install-banner-benefits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.install-benefit-card {
  background: rgba(255, 255, 255, 0.15);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s ease;
}

.install-benefit-card:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.benefit-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.benefit-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.benefit-text strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
}

.benefit-text span {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
}

/* Stats badges */
.install-banner-android-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Special Android button styling */
.install-btn-android-special {
  font-size: 1rem;
  font-weight: 700;
  padding: 1rem 1.5rem;
  background: white;
  color: #667eea;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: buttonPulse 2s ease-in-out infinite;
}

.install-btn-android-special:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

@keyframes buttonPulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.4);
  }
}

.install-btn-tertiary {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.install-btn-tertiary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Mobile adjustments for Android special prompt */
@media (max-width: 640px) {
  .install-banner-android-special {
    padding: 1.25rem;
    border-radius: 1rem 1rem 0 0;
  }

  .install-android-title {
    font-size: 1.25rem;
  }

  .install-android-subtitle {
    font-size: 0.875rem;
  }

  .install-banner-benefits-grid {
    gap: 0.5rem;
  }

  .install-benefit-card {
    padding: 0.75rem;
  }

  .benefit-icon {
    font-size: 1.5rem;
  }

  .benefit-text strong {
    font-size: 0.75rem;
  }

  .benefit-text span {
    font-size: 0.65rem;
  }

  .stat-number {
    font-size: 1rem;
  }

  .stat-label {
    font-size: 0.625rem;
  }
}

/* Desktop - center the special prompt */
@media (min-width: 768px) {
  .install-banner-android-special {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    max-width: 480px;
    animation: scaleIn 0.4s ease-out forwards;
  }

  .install-banner-android-special.install-banner-visible {
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Visible state for Android special banner */
.install-banner-android-special.install-banner-visible {
  opacity: 1;
  transform: translateY(0);
}

