/* ─── FRIENDS TAB CSS ────────────────────────────────────────────────────────
   Wszystkie style dla zakładki Friends, live mapy i modali.
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Variables (reuse from app) ─────────────────────────────────────────────── */
:root {
  --f-bg:          #16191e;
  --f-card:        #1e2229;
  --f-card-hover:  #252b34;
  --f-border:      rgba(255,255,255,0.07);
  --f-green:       #4ade80;
  --f-red:         #ef4444;
  --f-text:        #f0f4f8;
  --f-muted:       #8b95a1;
  --f-live:        #f97316;
}

/* ── Friends tab panel ──────────────────────────────────────────────────────── */

/* #tabFriends visibility is controlled by .tab-panel / .tab-panel--active in style.css */
#tabFriends.tab-panel--active {
  display:        flex;
  flex-direction: column;
  overflow:       hidden;
}

.friends-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         14px 16px 10px;
  border-bottom:   1px solid var(--f-border);
  flex-shrink:     0;
  background:      var(--color-dark--1, #2d3439);
  position:        relative;
  z-index:         2;
}

.friends-header__title {
  font-size:      18px;
  font-weight:    800;
  color:          var(--f-text);
  letter-spacing: -0.02em;

}

.friends-header__actions {
  display: flex;
  gap:     8px;
}

.friends-header__btn {
  background:    var(--f-card);
  border:        1px solid var(--f-border);
  border-radius: 10px;
  color:         var(--f-text);
  font-size:     13px;
  font-weight:   600;
  padding:       7px 12px;
  cursor:        pointer;
  transition:    background 0.15s;
  font-family:   'Manrope', sans-serif;
  white-space:   nowrap;
}
.friends-header__btn:hover { background: var(--f-card-hover); }

