/* PWA 전용 스타일 */

/* 설치 배너 */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 1rem;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  animation: slideUp 0.3s ease-out;
}

.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.pwa-install-content i.fa-mobile-alt {
  font-size: 2rem;
  flex-shrink: 0;
}

.pwa-install-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pwa-install-text strong {
  font-size: 1rem;
  font-weight: 700;
}

.pwa-install-text span {
  font-size: 0.875rem;
  opacity: 0.9;
}

.pwa-install-btn {
  background: white;
  color: #6366f1;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pwa-install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.pwa-install-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.pwa-install-close:hover {
  opacity: 1;
}

.pwa-install-banner.fade-out {
  animation: slideDown 0.3s ease-out forwards;
}

/* iOS 설치 가이드 */
.ios-install-guide {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
  animation: fadeIn 0.3s ease-out;
}

.ios-install-content {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 400px;
  text-align: center;
}

.ios-install-content i.fa-mobile-screen {
  font-size: 3rem;
  color: #6366f1;
  margin-bottom: 1rem;
}

.ios-install-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #1e293b;
}

.ios-install-content ol {
  text-align: left;
  margin-bottom: 1.5rem;
  padding-left: 0;
  list-style: none;
}

.ios-install-content ol li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #475569;
}

.ios-install-content ol li i {
  color: #6366f1;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.ios-install-close {
  background: #6366f1;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ios-install-close:hover {
  background: #4f46e5;
}

/* Service Worker 업데이트 알림 */
.sw-update-notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 1rem;
  z-index: 9999;
  animation: slideInRight 0.3s ease-out;
}

.sw-update-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sw-update-content i {
  color: #6366f1;
  font-size: 1.25rem;
  animation: spin 2s linear infinite;
}

.sw-update-content span {
  font-size: 0.9375rem;
  color: #475569;
}

.sw-update-btn {
  background: #6366f1;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sw-update-btn:hover {
  background: #4f46e5;
}

/* 토스트 메시지 */
.pwa-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e293b;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 90%;
}

.pwa-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.pwa-toast-success {
  background: #10b981;
}

.pwa-toast-warning {
  background: #f59e0b;
}

.pwa-toast-error {
  background: #ef4444;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
  .pwa-install-content {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .pwa-install-text {
    flex: 1 1 100%;
  }
  
  .pwa-install-btn {
    flex: 1;
  }
  
  .sw-update-notification {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }
}

/* 애니메이션 */
@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

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

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 스플래시 스크린 (iOS 전용) */
@media (display-mode: standalone) {
  body {
    /* 앱 모드에서 사파리 바운스 효과 제거 */
    overscroll-behavior-y: none;
  }
}

/* 터치 최적화 */
button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* iOS Safe Area 대응 */
@supports (padding: env(safe-area-inset-top)) {
  .pwa-install-banner {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}
