/* Profile CSS — Profile card styling, responsive grid */

/* ── Profile card ──────────────────────────────────────────────────── */
.profile-card {
    border: none;
    border-radius: var(--border-radius, 0.375rem);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    overflow: hidden;
}

.profile-header {
    background: linear-gradient(135deg, var(--accent-color, #0d6efd), var(--bg-secondary, #f8f9fa));
    padding: var(--ui-space-5);
    text-align: center;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
    margin-bottom: var(--ui-space-4);
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
    margin-bottom: 0.25rem;
}

.profile-pet-name {
    font-size: 1rem;
    color: var(--text-secondary, #6c757d);
}

/* ── Navigation tabs ───────────────────────────────────────────────── */
.profile-tabs {
    border-bottom: 2px solid var(--bg-secondary, #e9ecef);
    margin-bottom: var(--ui-space-5);
}

.profile-tabs .nav-link {
    border: none;
    color: var(--text-secondary, #6c757d);
    font-weight: 500;
    padding: var(--ui-space-3) var(--ui-space-5);
    border-bottom: 2px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}

.profile-tabs .nav-link:hover {
    color: var(--accent-color, #0d6efd);
}

.profile-tabs .nav-link.active {
    color: var(--accent-color, #0d6efd);
    border-bottom-color: var(--accent-color, #0d6efd);
}

/* ── Pet info card ─────────────────────────────────────────────────── */
.pet-info-card {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: var(--border-radius, 0.375rem);
    padding: var(--ui-space-5);
}

.pet-info-card .pet-photo {
    width: 100%;
    max-width: 200px;
    border-radius: var(--border-radius, 0.375rem);
    object-fit: cover;
}

.pet-info-card .pet-detail {
    margin-bottom: 0.5rem;
}

.pet-info-card .pet-label {
    font-weight: 600;
    color: var(--text-secondary, #6c757d);
    font-size: 0.875rem;
    text-transform: uppercase;
}

/* ── Tags (interests, habits) ──────────────────────────────────────── */
.pet-tag {
    display: inline-block;
    padding: var(--ui-space-1) var(--ui-space-3);
    margin: 0.25rem;
    background: var(--accent-color, #0d6efd);
    color: #fff;
    border-radius: 50px;
    font-size: 0.8rem;
}

/* ── Responsive grid ───────────────────────────────────────────────── */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--ui-space-5);
}

@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-header {
        padding: var(--ui-space-5) var(--ui-space-4);
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 576px) {
    .profile-tabs .nav-link {
        padding: var(--ui-space-2) var(--ui-space-3);
        font-size: 0.875rem;
    }
}

/* ── Avatar sizing classes ─────────────────────────────────────────── */
.avatar-img {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-tiny {
    width: 24px;
    height: 24px;
}

.avatar-small {
    width: 40px;
    height: 40px;
}

.avatar-medium {
    width: 60px;
    height: 60px;
}

.avatar-large {
    width: 150px;
    height: 150px;
}

/* Fallback avatar (colored initials) */
.avatar-default {
    color: #fff;
    font-weight: 700;
    font-family: inherit;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    line-height: 1;
    border: 2px solid rgba(255,255,255,0.3);
    box-sizing: border-box;
    overflow: hidden;
    user-select: none;
}

.avatar-default.avatar-tiny {
    font-size: 10px;
}

.avatar-default.avatar-small {
    font-size: 14px;
}

.avatar-default.avatar-medium {
    font-size: 22px;
}

.avatar-default.avatar-large {
    font-size: 48px;
}

/* ── Lightbox stage: dark backdrop, no white canvas, image fits the viewport ── */
/* The profile lightbox modals reuse this class; the feed lightbox has the
   same rules inlined in activity_feed.html. */
.lightbox-stage .modal-content {
    background: transparent;
    border: none;
    box-shadow: none;
}

.lightbox-stage .modal-body {
    padding: 0;
}

.lightbox-stage .modal-body img {
    max-width: min(92vw, 1200px);
    max-height: calc(100vh - 32px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-stage .modal-dialog {
    max-width: none;
}

/* Darker stage while a lightbox is open */
body:has(.lightbox-stage.show) .modal-backdrop {
    opacity: 0.88;
}

/* ── Online presence indicator ───────────────────────────────────── */
.online-indicator {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 12px;
    height: 12px;
    background-color: #22c55e;
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 10;
    box-sizing: border-box;
    pointer-events: none;
}

/* Online (active < 2 min) — green (default above) */
.online-indicator-online {
    background-color: #22c55e;
}

/* Recent (active 2-30 min) — yellow/amber */
.online-indicator-recent {
    background-color: #f59e0b;
}

/* Offline (active > 30 min or never) — gray */
.online-indicator-offline {
    background-color: #9ca3af;
}

/* ── Last seen text ──────────────────────────────────────────────── */
.last-seen-text {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Avatar wrapper for online indicator positioning */
/* NOTE: display:inline-block means wrapper shrink-wraps to content.
   If placed inside a fixed-size container (e.g. .suggestion-feed-avatar),
   add: .container > .avatar-wrapper { display: block; width: 100%; height: 100%; }
   See tests/social/test_avatar_rendering.py for regression coverage. */
.avatar-wrapper {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

/* Profile-page online indicator — proportional to the 60px owner avatar,
   overlapping the corner like WhatsApp/Telegram/Instagram */
.online-indicator-profile {
    width: 18px;
    height: 18px;
    bottom: -4px;
    right: -4px;
    border: 2px solid #fff;
}

/* Same marker on the 150px non-pet avatar: scale up the dot */
.avatar-wrapper:has(.avatar-img[style*="150px"]) .online-indicator-profile {
    width: 24px;
    height: 24px;
    bottom: -6px;
    right: -6px;
}

/* ── About Tab ────────────────────────────────────────────────────── */
.profile-about-tab {
    padding: var(--ui-space-2) 0;
}

.profile-about-mobile {
    display: none;
}

.profile-about-desktop {
    display: block;
}

[data-layout="mobile-first"] .profile-about-mobile {
    display: block;
}

[data-layout="mobile-first"] .profile-about-desktop {
    display: none;
}

.profile-about-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: var(--border-radius, 0.375rem);
    padding: var(--ui-space-4);
    margin-bottom: var(--ui-space-4);
}

.profile-about-card-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #212529);
    margin-bottom: 0.75rem;
    padding-bottom: var(--ui-space-2);
    border-bottom: 1px solid var(--border-color, #dee2e6);
    display: flex;
    align-items: center;
    gap: var(--ui-space-2);
}

.profile-about-card-header i {
    color: var(--accent-color, #0d6efd);
}

.profile-about-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--ui-space-2) 0;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

.profile-about-row:last-child {
    border-bottom: none;
}

.profile-about-label {
    font-size: 0.875rem;
    color: var(--text-secondary, #6c757d);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--ui-space-2);
    flex-shrink: 0;
}

.profile-about-label i {
    font-size: 0.8rem;
}

.profile-about-value {
    font-size: 0.875rem;
    color: var(--text-primary, #212529);
    text-align: right;
    word-break: break-word;
}

.profile-about-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ui-space-1);
    justify-content: flex-end;
}

.profile-about-tag {
    display: inline-block;
    padding: var(--ui-space-1) var(--ui-space-2);
    font-size: 0.75rem;
    background: var(--accent-color, #0d6efd);
    color: #fff;
    border-radius: 50px;
}

.profile-about-tag.habit {
    background: #0dcaf0;
    color: #052c43;
}

/* ── Stats Row ───────────────────────────────────────────────────── */
.profile-stats-row {
    display: flex;
    width: 100%;
    justify-content: center;
    gap: var(--ui-space-5);
    padding: var(--ui-space-4) 0;
}

.profile-stat-item {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.profile-stat-item:hover {
    color: var(--accent-color, #0d6efd);
}

.profile-stat-count {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
}

.profile-stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary, #6c757d);
}

/* Mobile stats row */
.mobile-profile-stats {
    display: flex;
    width: 100%;
    justify-content: center;
    gap: var(--ui-space-5);
    padding: var(--ui-space-3) 0;
    border-top: 1px solid var(--border-color, #dee2e6);
    border-bottom: 1px solid var(--border-color, #dee2e6);
    margin-top: var(--ui-space-2);
}

.mobile-profile-stat {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.mobile-profile-stat-count {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
}

.mobile-profile-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Photos Tab ──────────────────────────────────────────────────── */
.profile-photos-tab {
    padding: var(--ui-space-2) 0;
}

.profile-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--ui-space-4);
}

.profile-section-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #212529);
}

.profile-section-header h5 i {
    color: var(--accent-color, #0d6efd);
}

/* ── Albums Grid ─────────────────────────────────────────────────── */
.profile-albums-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--ui-space-3);
}

@media (min-width: 768px) {
    .profile-albums-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .profile-albums-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.profile-album-card {
    text-decoration: none;
    color: inherit;
    display: block;
    border-radius: var(--border-radius, 0.375rem);
    overflow: hidden;
    border: 1px solid var(--border-color, #dee2e6);
    transition: transform 0.2s, box-shadow 0.2s;
}

.profile-album-card:hover {
    transform: scale(1.02);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
}

.profile-album-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-secondary, #e9ecef);
}

.profile-album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-album-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #e9ecef);
}

.profile-album-placeholder i {
    font-size: 2.5rem;
    color: var(--text-secondary, #6c757d);
    opacity: 0.5;
}

.profile-album-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--ui-space-2);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #fff;
}

.profile-album-title {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-album-count {
    display: flex;
    align-items: center;
    gap: var(--ui-space-1);
    font-size: 0.75rem;
    opacity: 0.9;
}

.profile-album-count i {
    font-size: 0.7rem;
}

/* ── Photos Grid (3-column Instagram-style) ──────────────────────── */
.profile-photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--ui-space-1);
}

.profile-photo-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-secondary, #e9ecef);
    cursor: pointer;
}

.profile-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

.profile-photo-item:hover img {
    opacity: 0.85;
}

/* ── Empty States ─────────────────────────────────────────────────── */
.profile-empty-state {
    text-align: center;
    padding: var(--ui-space-5) var(--ui-space-4);
    color: var(--text-secondary, #6c757d);
}

.profile-empty-state-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.profile-empty-state-icon i {
    color: var(--text-secondary, #6c757d);
}

.profile-empty-state-text {
    margin-bottom: var(--ui-space-4);
    font-size: 1rem;
}
/* ── I.3 — Mention Autocomplete ──────────────────────────────────── */
.mention-autocomplete-list {
    position: absolute;
    z-index: 1060;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: var(--ui-space-2);
    padding: var(--ui-space-2) var(--ui-space-3);
    cursor: pointer;
    transition: background 0.1s;
}

.mention-item:hover,
.mention-item.active {
    background: var(--bg-secondary, #f0f2f5);
}

.mention-item-name {
    font-weight: 500;
    color: var(--text-primary, #212529);
}

.mention-item-username {
    color: var(--text-muted, #6c757d);
    font-size: 0.85rem;
}

/* ── C.1 — Additional Pets ─────────────────────────────────────── */

/* Mobile: horizontal scroll row */
.mobile-additional-pets {
    display: none;
}

.mobile-additional-pets-scroll {
    display: flex;
    gap: var(--ui-space-3);
    overflow-x: auto;
    padding: var(--ui-space-2) 0 var(--ui-space-3);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.mobile-additional-pets-scroll::-webkit-scrollbar {
    display: none;
}

.mobile-additional-pet-card {
    flex: 0 0 160px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.mobile-additional-pet-photo {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.mobile-additional-pet-photo-placeholder {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #f0f2f5);
    font-size: 2rem;
    color: var(--text-secondary, #6c757d);
}

.mobile-additional-pet-info {
    padding: var(--ui-space-2) var(--ui-space-3);
}

.mobile-additional-pet-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary, #212529);
}

.mobile-additional-pet-type {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary, #6c757d);
}

.mobile-additional-pet-breed {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #999);
}

.mobile-additional-pet-actions {
    display: flex;
    gap: var(--ui-space-1);
    padding: 0 var(--ui-space-2) var(--ui-space-2);
}

.mobile-additional-pet-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary, #f0f2f5);
    color: var(--text-secondary, #6c757d);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s;
}

.mobile-additional-pet-action-btn:hover {
    background: var(--accent-color, #0d6efd);
    color: #fff;
}

.mobile-additional-pet-action-btn.delete:hover {
    background: #dc3545;
    color: #fff;
}

.mobile-add-pet-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ui-space-2);
    width: 100%;
    padding: var(--ui-space-2);
    margin-top: var(--ui-space-2);
    border: 2px dashed var(--border-color, #dee2e6);
    border-radius: 12px;
    color: var(--accent-color, #0d6efd);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}

.mobile-add-pet-btn:hover {
    border-color: var(--accent-color, #0d6efd);
    background: rgba(13, 110, 253, 0.05);
}

/* Desktop: grid layout */
.additional-pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--ui-space-4);
}

.additional-pet-card {
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.additional-pet-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.additional-pet-photo {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.additional-pet-photo-placeholder {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #f0f2f5);
    font-size: 2.5rem;
    color: var(--text-secondary, #6c757d);
}

.additional-pet-info {
    padding: var(--ui-space-3);
}

.additional-pet-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #212529);
    margin-bottom: var(--ui-space-1);
}

.additional-pet-type {
    font-size: 0.85rem;
    color: var(--text-secondary, #6c757d);
}

.additional-pet-breed {
    font-size: 0.8rem;
}

.additional-pet-actions {
    display: flex;
    gap: var(--ui-space-2);
    padding: 0 12px 12px;
}

/* Mobile-first layout visibility */
[data-layout="mobile-first"] .mobile-additional-pets {
    display: block;
}

[data-layout="mobile-first"] .desktop-additional-pets {
    display: none !important;
}

/* Desktop layouts: hide mobile section */
.mobile-additional-pets {
    display: none;
}

[data-layout="classic"] .desktop-additional-pets {
    display: block;
}

[data-layout="classic"] .mobile-additional-pets {
    display: none;
}

/* ── E.2: Profile reorganization ─────────────────────────────────────────── */
/* Pill-style profile tabs (shared by profile_detail + public_profile,
   both layouts — profile.css loads globally from base.html).
   CSS-only restyle: Bootstrap's tab JS keeps working untouched. */
.profile-tabs {
    border-bottom: none;
    gap: var(--ui-space-2);
}

.profile-tabs .nav-link {
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: var(--border-radius-pill, 50px);
    color: var(--text-secondary, #6c757d);
    background-color: transparent;
    padding: var(--ui-space-2) var(--ui-space-4);
    margin-bottom: 0;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.profile-tabs .nav-link:hover {
    border-color: var(--border-color, #dee2e6);
    color: var(--text-primary, #212529);
    background-color: var(--bg-secondary, #f0f0f0);
}

.profile-tabs .nav-link.active {
    background-color: var(--accent-color, #0d6efd);
    border-color: var(--accent-color, #0d6efd);
    color: #fff;
}

/* Tappable affordance for the privacy-level link in the mobile profile
   header — it previously looked identical to the non-interactive rows. */
.mobile-profile-info-item.privacy-link {
    color: var(--accent-color, #0d6efd);
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

/* ── A.2: Pet hero — the pet is the profile face ─────────────────── */

/* Full-width hero photo under the profile card header. Photos cover;
   icon fallbacks (no pet photo) contain so the whole portrait stays
   visible on the secondary background. */
.profile-hero-img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-secondary, #f0f2f5);
}

.profile-hero-img.profile-hero-icon {
    object-fit: contain;
    padding: 24px;
    background: transparent;
}

/* Desktop hero: the div is the 200px frame (flex-centered) so the icon
   fallback stays a modest centered placeholder instead of collapsing
   the frame; photos fill it with cover. */
.profile-hero {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* No pet photo: collapse the 200px band to a compact frame around the
   120px icon so the hero stays in scale with the photo heroes. */
.profile-hero.hero-icon-only {
    height: auto;
    padding: 12px 0;
}

.profile-hero .profile-hero-img {
    width: 100%;
    height: 100%;
    margin: 0;
}

.profile-hero .profile-hero-img.profile-hero-icon {
    width: auto;
    height: auto;
    max-width: 120px;
    max-height: 120px;
    padding: 0;
    margin: 0;
}

/* Clips the hero to the card's rounded corners. */
.profile-hero-card {
    overflow: hidden;
}

/* Owner stays visible as a secondary line under the pet-name headline:
   small avatar + "@handle's profile". */
.profile-owner-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
}

.profile-owner-line .avatar-wrapper {
    line-height: 0;
}

/* ── D.3: sticker on the profile hero + owner-only picker ────────── */

/* The hero wrapper divs anchor the corner sticker (the pet_hero_avatar
   filter emits it as a sibling of the photo <img>). */
.profile-hero,
.mobile-profile-hero {
    position: relative;
}

/* Hero sticker: bottom-right, scaled to the hero width on both
   layouts (capped so a wide desktop hero doesn't bloat it). */
.pet-sticker-hero {
    right: 5%;
    bottom: 6%;
    width: 26%;
    max-width: 160px;
}

/* Trigger: small round button in the hero's top-LEFT corner (owner only).
   Top-right is off-limits on mobile-first: the fixed .mobile-lang-selector
   (z-index 1060) covers that corner and was hiding the button. */
.pet-sticker-trigger {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.pet-sticker-trigger:hover {
    background: rgba(0, 0, 0, 0.65);
}

/* Picker: fixed pop-up (bottom sheet on small screens, centered
   otherwise) so it is never clipped by the hero's overflow rules. */
.pet-sticker-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.5);
}

.pet-sticker-popup {
    position: fixed;
    z-index: 3001;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(320px, calc(100vw - 32px));
    max-height: min(70vh, 420px);
    overflow: auto;
    padding: 16px;
    border-radius: 12px;
    background: #fff;
    color: #1a1a2e;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.pet-sticker-popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pet-sticker-popup-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6c757d;
}

.pet-sticker-popup-close {
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
}

.pet-sticker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.pet-sticker-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.pet-sticker-option:hover {
    background: #f0f2f5;
}

.pet-sticker-option.selected {
    border-color: #E8645A;
}

.pet-sticker-option-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 6px;
}

.pet-sticker-option-none {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #adb5bd;
    background: #f0f2f5;
    border-radius: 6px;
}

.pet-sticker-option-label {
    font-size: 9px;
    line-height: 1.2;
    color: #495057;
    text-align: center;
    max-width: 64px;
}

@media (max-width: 767px) {
    .pet-sticker-popup {
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        transform: none;
        width: 100%;
        border-radius: 14px 14px 0 0;
    }
}

/* ── Feed image lightbox ───────────────────────────────────────────────
   Shared by templates/social/activity_feed.html and status_detail.html:
   both render #imageLightboxModal with prev/next nav and a 1/N counter.
   Used to be an inline <style> in activity_feed.html only, so the
   status-detail lightbox had the buttons unstyled. */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lightbox-nav--prev { left: 10px; }

.lightbox-nav--next { right: 10px; }

.lightbox-counter {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 5;
    padding: var(--ui-space-1) var(--ui-space-3);
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 999px;
}

/* The lightbox shows the full-size original, so a nav tap can mean a multi-
   hundred-kilobyte download. The ring says the app is working; without it the
   old photo just sits there and the page reads as frozen. */
.lightbox-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 6;
    pointer-events: none;
}

.lightbox-spinner-ring {
    display: block;
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: reponje-lightbox-spin 0.8s linear infinite;
}

@keyframes reponje-lightbox-spin {
    to { transform: rotate(360deg); }
}
