/* Safeway — Global styles — Red gradient dark theme */

html { scroll-behavior: smooth; }
::-webkit-scrollbar { width: 0; height: 0; }
::selection { background: rgba(220, 38, 38, 0.3); color: white; }

/* MapLibre popup overrides */
.maplibregl-popup-content {
    background: #161619 !important;
    color: #EAEAEA !important;
    border-radius: 12px !important;
    padding: 0 !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
}
.maplibregl-popup-tip { border-top-color: #161619 !important; }
.maplibregl-popup-close-button { color: #7A7A85 !important; font-size: 18px !important; }

/* Toast */
.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: #161619; color: #EAEAEA; padding: 12px 24px;
    border-radius: 12px; border: 1px solid rgba(220,38,38,0.2);
    font-size: 14px; z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 20px rgba(220,38,38,0.1);
    animation: toast-in 0.3s ease;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ═══ SVG Gradient Definitions ═══ */
/* Used via url(#safeway-gradient) in SVG icons */

/* ═══ SOS AUTO-DETECTION OVERLAY ═══ */

#sos-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: linear-gradient(135deg, rgba(220,38,38,0.97) 0%, rgba(153,27,27,0.97) 100%);
    backdrop-filter: blur(20px);
    display: none; align-items: center; justify-content: center;
    animation: sos-fade-in 0.3s ease;
}
#sos-overlay.active { display: flex; }

@keyframes sos-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sos-overlay-content {
    text-align: center; color: white; padding: 32px;
    max-width: 360px; width: 100%;
}

.sos-icon-pulse {
    width: 24px; height: 24px; border-radius: 50%;
    background: white; margin: 0 auto 16px;
    animation: sos-dot-pulse 1s ease infinite;
}
@keyframes sos-dot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(255,255,255,0.7); }
    50% { transform: scale(1.3); opacity: 0.8; box-shadow: 0 0 0 20px rgba(255,255,255,0); }
}

.sos-title {
    font-size: 22px; font-weight: 800; margin-bottom: 24px;
    letter-spacing: 0.5px; text-transform: uppercase;
}

.sos-countdown-ring {
    position: relative; width: 120px; height: 120px; margin: 0 auto 16px;
}
.sos-countdown-ring svg { width: 100%; height: 100%; }
.sos-countdown-ring #sos-ring { transition: stroke-dashoffset 1s linear; }
#sos-countdown-num {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 42px; font-weight: 800; color: white;
}

.sos-subtitle { font-size: 15px; opacity: 0.9; margin-bottom: 32px; }

.sos-actions { display: flex; gap: 12px; }
.sos-action-btn {
    flex: 1; padding: 14px 16px; border-radius: 14px;
    font-size: 15px; font-weight: 700; border: none;
    cursor: pointer; transition: transform 0.1s;
}
.sos-action-btn:active { transform: scale(0.96); }
.sos-cancel {
    background: rgba(255,255,255,0.15); color: white;
    border: 2px solid rgba(255,255,255,0.3);
}
.sos-send-now { background: white; color: #DC2626; }

/* ═══ Red gradient glow effects ═══ */
.glow-red {
    box-shadow: 0 0 20px rgba(220,38,38,0.3), 0 0 60px rgba(220,38,38,0.1);
}
.gradient-text {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 50%, #991B1B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.gradient-border {
    border: 1px solid transparent;
    background-clip: padding-box;
    position: relative;
}
/* ═══ Skeleton loader ═══ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-surface) 40%, var(--bg-card) 80%);
    background-size: 300% 100%;
    animation: skeleton-shimmer 1.5s ease infinite;
    border-radius: var(--radius);
}
@keyframes skeleton-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
.skeleton-card { height: 80px; margin-bottom: 12px; }
.skeleton-line { height: 14px; margin-bottom: 8px; border-radius: 6px; }
.skeleton-line.short { width: 60%; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }

/* ═══ Smooth scroll for horizontal lists ═══ */
.scroll-x {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth; scrollbar-width: none;
}
.scroll-x::-webkit-scrollbar { display: none; }

/* ═══ Tablet/Desktop layout (2 columns) ═══ */
@media (min-width: 768px) {
    .container { max-width: 720px; }
    .page-content { padding-left: 24px; padding-right: 24px; }
    .bottom-nav {
        top: 0; bottom: auto; left: 0; width: 72px; height: 100vh;
        flex-direction: column; justify-content: flex-start; padding-top: 24px;
        border-top: none; border-right: 1px solid var(--border);
    }
    .bottom-nav a { padding: 12px 8px; }
    body { padding-left: 72px; }
}

@media (min-width: 1024px) {
    .container { max-width: 960px; }
    /* Tribes: 2 column layout */
    .tribe-card { display: inline-flex; width: calc(50% - 6px); vertical-align: top; }
}

@media (min-width: 1280px) {
    .container { max-width: 1100px; }
}

.gradient-border::before {
    content: ''; position: absolute; inset: -1px;
    border-radius: inherit; padding: 1px;
    background: linear-gradient(135deg, rgba(220,38,38,0.4) 0%, rgba(153,27,27,0.2) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
}
