/* Feed-specific styles extracted from feed.php */

/* Reactions System Styles */
.reactions-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 0;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

@media (prefers-color-scheme: dark) {
    .reactions-section {
        border-top-color: #374151;
    }
}

.reactions-display {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    background: #f9fafb;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    color: #333;
}

@media (prefers-color-scheme: dark) {
    .reaction-btn {
        background: #262f3d;
        border-color: #4b5563;
        color: #e5e7eb;
    }
}

.reaction-btn:hover {
    border-color: #0080FF;
    background: #eff6ff;
}

@media (prefers-color-scheme: dark) {
    .reaction-btn:hover {
        background: #1e3a5f;
    }
}

.reaction-btn.active {
    border-color: #0080FF;
    background: #dbeafe;
    font-weight: 500;
}

@media (prefers-color-scheme: dark) {
    .reaction-btn.active {
        background: #1e3a5f;
        border-color: #0080FF;
    }
}

.reaction-count {
    font-size: 0.8em;
    color: #6b7280;
}

@media (prefers-color-scheme: dark) {
    .reaction-count {
        color: #9ca3af;
    }
}

.reactions-add-btn,
.reactions-lock-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

@media (prefers-color-scheme: dark) {
    .reactions-add-btn, .reactions-lock-notice {
        background: #262f3d;
        border-color: #4b5563;
    }
}

.reactions-add-btn:hover, .reactions-lock-notice:hover {
    border-color: #0080FF;
    transform: scale(1.1);
}


.reactions-emoji {
    position: absolute;
    font-size: 1.1em;
}

.reactions-plus {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #0080FF;
    color: white;
    border-radius: 50%;
    font-size: 0.75em;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Reactions Picker Modal */
#reactions-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

#reactions-picker-modal.show {
    display: flex;
}

.reactions-picker {
    background: white;
    border-radius: 12px;
    padding: 24px 24px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 60vw;
    animation: slideUp 0.3s ease;
    position: relative;
}

