/**
 * Rhodium Intro System - Frontend Styles
 *
 * Minimal, functional CSS for member-facing UI components.
 * Designed to be unobtrusive and work with most WordPress themes.
 *
 * @package Rhodium\IntroSystem
 * @version 1.0.0
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    /* Legacy colors (for existing components) */
    --rhn-primary: #0073aa;
    --rhn-primary-hover: #005a87;
    --rhn-success: #00a32a;
    --rhn-success-bg: #edfaef;
    --rhn-warning: #dba617;
    --rhn-warning-bg: #fcf9e8;
    --rhn-danger: #d63638;
    --rhn-danger-bg: #fcf0f1;
    --rhn-text: #333;
    --rhn-text-muted: #666;
    --rhn-border: #ddd;
    --rhn-bg: #fff;
    --rhn-bg-muted: #f6f7f7;
    --rhn-radius: 4px;
    --rhn-spacing: 20px;
    --rhn-spacing-sm: 10px;

    /* Design System colors (PCC-096 - per DESIGN_SYSTEM.md) */
    --rhn-blue: #007fff;
    --rhn-charcoal: #404041;
    --rhn-yellow: #ffcd00;
    --rhn-light-gray: #d5d8db;
    --rhn-nav-gradient-start: #161e48;
    --rhn-nav-gradient-end: #304d67;

    /* Extended palette (PCC-113 - Design System audit) */
    --rhn-primary-dark: #0066cc;
    --rhn-overlay: rgba(0, 0, 0, 0.5);
    --rhn-overlay-heavy: rgba(0, 0, 0, 0.75);
    --rhn-shadow-color: rgba(0, 0, 0, 0.15);
    --rhn-blue-tint: rgba(0, 127, 255, 0.1);
    --rhn-blue-tint-border: rgba(0, 127, 255, 0.2);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {

    /* PCC-059: DISABLED - Migrated to Tailwind
    .rhn-intro-buttons {
        flex-direction: column;
    }

    .rhn-intro-button {
        width: 100%;
    }
    */
}

/* ==========================================================================
   Dashboard Action Buttons
   ========================================================================== */

.rhn-action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==========================================================================
   Dashboard Inline Forms
   ========================================================================== */

.rhn-inline-form {
    width: 100%;
    margin-top: var(--rhn-spacing);
    padding: var(--rhn-spacing);
    background: var(--rhn-bg);
    border: 1px solid var(--rhn-border);
    border-radius: var(--rhn-radius);
}

.rhn-inline-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--rhn-text);
}

.rhn-inline-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--rhn-border);
    border-radius: var(--rhn-radius);
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

.rhn-inline-form textarea:focus {
    border-color: var(--rhn-primary);
    outline: none;
    box-shadow: 0 0 0 1px var(--rhn-primary);
}

/* PCC-032: Withdrawn status display */
.withdrawn {
    color: var(--rhn-text-muted);
    font-style: italic;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.rhn-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ==========================================================================
   Directory Skeleton Loading (PCC-181)
   ========================================================================== */

.rhn-skeleton-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
}

@media (max-width: 768px) {
    .rhn-skeleton-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

}

/* PCC-182: Empty state styles */
.rhn-empty-state {
    padding: 20px 0;
}

/* ==========================================================================
   Dashboard Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .rhn-action-buttons {
        width: 100%;
    }

    .rhn-action-buttons .rhn-intro-button {
        flex: 1;
    }

    .rhn-inline-form {
        padding: 15px;
    }

}

/* Info container next to photo */
.rhn-intro-info {
    flex: 1;
    min-width: 0;
}

/* Status Badges for Membership Card */
.badge-active {
    background: var(--rhn-success-bg);
    color: #155724;
}

.badge-expiring {
    background: var(--rhn-warning-bg);
    color: #856404;
}

.badge-expired {
    background: var(--rhn-danger-bg);
    color: #721c24;
}

.badge-cancelling {
    background: var(--rhn-warning-bg);
    color: #856404;
}

