/*
 * group-chat.css
 * Loaded AFTER tailwind.css so these rules win over Tailwind Preflight.
 * All group-chat UI: presence bar, mode switcher, map tab.
 */

/* ─────────────────────────────────────────────
   PRESENCE BAR
───────────────────────────────────────────── */
#chat-presence-bar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px;
    padding: 8px 14px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    min-height: 56px;
    flex-shrink: 0;
}
#chat-presence-bar::-webkit-scrollbar { display: none; }

.presence-avatar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 3px;
    flex-shrink: 0;
    cursor: default;
    min-width: 40px;
}

/* The circle — use !important so Tailwind Preflight can't override width/height */
.presence-avatar-circle {
    position: relative !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    line-height: 1;
}

.presence-status-dot {
    position: absolute !important;
    bottom: -1px !important;
    right: -1px !important;
    width: 11px !important;
    height: 11px !important;
    border-radius: 50% !important;
    border: 2px solid #ffffff !important;
}
.presence-status-dot.online  { background-color: #22c55e !important; }
.presence-status-dot.away    { background-color: #f59e0b !important; }
.presence-status-dot.offline { background-color: #94a3b8 !important; }

.presence-name {
    font-size: 0.6rem;
    color: #64748b;
    max-width: 42px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    display: block;
}
.presence-you-label {
    font-size: 0.55rem;
    color: #0ea5e9;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    text-align: center;
}

/* ─────────────────────────────────────────────
   MODE SWITCHER  (Chat / Map / Photos)
───────────────────────────────────────────── */
.chat-mode-btn {
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    white-space: nowrap;
    border: none !important;
    cursor: pointer;
}
.chat-mode-btn.active {
    background: #ffffff !important;
    color: #0ea5e9 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14) !important;
    font-weight: 700 !important;
}
.chat-mode-btn:not(.active) {
    background: transparent !important;
    color: #475569 !important;
}

/* ─────────────────────────────────────────────
   MAP TAB  — consent banner
───────────────────────────────────────────── */
#map-location-consent {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    padding: 28px 24px;
    gap: 10px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
#map-location-consent.hidden { display: none !important; }

.map-consent-icon  { font-size: 2.2rem; line-height: 1; }
.map-consent-title { font-weight: 700; font-size: 1rem; color: #1e293b; margin: 0; }
.map-consent-desc  { font-size: 0.8rem; color: #64748b; line-height: 1.55; margin: 0; max-width: 300px; }

.map-consent-buttons {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Consent buttons — !important beats Tailwind Preflight button reset */
#map-consent-yes,
#map-consent-no {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    font-weight: 700 !important;
    font-size: 0.875rem !important;
    cursor: pointer !important;
    padding: 10px 22px !important;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
#map-consent-yes {
    background-color: #0ea5e9 !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}
#map-consent-yes:hover { background-color: #0284c7 !important; }
#map-consent-yes:active { background-color: #0369a1 !important; transform: scale(0.97); }

#map-consent-no {
    background-color: #ffffff !important;
    color: #475569 !important;
    border: 1.5px solid #e2e8f0 !important;
}
#map-consent-no:hover { background-color: #f8fafc !important; }

/* ─────────────────────────────────────────────
   MAP TAB  — canvas & sharing status
───────────────────────────────────────────── */
#group-map-canvas {
    flex: 1 1 0% !important;
    width: 100% !important;
    min-height: 200px;
    background: #e2e8f0;
    display: block;
}

#map-sharing-status {
    display: flex !important;
    align-items: center !important;
    gap: 8px;
    padding: 9px 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    font-size: 0.8rem;
    color: #1e293b;
    flex-shrink: 0;
}
#map-sharing-status.hidden { display: none !important; }

.map-sharing-dot {
    width: 9px !important;
    height: 9px !important;
    border-radius: 50% !important;
    background-color: #22c55e !important;
    flex-shrink: 0;
    animation: gcMapPulse 1.8s infinite;
}
@keyframes gcMapPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

#map-stop-sharing {
    margin-left: auto !important;
    padding: 4px 14px !important;
    background-color: #fee2e2 !important;
    color: #dc2626 !important;
    border: 1px solid #fca5a5 !important;
    border-radius: 999px !important;
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    cursor: pointer !important;
    transition: background 0.15s;
}
#map-stop-sharing:hover { background-color: #fecaca !important; }

/* ─────────────────────────────────────────────
   MAP TAB  — resume bar (shown after stop sharing)
───────────────────────────────────────────── */
#map-resume-bar {
    display: flex !important;
    align-items: center !important;
    gap: 10px;
    padding: 9px 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    font-size: 0.8rem;
    flex-shrink: 0;
}
#map-resume-bar.hidden { display: none !important; }

.map-resume-label {
    flex: 1;
    color: #64748b;
    font-size: 0.8rem;
}

#map-resume-sharing {
    padding: 5px 16px !important;
    background-color: #0ea5e9 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 999px !important;
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    cursor: pointer !important;
    transition: background 0.15s;
    margin-left: auto !important;
}
#map-resume-sharing:hover  { background-color: #0284c7 !important; }
#map-resume-sharing:active { background-color: #0369a1 !important; transform: scale(0.97); }
