/* PWA Install & Update Styles */

/* Install Button */
#pwa-install-btn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  padding: 12px 24px;
  background: linear-gradient(135deg, #7b79d9, #9d9ae0);
  color: white;
  border: none;
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(123, 121, 217, 0.4);
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: pulse-install 2s infinite;
}

#pwa-install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(123, 121, 217, 0.6);
}

#pwa-install-btn i {
  margin-right: 8px;
}

@keyframes pulse-install {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(123, 121, 217, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(123, 121, 217, 0.7);
  }
}

/* Update Banner */
.pwa-update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #7b79d9, #9d9ae0);
  color: white;
  padding: 12px 0;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  animation: slideDown 0.3s ease;
}

.pwa-update-banner .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pwa-update-banner p {
  margin: 0;
  font-family: 'Nunito', sans-serif;
}

.pwa-update-banner button {
  background: white;
  color: #7b79d9;
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pwa-update-banner button:hover {
  background: #f0f0f0;
  transform: scale(1.05);
}

/* Thank You Banner */
.pwa-thank-you-banner {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: white;
  color: #2d3436;
  padding: 16px 32px;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: slideDown 0.4s ease;
}

.pwa-thank-you-banner i {
  color: #00b894;
  margin-right: 8px;
}

.pwa-thank-you-banner p {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
}

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

/* Standalone mode adjustments */
@media (display-mode: standalone) {
  /* Add extra top padding for status bar on mobile */
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  /* Hide install button when in standalone mode */
  #pwa-install-btn {
    display: none !important;
  }
}

/* iOS standalone mode */
@media (display-mode: standalone) and (max-width: 768px) {
  .navbar-fixed-top {
    padding-top: env(safe-area-inset-top);
  }
}

/* Responsive adjustments */
@media (max-width: 576px) {
  #pwa-install-btn {
    bottom: 10px;
    right: 10px;
    padding: 10px 20px;
    font-size: 14px;
  }
  
  .pwa-update-banner {
    font-size: 14px;
  }
  
  .pwa-update-banner .container {
    flex-direction: column;
    gap: 8px;
  }
}

/* Offline indicator */
.offline-indicator {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  background: #636e72;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

.offline-indicator i {
  margin-right: 6px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
/* iOS Install Banner */
.ios-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(135deg, #7b79d9, #9d9ae0);
  color: white;
  padding: 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Nunito', sans-serif;
}

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

.ios-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.ios-banner-icon {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1;
}

.ios-banner-text {
  flex: 1;
  min-width: 0;
}

.ios-banner-text strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  color: white;
}

.ios-banner-text p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.95;
}

.ios-share-icon {
  display: inline-block;
  font-size: 16px;
  font-weight: bold;
  padding: 0 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin: 0 2px;
}

.ios-banner-btn {
  background: white;
  color: #7b79d9;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  border: none;
}

.ios-banner-btn:hover {
  background: #f0f0f0;
  transform: scale(1.05);
  color: #7b79d9;
  text-decoration: none;
}

.ios-banner-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

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

/* iOS-specific adjustments */
@supports (-webkit-touch-callout: none) {
  .ios-install-banner {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Mobile responsive */
@media (max-width: 480px) {
  .ios-banner-content {
    gap: 10px;
    padding: 14px 16px;
  }
  
  .ios-banner-icon {
    font-size: 28px;
  }
  
  .ios-banner-text strong {
    font-size: 15px;
  }
  
  .ios-banner-text p {
    font-size: 13px;
  }
  
  .ios-banner-btn {
    padding: 6px 14px;
    font-size: 13px;
  }
}}

/* iOS Floating Install Button */
.ios-install-floating-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #7b79d9, #9d9ae0);
  color: white;
  border: none;
  border-radius: 50px;
  box-shadow: 0 4px 16px rgba(123, 121, 217, 0.5);
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0;
  transform: scale(0.8) translateY(20px);
}

.ios-install-floating-btn.show {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.ios-install-floating-btn:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 6px 20px rgba(123, 121, 217, 0.7);
}

.ios-install-floating-btn i {
  font-size: 16px;
}

.ios-install-floating-btn span {
  white-space: nowrap;
}

/* iOS Install Modal */
.ios-install-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.ios-install-modal.show {
  opacity: 1;
  visibility: visible;
}

.ios-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.ios-modal-content {
  position: relative;
  background: white;
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ios-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f0f0f0;
  color: #666;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  z-index: 1;
}

.ios-modal-close:hover {
  background: #e0e0e0;
  transform: scale(1.1);
}

.ios-modal-header {
  text-align: center;
  padding: 30px 20px 20px;
  background: linear-gradient(135deg, #7b79d9, #9d9ae0);
  color: white;
  border-radius: 20px 20px 0 0;
}

.ios-modal-icon {
  font-size: 64px;
  margin-bottom: 12px;
}

.ios-modal-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
}

.ios-modal-body {
  padding: 24px;
}

.ios-step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.ios-step:last-child {
  margin-bottom: 0;
}

.ios-step-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #7b79d9, #9d9ae0);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.ios-step-content {
  flex: 1;
  padding-top: 2px;
}

.ios-step-content strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #2d3436;
  margin-bottom: 6px;
  font-family: 'Nunito', sans-serif;
}

.ios-step-content p {
  margin: 0;
  font-size: 14px;
  color: #636e72;
  line-height: 1.5;
}

.ios-modal-footer {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ios-modal-btn-primary,
.ios-modal-btn-secondary {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ios-modal-btn-primary {
  background: linear-gradient(135deg, #7b79d9, #9d9ae0);
  color: white;
}

.ios-modal-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(123, 121, 217, 0.4);
}

.ios-modal-btn-secondary {
  background: #f0f0f0;
  color: #666;
}

.ios-modal-btn-secondary:hover {
  background: #e0e0e0;
}

/* Responsive adjustments for iOS */
@media (max-width: 480px) {
  .ios-install-floating-btn {
    bottom: 80px;
    right: 16px;
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .ios-install-floating-btn span {
    display: none;
  }
  
  .ios-install-floating-btn i {
    margin: 0;
  }
  
  .ios-modal-content {
    border-radius: 16px;
    margin: 10px;
  }
  
  .ios-modal-header {
    padding: 24px 16px 16px;
    border-radius: 16px 16px 0 0;
  }
  
  .ios-modal-icon {
    font-size: 48px;
  }
  
  .ios-modal-header h3 {
    font-size: 20px;
  }
  
  .ios-modal-body {
    padding: 20px 16px;
  }
  
  .ios-step {
    gap: 12px;
    margin-bottom: 20px;
  }
  
  .ios-step-number {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  
  .ios-step-content strong {
    font-size: 15px;
  }
  
  .ios-step-content p {
    font-size: 13px;
  }
  
  .ios-modal-footer {
    padding: 16px;
  }
}
