/* ==========================================
   📱 BARRE DE NAVIGATION INFÉRIEURE (MOBILE)
   ========================================== */

:root{
  --bottom-nav-h: 70px;
  --safe-b: env(safe-area-inset-bottom);
}

.mobile-navbar{
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;

  background: #1a1a1a !important;
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  align-items: center !important;
  justify-items: center !important;

  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.5) !important;
  z-index: 9999 !important;

  height: calc(var(--bottom-nav-h) + var(--safe-b)) !important;
  padding: 0 10px !important;
  padding-bottom: var(--safe-b) !important;
  box-sizing: border-box;
}

/* Items */
.nav-item{
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  color: #888 !important;
  text-decoration: none !important;
  font-size: 0.7rem !important;
  transition: color 0.2s ease !important;
  padding: 0.5rem 0 !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
}

.nav-item.active{ color: white !important; }

.nav-item i{
  font-size: 1.4rem !important;
  margin-bottom: 4px !important;
}

/* ⭐ Bouton Amis - position relative pour le badge */
.nav-friends-btn {
  position: relative !important;
}

/* ⭐ Badge notification lives en cours */
.friends-notif {
  position: absolute !important;
  top: 2px !important;
  right: 6px !important;
  min-width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background: #ff1744 !important;
  color: white !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px !important;
  animation: livePulse 2s ease-in-out infinite !important;
  pointer-events: none !important;
}
.friends-notif[style*="display:flex"],
.friends-notif[style*="display: flex"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 4px rgba(255, 23, 68, 0.4); }
  50% { box-shadow: 0 0 12px rgba(255, 23, 68, 0.7); }
}


/* ==========================================================
   🎯 BOUTON UPLOAD (+) — OUVRE LE BOTTOM SHEET
   ========================================================== */

.mobile-navbar .nav-upload{
  all: unset !important;
  cursor: pointer !important;

  display: flex !important;
  justify-content: center !important;
  align-items: center !important;

  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;

  height: auto !important;
  width: auto !important;

  place-self: center !important;
  box-shadow: none !important;
}

.mobile-navbar .nav-upload i{
  all: unset !important;

  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;

  font-size: 30px !important;
  color: #10B981 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  line-height: 1 !important;
}

.mobile-navbar .nav-upload.active,
.mobile-navbar .nav-upload::before,
.mobile-navbar .nav-upload::after{
  background: none !important;
  box-shadow: none !important;
}


/* ==========================================================
   🎯 BOTTOM SHEET OVERLAY (fond sombre)
   ========================================================== */

.sheet-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.6) !important;
  z-index: 10000 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease !important;
}

.sheet-overlay.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}


/* ==========================================================
   🎯 BOTTOM SHEET (Upload + Live)
   ========================================================== */

.bottom-sheet {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: #1e1e24 !important;
  border-radius: 20px 20px 0 0 !important;
  z-index: 10001 !important;
  transform: translateY(100%) !important;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  padding-bottom: calc(16px + var(--safe-b)) !important;
}

.bottom-sheet.active {
  transform: translateY(0) !important;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  margin: 12px auto 8px;
}

.sheet-title {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #f5f5f7;
  padding: 8px 0 20px;
  letter-spacing: -0.3px;
}

.sheet-options {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 0 40px 24px;
}

.sheet-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: none;
  border: none;
  color: #f5f5f7;
  transition: transform 0.2s;
  padding: 8px;
}

.sheet-option:active {
  transform: scale(0.93);
}

.sheet-icon {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-icon i {
  font-size: 28px;
  color: white;
}

.sheet-icon.upload {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.sheet-icon.live {
  background: linear-gradient(135deg, #ff1744 0%, #d50000 100%);
  box-shadow: 0 4px 20px rgba(255, 23, 68, 0.3);
}

.sheet-option-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.sheet-option-desc {
  font-size: 11px;
  color: #8e8e93;
  margin-top: -4px;
}


/* ==========================================================
   🎯 FRIENDS OVERLAY (bulles en haut du feed)
   ========================================================== */

.friends-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9998 !important;
  background: linear-gradient(180deg, rgba(15,15,19,0.97) 0%, rgba(15,15,19,0.92) 70%, transparent 100%) !important;
  padding: 12px 0 20px !important;
  padding-top: calc(12px + env(safe-area-inset-top)) !important;
  transform: translateY(-120%) !important;
  opacity: 0 !important;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease !important;
  pointer-events: none !important;
}

.friends-overlay.active {
  transform: translateY(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.friends-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px 12px;
}

.friends-title {
  font-size: 16px;
  font-weight: 700;
  color: #f5f5f7;
  letter-spacing: -0.3px;
}

.friends-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2a2a30;
  border: none;
  color: #8e8e93;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}

.friends-scroll {
  display: flex;
  gap: 16px;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.friends-scroll::-webkit-scrollbar {
  display: none;
}

.friends-placeholder {
  color: #5a5a5e;
  font-size: 13px;
  padding: 10px 0;
}


/* --- Bulles d'amis --- */

.friend-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 64px;
  cursor: pointer;
  transition: transform 0.2s;
}

.friend-bubble:active {
  transform: scale(0.93);
}

.friend-avatar-wrap {
  position: relative;
  width: 56px;
  height: 56px;
}

.friend-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  border: 2px solid #2a2a30;
}

/* Ami en LIVE */
.friend-bubble.is-live .friend-avatar {
  border-color: #ff1744 !important;
  box-shadow: 0 0 12px rgba(255, 23, 68, 0.4);
}

.live-badge {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  background: #ff1744;
  color: white;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  display: none;
  animation: livePulse 2s ease-in-out infinite;
}

.friend-bubble.is-live .live-badge {
  display: block;
}

/* Ami en ligne (point vert) */
.online-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid #1a1a1a;
  display: none;
}

.friend-bubble.is-online .online-dot {
  display: block;
}

.friend-name {
  font-size: 11px;
  font-weight: 500;
  color: #8e8e93;
  text-align: center;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-bubble.is-live .friend-name {
  color: #f5f5f7;
}


/* ==========================================================
   ✅ PADDING BODY (inchangé)
   ========================================================== */

body:not(.is-admin-page) #app{
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-b));
}


/* ==========================================================
   📱 RESPONSIVE DESKTOP
   ========================================================== */

@media (min-width: 768px){
  body{
    max-width: 480px !important;
    margin: 0 auto !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5) !important;
  }

  .mobile-navbar{ display: none !important; }
  .bottom-sheet { max-width: 480px; margin: 0 auto; }
  .friends-overlay { max-width: 480px; margin: 0 auto; }
}