/* Navigation gradient background */
.nav-gradient {
    background: linear-gradient(180deg, var(--rhn-nav-gradient-start) 0%, var(--rhn-nav-gradient-end) 100%);
}

/* Desktop navigation - shown above 768px */
.desktop-nav,
.desktop-header {
    display: none;
}

/* Mobile navigation - shown below 768px */
.mobile-nav,
.mobile-header {
    display: block;
}

/* Desktop layout */
@media (min-width: 768px) {
    .desktop-nav,
    .desktop-header {
        display: flex;
    }

    .mobile-nav,
    .mobile-header {
        display: none !important;
    }
}

/* Main content area must not overflow the flex container.
   Without min-width:0, flex-1 children use min-width:auto which
   allows content (filter toolbar, swimlanes) to push page wider.

   PCC-582: this must be `clip`, not `hidden`. `overflow-x: hidden` forces
   the other axis from `visible` to `auto`, which turns this element into a
   scroll container — and a scroll container is the containing block for
   `position: sticky` descendants, so the recording archive's sticky filter
   toolbar never pinned. `clip` trims the same overflow without creating a
   scroll container. `hidden` is kept first as the fallback for engines
   without `clip`. */
.flex-1.flex.flex-col {
    min-width: 0;
    overflow-x: hidden;
    overflow-x: clip;
}