.friends-header__btn--share {
  background: var(--f-green);
  border-color: var(--f-green);
  color: #0f1114;
}
.friends-header__btn--share:hover { background: #22c55e; }

/* ── Friends list ───────────────────────────────────────────────────────────── */

.friends-list {
  flex:           1;
  overflow-y:     auto;
  padding:        12px 16px;
  display:        flex;
  flex-direction: column;
  gap:            8px;
  scrollbar-width: none;
  background:     var(--color-dark--1, #2d3439);
}
.friends-list::-webkit-scrollbar { display: none; }

/* Empty state */
.friends-empty {
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  flex:            1;
  padding:         48px 24px;
  text-align:      center;
  gap:             16px;
  background:      var(--color-dark--1, #2d3439);
}
.friends-empty__icon { font-size: 56px; }
.friends-empty p {
  font-size:    15px;
  font-weight:  500;
  color:        var(--f-text);
  line-height:  1.6;
  margin:       0;
  background:   rgba(30,34,41,0.9);
  padding:      12px 20px;
  border-radius: 12px;
  border:       1px solid var(--f-border);
}

/* Friend card */
.friend-card {
  display:         flex;
  align-items:     center;
  gap:             12px;
  padding:         12px 14px;
  background:      var(--f-card);
  border-radius:   14px;
  border:          1px solid var(--f-border);
  transition:      background 0.15s, border-color 0.15s;
}
.friend-card--live {
  border-color: rgba(249, 115, 22, 0.4);
  background:   rgba(249, 115, 22, 0.06);
}

.friend-card__avatar {
  width:           40px;
  height:          40px;
  border-radius:   50%;
  background:      linear-gradient(135deg, #4ade80, #16a34a);
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       18px;
  font-weight:     800;
  color:           #0f1114;
  flex-shrink:     0;
}

.friend-card__info { flex: 1; min-width: 0; }

.friend-card__name {
  font-size:   14px;
  font-weight: 700;
  color:       var(--f-text);
  display:     flex;
  align-items: center;
  gap:         8px;
}

.friend-card__live-badge {
  font-size:    10px;
  font-weight:  700;
  color:        var(--f-live);
  background:   rgba(249,115,22,0.15);
  border-radius: 6px;
  padding:      2px 6px;
  letter-spacing: 0.06em;
  animation:    live-pulse 1.5s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.friend-card__meta {
  font-size:  12px;
  color:      var(--f-muted);
  margin-top: 2px;
}

.friend-card__actions { display: flex; gap: 6px; flex-shrink: 0; }

.friend-card__btn {
  background:    var(--f-bg);
  border:        1px solid var(--f-border);
  border-radius: 8px;
  cursor:        pointer;
  font-size:     12px;
  font-weight:   600;
  padding:       6px 10px;
  color:         var(--f-text);
  font-family:   'Manrope', sans-serif;
  transition:    background 0.15s;
  white-space:   nowrap;
}
.friend-card__btn:hover { background: var(--f-card-hover); }
.friend-card__btn--watch {
  background:  rgba(74,222,128,0.12);
  border-color: rgba(74,222,128,0.3);
  color:        var(--f-green);
}
.friend-card__btn--delete { color: var(--f-muted); }
.friend-card__btn--delete:hover { color: var(--f-red); border-color: var(--f-red); }

/* ── Live panel ─────────────────────────────────────────────────────────────── */

.fls-panel {
  position:       fixed;
  inset:          0;
  bottom:         5.8rem;
  z-index:        250;          /* above tab-panel (50) and bottom-nav (200) */
  background:     var(--f-bg);
  display:        flex;
  flex-direction: column;
  pointer-events: all;          /* panel is fixed — must override parent pointer-events:none */
}
.fls-panel.hidden { display: none; }

.fls-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         12px 16px;
  border-bottom:   1px solid var(--f-border);
  flex-shrink:     0;
}

.fls-header__name {
  font-size:   16px;
  font-weight: 700;
  color:       var(--f-text);
}

.fls-close {
  background:    var(--f-card);
  border:        none;
  border-radius: 50%;
  color:         var(--f-muted);
  width:         30px;
  height:        30px;
  cursor:        pointer;
  font-size:     14px;
  display:       flex;
  align-items:   center;
  justify-content: center;
}

.fls-status-bar {
  display:     flex;
  align-items: center;
  justify-content: space-between;
  padding:     8px 16px;
  background:  var(--f-card);
  font-size:   13px;
  flex-shrink: 0;
}
.fls-status { font-weight: 600; color: var(--f-text); }
.fls-meta   { color: var(--f-muted); }

#friendsLiveMapContainer {
  flex: 1;
  min-height: 0;
}

/* ── Add Friend Modal ───────────────────────────────────────────────────────── */

.af-modal {
  position:   fixed;
  inset:      0;
  z-index:    3000;
  background: rgba(0,0,0,0);
  pointer-events: none;
  transition: background 0.3s;
}
.af-modal--visible {
  background:     rgba(0,0,0,0.6);
  pointer-events: all;
}

.af-modal__sheet {
  position:       absolute;
  bottom:         0;
  left:           0;
  right:          0;
  background:     var(--f-bg);
  border-radius:  24px 24px 0 0;
  padding:        20px 20px 40px;
  transform:      translateY(100%);
  transition:     transform 0.35s cubic-bezier(0.32,0.72,0,1);
}
.af-modal--visible .af-modal__sheet { transform: translateY(0); }

.af-modal__handle {
  width:         40px;
  height:        4px;
  background:    rgba(255,255,255,0.2);
  border-radius: 2px;
  margin:        0 auto 16px;
}

.af-modal__title {
  font-size:   18px;
  font-weight: 800;
  color:       var(--f-text);
  margin:      0 0 16px;
}

.af-modal__hint {
  font-size: 14px;
  color:     var(--f-muted);
  margin:    0 0 10px;
}

.af-modal__prefill {
  display:     flex;
  align-items: center;
  gap:         10px;
  padding:     12px 14px;
  background:  rgba(74,222,128,0.08);
  border:      1px solid rgba(74,222,128,0.2);
  border-radius: 12px;
  font-size:   14px;
  color:       var(--f-text);
  margin-bottom: 16px;
}
.af-modal__prefill-icon { font-size: 20px; }

.af-modal__input {
  width:         100%;
  background:    var(--f-card);
  border:        1px solid var(--f-border);
  border-radius: 12px;
  color:         var(--f-text);
  font-size:     14px;
  padding:       12px 14px;
  outline:       none;
  font-family:   'Manrope', sans-serif;
  box-sizing:    border-box;
  margin-bottom: 16px;
}
.af-modal__input:focus { border-color: var(--f-green); }

.af-modal__actions {
  display: flex;
  gap:     10px;
}

.af-modal__btn {
  flex:          1;
  padding:       13px;
  border-radius: 12px;
  border:        none;
  font-size:     15px;
  font-weight:   700;
  cursor:        pointer;
  font-family:   'Manrope', sans-serif;
  transition:    background 0.15s;
}
.af-modal__btn--cancel { background: var(--f-card); color: var(--f-muted); }
.af-modal__btn--add    { background: var(--f-green); color: #0f1114; }
.af-modal__btn--add:hover { background: #22c55e; }

/* ── Toast ──────────────────────────────────────────────────────────────────── */

.friends-toast {
  position:      fixed;
  bottom:        7rem;
  left:          50%;
  transform:     translateX(-50%) translateY(20px);
  background:    var(--f-card);
  border:        1px solid var(--f-border);
  border-radius: 20px;
  padding:       10px 20px;
  font-size:     14px;
  font-weight:   600;
  color:         var(--f-text);
  z-index:       4000;
  opacity:       0;
  transition:    opacity 0.3s, transform 0.3s;
  white-space:   nowrap;
}
.friends-toast--visible {
  opacity:   1;
  transform: translateX(-50%) translateY(0);
}

/* ── Name setup modal ───────────────────────────────────────────────────────── */

.name-modal {
  position:   fixed;
  inset:      0;
  z-index:    5000;
  background: rgba(0,0,0,0.85);
  display:    flex;
  align-items: center;
  justify-content: center;
  padding:    24px;
}
.name-modal__card {
  background:    var(--f-bg);
  border-radius: 20px;
  padding:       28px 24px;
  width:         100%;
  max-width:     360px;
  text-align:    center;
}
.name-modal__icon  { font-size: 48px; margin-bottom: 12px; }
.name-modal__title { font-size: 20px; font-weight: 800; color: var(--f-text); margin: 0 0 6px; }
.name-modal__sub   { font-size: 14px; color: var(--f-muted); margin: 0 0 20px; line-height: 1.5; }
.name-modal__input {
  width:         100%;
  background:    var(--f-card);
  border:        1px solid var(--f-border);
  border-radius: 12px;
  color:         var(--f-text);
  font-size:     16px;
  padding:       13px 14px;
  outline:       none;
  font-family:   'Manrope', sans-serif;
  box-sizing:    border-box;
  margin-bottom: 14px;
  text-align:    center;
}
.name-modal__input:focus { border-color: var(--f-green); }
.name-modal__btn {
  width:         100%;
  padding:       14px;
  border-radius: 12px;
  border:        none;
  font-size:     16px;
  font-weight:   700;
  cursor:        pointer;
  font-family:   'Manrope', sans-serif;
  background:    var(--f-green);
  color:         #0f1114;
  transition:    background 0.15s;
}
.name-modal__btn:hover { background: #22c55e; }
