/**
 * Yolmatik Pro - Profesyonel PWA Kurulum & Bildirim Arayüzü (v2.5)
 * Masaüstünde: Kesintisi.net tarzı sağ-alt köşe karanlık modern kart
 * Mobilde: Kompakt, zarif, altta yüzen mağaza barı (Android & iPhone)
 */

/* ==========================================================================
   1. MASAÜSTÜ KARTI (DESKTOP FLOATING CARD - KESİNTİSİ.NET STİLİ)
   ========================================================================== */
.pwa-desktop-card {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  background: #0f172a; /* Derin Gece Mavisi / Siyah */
  color: #ffffff;
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.1);
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
  animation: pwaSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.pwa-desktop-card.pwa-closed {
  opacity: 0 !important;
  transform: translateY(30px) scale(0.95) !important;
  pointer-events: none !important;
}

/* Üst Başlık Satırı */
.pwa-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.pwa-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pwa-header-icon {
  width: 34px;
  height: 34px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.pwa-header-text {
  display: flex;
  flex-direction: column;
}

.pwa-header-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
}

.pwa-header-sub {
  font-size: 0.72rem;
  color: #94a3b8;
}

.pwa-card-close {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #94a3b8;
  font-size: 15px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.pwa-card-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Ana Başlık & Açıklama */
.pwa-card-body-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
  margin: 0 0 8px 0;
}

.pwa-card-body-desc {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #94a3b8;
  margin: 0 0 16px 0;
}

.pwa-card-body-desc strong {
  color: #f59e0b; /* Yolmatik Sarısı Vurgu */
}

/* Özellik Rozetleri */
.pwa-features-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.pwa-feature-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Büyük Eylem Butonu */
.btn-pwa-desktop-install {
  width: 100%;
  background: #10b981; /* Canlı Zümrüt Yeşili */
  color: #ffffff;
  border: none;
  padding: 13px 18px;
  border-radius: 12px;
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.btn-pwa-desktop-install:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

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

/* İpuçları (Tarayıcı Kurulum Uyarısı) */
.pwa-desktop-hint {
  margin-top: 10px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.78rem;
  color: #e2e8f0;
  line-height: 1.4;
  display: none;
}
.pwa-desktop-hint.hint-open {
  display: block;
}

/* Şimdilik Hayır Linki */
.pwa-dismiss-link {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 0.76rem;
  color: #64748b;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}

.pwa-dismiss-link:hover {
  color: #cbd5e1;
}

/* ==========================================================================
   2. MOBİL UYGULAMA BARI (MOBILE FLOATING PILL - ANDROID & IPHONE)
   ========================================================================== */
.mobile-pwa-bar {
  position: fixed;
  bottom: 12px;
  left: 10px;
  right: 10px;
  max-width: 440px;
  margin: 0 auto;
  height: 54px;
  background: rgba(15, 23, 42, 0.94); /* Şık Karanlık Tasarım */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

/* Aşağı Kaydırırken Gizleniş */
.mobile-pwa-bar.pwa-hidden {
  transform: translateY(180%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Sol Alan: Kapat Butonu + Küçük Logo + Başlık */
.pwa-mob-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.pwa-mob-close {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.pwa-mob-close:hover {
  color: #ffffff;
}

.pwa-mob-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.pwa-mob-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.pwa-mob-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-mob-sub {
  font-size: 0.68rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.pwa-mob-stars {
  color: #f59e0b;
  font-weight: 700;
}

/* Sağ Alan: İndir Butonları */
.pwa-mob-right {
  margin-left: 8px;
  flex-shrink: 0;
}

/* Android (Google Play) Butonu */
.btn-mob-play-install {
  background: #10b981;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
  letter-spacing: 0.02em;
}
.btn-mob-play-install:active {
  transform: scale(0.95);
}

/* iPhone (Apple App Store) Butonu */
.btn-mob-apple-install {
  background: #007aff;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.4);
  letter-spacing: 0.02em;
}
.btn-mob-apple-install:active {
  transform: scale(0.95);
}

/* iPhone Safari İpucu Balonu */
.ios-mob-hint {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 6px;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.8rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  max-width: 270px;
  display: none;
  z-index: 1000000;
  animation: pwaHintFade 0.25s ease;
}
.ios-mob-hint.hint-open {
  display: block;
}
.ios-mob-hint::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 25px;
  border-width: 7px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}

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

/* Medya Sorguları */
@media (min-width: 769px) {
  .mobile-pwa-bar {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .pwa-desktop-card {
    display: none !important;
  }
}