/* Tailwind-like utility classes for navigation */
.w-64 { width: 16rem; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-9 { width: 2.25rem; }
.h-9 { height: 2.25rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
/* px-* and py-* utilities removed - now provided by Tailwind CSS */

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.mx-8 { margin-left: 2rem; margin-right: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-white { color: #ffffff; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-red-600 { color: #dc2626; }

/* Brand color utilities */
.text-rhn-text { color: var(--rhn-charcoal); }
.text-rhn-text-muted { color: #6b7280; }
.text-rhn-yellow { color: var(--rhn-yellow); }

.bg-white { background-color: #ffffff; }
.bg-black { background-color: #000000; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-300 { background-color: #d1d5db; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-500 { background-color: #ef4444; }
.bg-rhn-blue { background-color: var(--rhn-blue); }
.bg-rhn-yellow { background-color: var(--rhn-yellow); }
.bg-rhn-bg { background-color: #f9fafb; }

.bg-opacity-50 { --tw-bg-opacity: 0.5; background-color: rgba(0, 0, 0, var(--tw-bg-opacity)); }
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.1); }
.bg-white\/20 { background-color: rgba(255, 255, 255, 0.2); }

.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-rhn-border { border-color: var(--rhn-light-gray); }
.border-white\/20 { border-color: rgba(255, 255, 255, 0.2); }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }
.rounded-t-2xl { border-top-left-radius: 1rem; border-top-right-radius: 1rem; }

.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.right-1 { right: 0.25rem; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.left-3 { left: 0.75rem; }
.right-3 { right: 0.75rem; }

.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

.min-h-screen { min-height: 100vh; }
.max-w-xl { max-width: 36rem; }

.overflow-auto { overflow: auto; }
.hidden { display: none; }

.transform { transform: translateZ(0); }
.translate-y-full { transform: translateY(100%); }
.-translate-y-1\/2 { transform: translateY(-50%); }

.transition-colors { transition-property: background-color, border-color, color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-300 { transition-duration: 300ms; }

/* Filter for logo inversion */

.invert { filter: invert(1); }

/* Hover states */
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-white\/10:hover { background-color: rgba(255, 255, 255, 0.1); }
.hover\:bg-rhn-bg:hover { background-color: #f9fafb; }
.hover\:bg-red-50:hover { background-color: #fef2f2; }
.hover\:text-white:hover { color: #ffffff; }
.hover\:text-gray-300:hover { color: #d1d5db; }
.hover\:text-rhn-blue:hover { color: var(--rhn-blue); }

/* Focus states */
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); }
.focus\:ring-rhn-blue:focus { --tw-ring-color: var(--rhn-blue); }
.focus\:border-transparent:focus { border-color: transparent; }

/* Hidden on large screens */
@media (min-width: 1024px) {
    .lg\:block { display: block; }
}

/* Split Card Layout — one full-width column, children stacked (PCC-728)
 *
 * Was `grid-template-columns: 1fr auto`, the 70/30 header split from the days
 * when the identity and state zones were direct children of the card. Both
 * consumers now do that split in their own inner wrapper (IntroCard's
 * `grid-cols-[70%_30%]`, SuggestionCard's flex row), so the card itself has
 * exactly one child — until an inline form opens.
 *
 * Every inline form (Not Now, Add Note, Rate, Concern) is appended as the
 * card's SECOND child, so auto-placement dropped it into that leftover second
 * track: the form rendered BESIDE the header and squeezed the identity zone to
 * ~122px of overlapping text (docs/verification/PCC-721-form-open.png). One
 * column stacks header then form, which is what the <= 768px breakpoint below
 * has always done and what US-9.2 asks for ("forms expand within card").
 */
.rhn-split-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--rhn-border);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    background: white;
}

/* Belt and braces: anything the card appends after its header spans every
   column, so a future multi-column first row cannot pull an inline form back
   up beside it. */
.rhn-split-card > * + * {
    grid-column: 1 / -1;
}

/* Status-based border colors */
.rhn-split-card.border-green-200 {
    border-color: #bbf7d0;
}

.rhn-split-card.border-green-300 {
    border-color: #86efac;
}

.rhn-split-card.border-blue-200 {
    border-color: #bfdbfe;
}

.rhn-split-card.border-blue-300 {
    border-color: #93c5fd;
}

.rhn-split-card.border-yellow-200 {
    border-color: #fde68a;
}

.rhn-split-card.border-gray-200 {
    border-color: #e5e7eb;
    border-width: 1px; /* Waiting cards have thinner border per wireframe */
}

.rhn-split-card.border-gray-300 {
    border-color: #d1d5db;
}

/* Background color classes */
.rhn-split-card.bg-green-50 {
    background-color: #f0fdf4;
}

.rhn-split-card.bg-blue-50 {
    background-color: #eff6ff;
}

.rhn-split-card.bg-gray-100 {
    background-color: #f3f4f6;
}

.rhn-split-card.bg-white {
    background-color: #ffffff;
}

/* Orange colors for Not Available cards (PCC-049) */
.rhn-split-card.border-orange-300 {
    border-color: #fdba74;
}

.rhn-split-card.bg-orange-50 {
    background-color: #fff7ed;
}

/* Yellow colors for Needs Approval cards (Action Required) */
.rhn-split-card.border-yellow-300 {
    border-color: #fcd34d;
}

.rhn-split-card.bg-yellow-50 {
    background-color: #fefce8;
}

/* Inline Forms (Not Now, Add Note, Rating) */
.rhn-add-note-form {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
}

.rhn-add-note-form textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--rhn-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
}

.rhn-add-note-form textarea:focus {
    outline: none;
    border-color: var(--rhn-blue);
    box-shadow: 0 0 0 2px var(--rhn-blue-tint);
}

/* Form Action Buttons */
.rhn-add-note-form button {
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

/* Responsive: Stack cards on mobile */
@media (max-width: 768px) {
    .rhn-split-card {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

}

/* Filter Pill Dropdown (matches wireframe) */
.filter-pill {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #ffffff;
    border: 1px solid var(--rhn-light-gray, #d5d8db);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    padding-right: 2.5rem;
    font-size: 0.875rem;
    color: var(--rhn-charcoal, #404041);
    cursor: pointer;
    transition: all 0.15s ease;
    /* Custom dropdown arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.filter-pill:hover {
    border-color: var(--rhn-blue, #007fff);
    background-color: var(--rhn-bg-muted, #f6f7f7);
}

.filter-pill:focus {
    outline: none;
    border-color: var(--rhn-blue, #007fff);
    box-shadow: 0 0 0 2px var(--rhn-blue-tint-border);
}

/* Filter select dropdowns */
.rhn-filter-select {
    min-width: 8rem;
    background-color: var(--rhn-bg);
    border: 1px solid var(--rhn-border);
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--rhn-charcoal);
    cursor: pointer;
}

.rhn-filter-select:hover {
    border-color: var(--rhn-blue);
}

.rhn-filter-select:focus {
    outline: none;
    border-color: var(--rhn-blue);
    box-shadow: 0 0 0 2px var(--rhn-blue-tint-border);
}

/* Responsive filter toolbar */
@media (max-width: 768px) {
    .rhn-filter-select {
        width: 100%;
    }

}

/* Row container — CSS grid, columns set per variant */
.rhn-member-row {
    display: grid;
    align-items: center;
    width: 100%;
    gap: 16px;
    background: white;
    border: 1px solid #e5e7eb;
    padding: 12px 16px;
    margin-bottom: 8px;
    grid-template-columns: 1fr auto; /* default: identity + action */
}

/* Zone: Identity */
.rhn-row-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.rhn-row-avatar-link {
    flex-shrink: 0;
}

.rhn-row-info {
    min-width: 0;
}

/* Name wrapper: name link + tier badges on same line */

.rhn-row-name-link {
    font-weight: 700;
    color: #111827;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rhn-row-name-link:hover {
    text-decoration: underline;
}

/* Zone: Context */
.rhn-row-context {
    min-width: 0;
}

/* Zone: Action — right-aligned, stacked vertically */
.rhn-row-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

/* Activity indicator */
.rhn-row-activity {
    font-size: 11px;
    color: #9ca3af;
}

/* Truncation tooltips — desktop hover + mobile tap (PCC-P) */
[data-rhn-tooltip] {
    position: relative;
    cursor: pointer;
}
[data-rhn-tooltip]::after {
    content: attr(data-rhn-tooltip);
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 11px;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: normal;
    max-width: 220px;
    z-index: 50;
    pointer-events: none;
}
[data-rhn-tooltip]:hover::after {
    display: block;
}

/* ----------------------------------------
   Density Variant: full (Directory)
   All zones visible, 60px avatar, 3-column grid
   ---------------------------------------- */
.rhn-member-row[data-variant="full"] {
    grid-template-columns: 30% 1fr auto;
}

/* ----------------------------------------
   Density Variant: standard (Home PLY/Picks, Dashboard)
   Hide tier, company, tags, activity. Show location, bio.
   44px avatar.
   ---------------------------------------- */

.rhn-member-row[data-variant="standard"] .rhn-row-company,
.rhn-member-row[data-variant="standard"] .rhn-row-context,
.rhn-member-row[data-variant="standard"] .rhn-row-activity {
    display: none;
}

/* ----------------------------------------
   Density Variant: compact (Groups, Proposals, Search)
   Name + button only. 40px avatar.
   ---------------------------------------- */

.rhn-member-row[data-variant="compact"] .rhn-row-company,
.rhn-member-row[data-variant="compact"] .rhn-row-location,
.rhn-member-row[data-variant="compact"] .rhn-row-context,
.rhn-member-row[data-variant="compact"] .rhn-row-activity {
    display: none;
}

/* ========================================
   UM DIRECTORY: Custom Filter Bar (PCC-117)
   ======================================== */

.rhn-directory-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

/* Keyword search input */
.rhn-dir-keyword {
    padding: 8px 12px 8px 32px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    width: 176px;
    outline: none;
    transition: border-color 0.15s;
}

.rhn-dir-keyword:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Filter chips — .rhn-directory-filters prefix overrides UM's .um button styles */
.rhn-directory-filters .rhn-dir-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    font-size: 14px;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.rhn-directory-filters .rhn-dir-filter-chip:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.rhn-directory-filters .rhn-dir-filter-chip.active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}

/* Sort button — .rhn-directory-filters prefix overrides UM's .um button styles */
.rhn-directory-filters .rhn-dir-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    background: none;
    /* PCC-739: `border: 0`, not `border: none`. The shorthand resets every border
       longhand, so `border: none` leaves border-width at its initial `medium` (3px)
       and relies on border-style: none to hide it. This button lives inside the SPA,
       where index.css now re-asserts `border-style: solid` above the theme's element
       reset — which un-hid that 3px. `border: 0` zeroes the width, so the button has
       no border no matter what wins on style. */
    border: 0;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.rhn-directory-filters .rhn-dir-sort-btn:hover {
    background: #f3f4f6;
}

/* Sort dropdown */
.rhn-dir-sort-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 50;
    min-width: 180px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 4px 0;
    margin-top: 4px;
}

.rhn-dir-sort-dropdown.hidden {
    display: none;
}

.rhn-directory-filters .rhn-dir-sort-dropdown button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    color: #374151;
    background: none;
    /* PCC-741: `border: 0`, not `border: none` — the same trap as .rhn-dir-sort-btn
       above. These options only exist while the menu is open, which is why PCC-739's
       scan of the closed page missed them: they have been drawing a 3px box inside
       #rhn-app since that PCC shipped. Measured solid/3px on /members/rolodex/. */
    border: 0;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s;
}

.rhn-directory-filters .rhn-dir-sort-dropdown button:hover {
    background: #f9fafb;
}

.rhn-directory-filters .rhn-dir-sort-dropdown button.active {
    color: #2563eb;
    font-weight: 500;
}

/* Location dropdown (PCC-121b) */

.rhn-dir-location-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 8px;
}

.rhn-dir-location-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* PCC-121c: Google Places Autocomplete dropdown z-index fix */
.pac-container {
    z-index: 10000 !important;
}

/* ========================================
   UM DIRECTORY: Load More (PCC-117)
   ======================================== */

.rhn-dir-load-more {
    text-align: center;
    padding: 24px 0;
}

.rhn-load-more-btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.rhn-load-more-btn:hover {
    background: #f9fafb;
}

.rhn-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================
   UM DIRECTORY: Responsive (PCC-117)
   ======================================== */

@media (max-width: 768px) {
    .rhn-member-row {
        grid-template-columns: 1fr;
        align-items: flex-start;
        gap: 12px;
    }

    .rhn-row-context {
        padding: 0;
    }

    .rhn-row-action {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-height: auto;
        gap: 12px;
    }

    /* Filter bar: stack vertically on mobile */
    .rhn-directory-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .rhn-dir-keyword {
        width: 100%;
    }

    .rhn-directory-filters .ml-auto {
        margin-left: 0;
        justify-content: flex-start;
    }
}

/* SVG social icons (PCC-261: rhn-dir-social → rhn-row-social) */

.rhn-row-social-icon {
    opacity: 0.35;
}

.rhn-row-lock-overlay {
    position: absolute;
    bottom: -2px;
    right: -3px;
}

/* Tag pill: outer span is tooltip container (overflow:visible so ::after escapes) */
.rhn-row-tag-pill {
    max-width: 120px;
    overflow: visible;
}
/* Inner text span handles truncation so overflow:hidden doesn't clip the tooltip ::after */
.rhn-row-tag-pill-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Edit profile button (PCC-261: rhn-dir-edit-profile → rhn-row-edit-profile) */
/* PCC-917: rhn-row-edit-profile → rhn-edit-profile-link. The rhn-row- prefix claimed a row part, but this is the Card State Pipeline's SELF affordance and RosterMemberList and SearchResultsPage render it outside any row. */
.rhn-edit-profile-link {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.15s;
}

.rhn-edit-profile-link:hover {
    background-color: #f9fafb;
    color: #374151;
    text-decoration: none;
}

/* Filter bar responsive layout (R2) */
.rhn-filter-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.rhn-filter-chips-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Overflow "Filters" chip hidden — individual chips are visible on desktop/tablet,
   and the entire chips row is hidden on mobile (replaced by mobile trigger) */
.rhn-dir-filter-chip[data-filter="overflow"] {
    display: none;
}

/* Tablet: scroll strip for filter chips */
@media (max-width: 1024px) and (min-width: 769px) {
    .rhn-filter-chips-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .rhn-filter-chips-row::-webkit-scrollbar {
        display: none;
    }

    .rhn-filter-chips-row .rhn-dir-filter-chip {
        flex-shrink: 0;
    }
}

/* Mobile: show trigger, hide chips row, enable bottom sheet */
@media (max-width: 768px) {

    .rhn-filter-chips-row {
        display: none;
    }

}

/* ==========================================================================
   Charity Selection - Profile Edit Page (PCC-151)
   ========================================================================== */

.rhn-charity-section {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.rhn-charity-section h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
}

.rhn-charity-list {
    margin-bottom: 16px;
}

.rhn-charity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    margin-bottom: 6px;
    background: #fafafa;
}

.rhn-charity-item .rhn-charity-name {
    font-weight: 500;
}

/* PCC-857 (US-19.1:11913 "THEN "Remove" SHALL render as a quiet text link"):
   `.rhn-charity-item .rhn-charity-remove` used to paint a red outlined box here
   (border 1px solid #d63638, 4px 12px padding, 3px radius) and fill it red on
   hover, which is the boxed button PCC-854 measured on
   /user/5018/?um_action=edit. The element is now an <a> carrying its own
   Tailwind utilities (text-xs text-gray-400 hover:text-rhn-danger
   hover:underline), the same dress the Asks and Gives row actions wear, so
   there is nothing left for this stylesheet to say about it. "+ Add Charity"
   below keeps its fill: it is the section's only button. */

.rhn-charity-empty-state {
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    margin-bottom: 12px;
}

.rhn-charity-empty-state svg {
    display: block;
    margin: 0 auto 12px;
    color: #d5d8db;
}

.rhn-charity-empty-state p {
    color: #646970;
    margin: 0;
}

.rhn-charity-max-notice {
    color: #dba617;
    font-size: 13px;
    margin-bottom: 8px;
}

.rhn-add-charity-btn {
    display: inline-block;
    padding: 8px 16px;
    /* PCC-854 (US-19.1:11395 "'+ Add Charity' SHALL be the section's only button"):
       #2271b1 here, but the members-area template's `.um button` rule painted this
       #007fff on the profile edit form and that is what the page has always shown.
       Scoping that rule to UM's own controls (PCC-854) uncovered this fill, so it is
       set to the value the page already had — the same #007fff as .rhn-add-item-btn on
       the Asks and Gives sections, and as `bg-rhn-blue` in wireframe
       profile-edit-asks-gives-v2.html. */
    background: #007fff;
    color: #fff;
    /* PCC-741: `border: 0`, not `border: none` — see .rhn-dir-sort-btn above. This
       button is rendered by the edit-profile-charities React island, and PCC-741
       re-asserts border-style under [data-rhn-island]. Measured solid/3px on
       /user/5018/?um_action=edit with that rule. */
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

/* PCC-854: the element also carries Tailwind's `text-rhn-blue`, and the island bundle
   (frontend/dist/assets/main-*.css) is enqueued after this stylesheet — so that utility
   tied with the `color` above on specificity (0,1,0) and won on source order the moment
   the theme rule stopped forcing white. Measured #007fff text on the fill. `button.`
   scores (0,1,1) and settles it; the rule above keeps its exact selector because
   tests/Unit/Assets/BorderShorthandTest.php asserts `border: 0` on it by name. */
button.rhn-add-charity-btn {
    color: #fff;
}

.rhn-add-charity-btn:hover {
    background: #0066cc;
}

/* ==========================================================================
   Charity Modal (PCC-151)
   ========================================================================== */

.rhn-charity-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
}

.rhn-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.rhn-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.rhn-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.rhn-modal-close {
    background: none;
    /* PCC-741: `border: 0`, not `border: none` — see .rhn-dir-sort-btn above. Two
       React scopes reach this class: DonationModal inside #rhn-app (already drawing
       3px since PCC-739 — measured solid/3px today) and the charity picker inside
       [data-rhn-island]. */
    border: 0;
    font-size: 24px;
    cursor: pointer;
    color: #646970;
    line-height: 1;
    padding: 0 4px;
}

.rhn-modal-close:hover {
    color: #1d2327;
}

.rhn-modal-body {
    padding: 20px;
}

/* Recommended charities in modal */

.rhn-recommended-list {
    margin-bottom: 20px;
}

.rhn-recommended-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.rhn-recommended-item:hover:not(.rhn-already-added) {
    background: #f0f6fc;
    border-color: #2271b1;
}

.rhn-recommended-item.rhn-already-added {
    opacity: 0.5;
    cursor: default;
}

/* Search in modal */

.rhn-search-result {
    margin-top: 12px;
}

/* ==========================================================================
   Profile Charity Display + Donate Buttons (PCC-152)
   ========================================================================== */

.rhn-profile-charity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.rhn-profile-charity-item:last-child {
    border-bottom: none;
}

.rhn-profile-charity-item .rhn-charity-name {
    font-weight: 500;
}

.rhn-donate-btn {
    padding: 6px 16px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

/* Donation Modal (PCC-152 markup, rebuilt in React by PCC-570)
 *
 * The PCC-152 modal was vanilla JS (assets/js/donation-widget.js, deleted in
 * ebfa651f) that rendered .rhn-modal-overlay / .rhn-modal-content /
 * .rhn-donation-success-inner and toggled `display` by hand. Those selectors
 * had no markup left, and worse, the `display: none` defaults they left behind
 * silently hid the React modal's success and error panels — the donation was
 * recorded and the donor was shown a blank box. Only the rules the React
 * DonationModal actually uses survive, and none of them hide anything.
 */
.rhn-donation-modal {
    /* Above UM/Divi overlays; the island's own Tailwind classes handle layout. */
    z-index: 100000;
}

.rhn-donation-context {
    padding: 8px 12px;
    background: #f0f6fc;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #2271b1;
}

.rhn-donation-success {
    text-align: center;
    padding: 24px 16px;
}

.rhn-donation-error {
    padding: 8px 12px;
    background: #fcf0f1;
    border: 1px solid #d63638;
    border-radius: 4px;
    color: #d63638;
    font-size: 13px;
    margin-top: 12px;
}

/* ==========================================================================
   Giving Page - Donation History (PCC-153)
   ========================================================================== */

.rhodium-giving {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.rhodium-giving h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px;
}

.rhodium-giving h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 24px 0 12px;
}

/* Summary cards */
.rhn-giving-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.rhn-giving-summary-card {
    flex: 1;
    padding: 16px;
    background: #f0f6fc;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    text-align: center;
}

.rhn-giving-summary-card .rhn-giving-summary-label {
    display: block;
    font-size: 13px;
    color: #646970;
    margin-bottom: 4px;
}

.rhn-giving-summary-card .rhn-giving-summary-amount {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #1d2327;
}

.rhn-giving-summary-card .rhn-giving-summary-count {
    display: block;
    font-size: 13px;
    color: #646970;
}

/* Donation tables */
.rhn-giving-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.rhn-giving-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid #c3c4c7;
    font-size: 13px;
    font-weight: 600;
    color: #646970;
}

.rhn-giving-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.rhn-giving-empty {
    color: #646970;
    font-style: italic;
    padding: 16px 0;
}

@media (max-width: 600px) {
    .rhn-giving-summary {
        flex-direction: column;
    }

    .rhn-giving-table {
        font-size: 13px;
    }

    .rhn-giving-table th,
    .rhn-giving-table td {
        padding: 6px 8px;
    }
}

/* Modal wrapper — fixed overlay container, hidden by default */
.rhn-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
}

/* Transition: fade in overlay + scale up content */

.rhn-modal .rhn-modal-content {
    transform: scale(0.95);
    transition: transform 200ms ease;
}

/* Footer — action buttons container */
.rhn-modal-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
}

/* Modal body text styles */
.rhn-modal-body p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--rhn-text, #1d2327);
}

.rhn-modal-body p:last-child {
    margin-bottom: 0;
}

/* Body scroll lock when modal is open */
body.rhn-modal-open {
    overflow: hidden;
}