@media (prefers-color-scheme: dark) {
    .reactions-picker {
        background: #1a1f2e;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }
}

.reactions-picker-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #6b7280;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.reactions-picker-close:hover,
.reactions-picker-close:focus-visible {
    background: rgba(0,0,0,0.05);
    color: #111827;
}

@media (prefers-color-scheme: dark) {
    .reactions-picker-close {
        color: #cbd5f5;
    }

    .reactions-picker-close:hover,
    .reactions-picker-close:focus-visible {
        background: rgba(255,255,255,0.08);
        color: #fff;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.reactions-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
}

.reaction-picker-item {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    font-size: 1.5em;
    transition: all 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    .reaction-picker-item {
        background: #262f3d;
    }
}

.reaction-picker-item:hover {
    border-color: #0080FF;
    transform: scale(1.1);
    background: #eff6ff;
}

@media (prefers-color-scheme: dark) {
    .reaction-picker-item:hover {
        background: #1e3a5f;
    }
}

.reaction-picker-item.active {
    border-color: #0080FF;
    background: #dbeafe;
}

@media (prefers-color-scheme: dark) {
    .reaction-picker-item.active {
        background: #1e3a5f;
    }
}

.reactions-picker-title {
    margin-bottom: 12px;
    font-size: 0.9em;
    font-weight: 500;
    color: #333;
    text-align: center;
}

@media (prefers-color-scheme: dark) {
    .reactions-picker-title {
        color: #e5e7eb;
    }
}

.reaction-picker-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Reaction Detail Modal */
.reaction-detail-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3100;
}

.reaction-detail-modal.show {
    display: flex;
}

.reaction-detail-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.reaction-detail-modal__dialog {
    position: relative;
    z-index: 1;
    background: #fff;
    width: min(520px, calc(100vw - 24px));
    max-height: 85vh;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

@media (prefers-color-scheme: dark) {
    .reaction-detail-modal__dialog {
        background: #111827;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
    }
}

.reaction-detail-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

@media (prefers-color-scheme: dark) {
    .reaction-detail-modal__header {
        border-bottom-color: rgba(148, 163, 184, 0.2);
    }
}

.reaction-detail-modal__header h3 {
    margin: 0;
    font-size: 1rem;
}

.reaction-detail-modal__close {
    border: none;
    background: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #475569;
    width: 36px;
    height: 36px;
    border-radius: 18px;
    padding: 5px 10px;
}

.reaction-detail-modal__close:hover,
.reaction-detail-modal__close:focus-visible {
    background: rgba(15, 23, 42, 0.08);
}

@media (prefers-color-scheme: dark) {
    .reaction-detail-modal__close {
        color: #e2e8f0;
    }

    .reaction-detail-modal__close:hover,
    .reaction-detail-modal__close:focus-visible {
        background: rgba(148, 163, 184, 0.2);
    }
}

.reaction-detail-modal__body {
    padding: 16px 20px 20px;
    overflow-y: auto;
}

.reaction-detail-modal__placeholder,
.reaction-detail-modal__empty,
.reaction-detail-modal__loading {
    margin: 0;
    padding: 16px 0;
    text-align: center;
    color: #6b7280;
}

@media (prefers-color-scheme: dark) {
    .reaction-detail-modal__placeholder,
    .reaction-detail-modal__empty,
    .reaction-detail-modal__loading {
        color: #cbd5f5;
    }
}

.reaction-detail-group {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

@media (prefers-color-scheme: dark) {
    .reaction-detail-group {
        border-color: rgba(148, 163, 184, 0.2);
        background: rgba(15, 23, 42, 0.35);
    }
}

.reaction-detail-group__header {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 10px;
}

.reaction-detail-group__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.reaction-detail-group__count {
    font-size: 0.9rem;
    color: #475569;
}

.reaction-detail__action {
    margin-left: auto;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--text);
    background: var(--text);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.reaction-detail__action.reaction-detail__action--remove {
    background: transparent;
    color: #ef4444;
    border-color: #ef4444;
}

.reaction-detail__action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.reaction-detail__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reaction-detail__user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reaction-detail__user-info {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
}

.reaction-detail-avatar {
    flex-shrink: 0;
}

.reaction-detail__user--empty {
    color: #94a3b8;
}

.reaction-detail__user-name {
    font-weight: 500;
}

.reaction-detail__user-name button {
    border: none;
    background: none;
    color: inherit;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.profile-modal__dialog {
    max-width: 560px;
    width: min(560px, calc(100vw - 24px));
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.profile-modal__body {
    position: relative;
    min-height: 160px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
}

.profile-modal .modal__header {
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 2;
}

#user-profile-container {
    margin-top: 8px;
}

.profile-spinner {
    width: 56px;
    height: 56px;
    border: 6px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: profile-spin 1s linear infinite;
    margin: 24px auto;
    display: none;
}

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

/* Activity Event Card */
.activity-event-card {
    margin-top: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    .activity-event-card {
        background: #111827;
        border-color: #374151;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    }
}

.activity-event-card__media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #f3f4f6;
}

.activity-event-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.activity-event-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.activity-event-card__body {
    padding: 12px 14px 14px;
}

.activity-event-card__title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

@media (prefers-color-scheme: dark) {
    .activity-event-card__title {
        color: #e5e7eb;
    }
}

.activity-event-card__meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    color: #6b7280;
    font-size: 13px;
}

@media (prefers-color-scheme: dark) {
    .activity-event-card__meta {
        color: #9ca3af;
    }
}

.activity-event-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.activity-event-card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0f62fe;
    font-weight: 600;
    text-decoration: none;
}

.activity-event-card__link:hover {
    text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
    .activity-event-card__link {
        color: #93c5fd;
    }
}

/* Group/Page Autocomplete */
.group-autocomplete, .event-autocomplete, .place-autocomplete {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: var(--surface, #fff);
    box-shadow: var(--shadow, 0 10px 24px rgba(0,0,0,0.08));
    padding: 10px;
    margin-bottom: 12px;
}

.group-search input, .event-search input, .place-search input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    font-size: 14px;
}

.group-results, .event-results, .place-results {
    margin-top: 10px;
    max-height: 260px;
    overflow-y: auto;
    display: grid;
    gap: 8px;
}

.group-item, .event-item, .place-item {
    padding: 10px 12px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s ease, transform 0.1s ease;
}

.group-item:hover, .event-item:hover, .place-item:hover {
    border-color: #2563eb;
    transform: translateY(-1px);
}

.group-item-title, .event-item-title, .place-item-title {
    font-weight: 700;
    color: var(--text, #0f172a);
    margin-bottom: 4px;
}

.group-item-details, .event-item-details, .place-item-details, .group-no-results, .event-no-results, .place-no-results, .group-loading, .place-loading, .event-loading {
    font-size: 13px;
    color: var(--muted, #6b7280);
}

/* Activity Group Card */
.activity-group-card {
    margin-top: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.activity-group-card__media {
    width: 120px;
    background: #f3f4f6;
    position: relative;
}

.activity-group-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.activity-group-card__body {
    padding: 12px 12px 12px 0;
    flex: 1;
    min-width: 0;
}

.activity-group-card__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.activity-group-card__meta {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.activity-group-card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.activity-group-card__link:hover {
    text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
    .group-autocomplete, .event-autocomplete, .place-autocomplete {
        background: #0b1220;
        border-color: #1f2937;
    }

    .group-item, .event-item, .place-item {
        background: #111827;
        border-color: #1f2937;
    }

    .activity-group-card {
        background: #111827;
        border-color: #1f2937;
    }

    .activity-group-card__title {
        color: #e5e7eb;
    }

    .activity-group-card__meta {
        color: #9ca3af;
    }

    .activity-group-card__link {
        color: #93c5fd;
    }
}

.maplibregl-popup-close-button {
    background-color: var(--primary) !important;
    border: 0;
    border-radius: 8px !important;
    cursor: pointer;
    position: absolute;
    right: -20px !important;
    top:  -20px !important;
}

.maplibregl-popup-content {
    background: #fff;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.1);
    padding: 15px 10px;
    pointer-events: auto;
    position: relative;
    min-width: 60px !important;
}

/* Pinned activity */
.activity--pinned {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25), var(--shadow);
}

.activity-pinned-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .2px;
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.activity-pinned-badge__icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    flex: 0 0 auto;
}

@media (prefers-color-scheme: dark) {
    .activity--pinned {
        border-color: rgba(245, 158, 11, 0.55);
        box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.22), var(--shadow);
    }

    .activity-pinned-badge {
        background: rgba(245, 158, 11, 0.18);
        color: #fbbf24;
        border-color: rgba(245, 158, 11, 0.45);
    }
}