/* ═══════════════════════════════════════════════════════════════
   HAURANA — PWA Styles v1.0
   Bannière installation · Toast · Bouton notifications
═══════════════════════════════════════════════════════════════ */

/* ── BANNIÈRE D'INSTALLATION ── */
#haurana-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99990;
  background: linear-gradient(135deg, #0A0618 0%, #120E2B 100%);
  border-top: 1px solid rgba(200, 150, 62, 0.35);
  padding: 0.85rem 1rem;
  transform: translateY(110%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 -8px 40px rgba(200, 150, 62, 0.12);
}

#haurana-install-banner.visible {
  transform: translateY(0);
}

.pwa-banner-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 680px;
  margin: 0 auto;
}

.pwa-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(200, 150, 62, 0.3);
}

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

.pwa-banner-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #E8E4F0;
  margin-bottom: 0.15rem;
}

.pwa-banner-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: rgba(232, 228, 240, 0.55);
  line-height: 1.4;
}

.pwa-btn-install {
  background: linear-gradient(135deg, #C8963E, #E8B86D);
  color: #030510;
  border: none;
  border-radius: 9999px;
  padding: 0.55rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(200, 150, 62, 0.4);
}

.pwa-btn-install:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 24px rgba(200, 150, 62, 0.55);
}

.pwa-btn-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-btn-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

/* ── TOAST NOTIFICATION ── */
#haurana-pwa-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 2rem));
  z-index: 99999;
  background: linear-gradient(135deg, #1C1640, #120E2B);
  border: 1px solid rgba(200, 150, 62, 0.3);
  border-radius: 1rem;
  padding: 0.85rem 1.4rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: rgba(232, 228, 240, 0.9);
  max-width: min(92vw, 460px);
  text-align: center;
  line-height: 1.5;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(200, 150, 62, 0.1);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
  opacity: 0;
  pointer-events: none;
}

#haurana-pwa-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Décalage si la bannière d'install est aussi visible */
#haurana-install-banner.visible ~ #haurana-pwa-toast.visible,
body:has(#haurana-install-banner.visible) #haurana-pwa-toast.visible {
  bottom: 6rem;
}

/* ── BOUTON NOTIFICATIONS (Dashboard / Profil) ── */
.haurana-notif-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(200, 150, 62, 0.08);
  border: 1px solid rgba(200, 150, 62, 0.25);
  border-radius: 9999px;
  padding: 0.5rem 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}

.haurana-notif-btn i {
  color: #C8963E;
  font-size: 0.8rem;
}

.haurana-notif-btn:hover {
  background: rgba(200, 150, 62, 0.15);
  border-color: rgba(200, 150, 62, 0.5);
  color: white;
}

.haurana-notif-btn.active {
  background: rgba(200, 150, 62, 0.18);
  border-color: rgba(200, 150, 62, 0.6);
  color: #E8B86D;
}

.haurana-notif-btn.active i {
  color: #E8B86D;
  animation: bellShake 3s ease-in-out infinite;
}

@keyframes bellShake {
  0%, 80%, 100% { transform: rotate(0deg); }
  85%  { transform: rotate(-15deg); }
  90%  { transform: rotate(15deg); }
  95%  { transform: rotate(-8deg); }
}

/* ── BADGE PWA (mode app) ── */
.pwa-mode .pwa-hide { display: none !important; }

.pwa-status-pill {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: rgba(14, 196, 168, 0.1);
  border: 1px solid rgba(14, 196, 168, 0.3);
  border-radius: 9999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #0EC4A8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pwa-mode .pwa-status-pill { display: inline-flex; }

/* ── SAFE AREA pour iPhone (encoche/Dynamic Island) ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #haurana-install-banner {
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom));
  }
  #haurana-pwa-toast {
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
  }
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .pwa-banner-inner {
    flex-wrap: wrap;
  }
  .pwa-banner-text {
    flex: 1 1 calc(100% - 110px);
  }
  .pwa-btn-install {
    flex: 1;
    text-align: center;
  }
  .pwa-btn-close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
  }
  #haurana-install-banner {
    position: relative;
  }
}
