/**
 * PeepSo Brand Overrides — America Visualized
 *
 * Loaded only on pages containing a PeepSo shortcode.
 * Overrides PeepSo's default orange/teal palette with the AV brand.
 *
 * Brand palette:
 *   Primary purple:   #752776
 *   Secondary purple: #92278f
 *   Pink:             #dc4797
 *   Orange:           #f7941d
 *   Dark purple:      #5a1d5b
 *   Pink hover:       #b02aac
 */

/* ==========================================================================
   0. Icon Font Fix — placeholder, real rules are in Section 0b AFTER Poppins.
   Must come after the Poppins wildcard rule to win the cascade.
   ========================================================================== */

/* ==========================================================================
   1. CSS Custom Property Overrides
   Override PeepSo's two variable systems (frontend.css + template.css)
   to cascade brand colors through all components automatically.
   ========================================================================== */

body {
    /* --- frontend.css variables --- */
    --COLOR--PRIMARY: #752776;
    --COLOR--PRIMARY--SHADE: #d4a5d5;
    --COLOR--PRIMARY--LIGHT: #92278f;
    --COLOR--PRIMARY--ULTRALIGHT: #f5e6f5;
    --COLOR--PRIMARY--DARK: #5a1d5b;

    --COLOR--ALT: #dc4797;
    --COLOR--ALT--LIGHT: #dc4797;
    --COLOR--ALT--DARK: #b02aac;

    /* Gradient (profile header, cover photo overlay) */
    --COLOR--GRADIENT--ONE: #92278f;
    --COLOR--GRADIENT--TWO: #dc4797;

    /* Border radius — slightly rounded, not square */
    --BORDER-RADIUS: 8px;

    /* --- template.css variables --- */
    --ps_COLOR-PRIMARY: #752776;
    --ps_COLOR-PRIMARY-L: #92278f;
    --ps_COLOR-PRIMARY-D: #5a1d5b;
    --ps_COLOR-LINK: #752776;
    --ps_COLOR-LINK-HOVER: #dc4797;
    --ps_FONT-FAMILY: "Poppins", sans-serif;
    --ps_BORDER-RADIUS: 8px;
}

/* ==========================================================================
   2. Font Family — Poppins everywhere on PeepSo pages
   PeepSo hardcodes font-family on some elements beyond the variable.
   ========================================================================== */

.ps-page-peepso,
.ps-page-peepso *,
.ps-form,
.ps-form *,
.ps-post,
.ps-post *,
.ps-profile,
.ps-profile *,
.ps-members,
.ps-members *,
.ps-notifications,
.ps-notifications *,
.ps-navbar,
.ps-navbar *,
.ps-modal,
.ps-modal * {
    font-family: "Poppins", sans-serif;
}

/* ==========================================================================
   0b. Icon Font Fix — MUST come after Poppins rule (Section 2) so !important
   wins the cascade. Our Poppins wildcard (*) was overriding FA6 glyphs,
   causing raw hex codepoints (F154, F1E0, F510…) to render instead of icons.

   Covers ALL contexts PeepSo icons appear in, not just .ps-page-peepso,
   because profile headers, modals and navbar sit outside that wrapper.
   ========================================================================== */

/* Solid icons — FA6 Free weight 900
   Targets both <i> and <span> since PeepSo uses both elements for icons */
i.gcis, span.gcis,
i.gci-solid, span.gci-solid,
i[class*="gcis-"], span[class*="gcis-"],
i[class*="gci-"], span[class*="gci-"],
.ps-page-peepso .fas,
.ps-page-peepso .fa-solid,
.ps-navbar .fas,
.ps-navbar .gcis,
.ps-navbar [class*="gcis-"],
.ps-modal .gcis,
.ps-modal [class*="gcis-"] {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

/* Regular icons — FA6 Free weight 400 */
i.gcir, span.gcir,
i.gci-regular, span.gci-regular,
i[class*="gcir-"], span[class*="gcir-"],
.ps-page-peepso .far,
.ps-page-peepso .fa-regular,
.ps-page-peepso .gcir,
.ps-navbar .far,
.ps-navbar .gcir,
.ps-modal .gcir {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
}

/* Light icons — FA6 Free weight 300 */
i.gcil, span.gcil,
i.gci-light, span.gci-light,
i[class*="gcil-"], span[class*="gcil-"],
.ps-page-peepso .fal,
.ps-page-peepso .fa-light {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 300 !important;
}

/* Brand icons — FA6 Brands */
i.gcib, span.gcib,
i.gci-brands, span.gci-brands,
i[class*="gcib-"], span[class*="gcib-"],
.ps-page-peepso .fab,
.ps-page-peepso .fa-brands,
.ps-navbar .fab,
.ps-modal .fab {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

/* PeepSo UI icon font — keep peepsoui glyphs intact */
i[class*="psui-"], span[class*="psui-"],
i[class*="peepsoui-"], span[class*="peepsoui-"],
.ps-page-peepso [class*="psui-"],
.ps-page-peepso [class*="peepsoui-"] {
    font-family: "peepsoui" !important;
    font-weight: normal !important;
}

/* ==========================================================================
   3. Buttons — pink pills with white text
   ========================================================================== */

.ps-btn {
    border-radius: 2rem !important;
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

/* Primary action buttons — pink background */
.ps-btn--action,
.ps-btn--join,
.ps-btn--login,
.ps-form__row--submit .ps-btn {
    background: #dc4797 !important;
    color: #fff !important;
    box-shadow: none !important;
    border: none !important;
}

.ps-btn--action:hover,
.ps-btn--join:hover,
.ps-btn--login:hover,
.ps-form__row--submit .ps-btn:hover {
    background: #b02aac !important;
    color: #fff !important;
}

.ps-btn:active {
    transform: scale(0.98);
}

/* Secondary / outline buttons — purple text */
.ps-btn--app {
    color: #752776;
    border-color: #752776;
}

.ps-btn--app:hover {
    background: #752776;
    color: #fff;
}

/* Danger/abort buttons — keep red but pill-shaped */
.ps-btn--abort,
.ps-btn--delete {
    border-radius: 2rem !important;
}

/* ==========================================================================
   4. Form Fields — match vision-form.css patterns
   ========================================================================== */

.ps-input {
    font-family: "Poppins", sans-serif;
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ps-input:focus {
    border-color: #dc4797 !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(220, 71, 151, 0.15) !important;
}

.ps-input--select:focus {
    border-color: #dc4797 !important;
}

.ps-form__label {
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    color: #333;
}

.ps-form__required {
    color: #dc4797;
}

.ps-form__legend {
    color: #752776;
    font-weight: 700;
}

/* Checkbox / radio styling */
.ps-checkbox input:checked + label::before,
.ps-checkbox--radio input:checked + label::before {
    background-color: #dc4797;
    border-color: #dc4797;
}

.ps-checkbox--switch input:checked + label::before {
    background-color: #dc4797;
}

/* Character count */
.ps-form__chars-count {
    color: #737378;
    font-size: 0.8rem;
}

/* Error states */
.ps-form__error {
    color: #d32f2f;
}

/* ==========================================================================
   5. Links — purple default, pink on hover
   ========================================================================== */

.ps-page-peepso a {
    color: #752776;
}

.ps-page-peepso a:hover,
.ps-page-peepso a:focus {
    color: #dc4797;
}

/* ==========================================================================
   6. Navigation Tabs
   ========================================================================== */

.ps-tabs__item {
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.ps-tabs__item--active {
    color: #752776 !important;
    border-color: #dc4797 !important;
}

.ps-tabs__item:hover {
    color: #dc4797;
}

.ps-tabs__count {
    background: #dc4797;
    color: #fff;
}

/* Navbar */
.ps-navbar__menu-link {
    font-family: "Poppins", sans-serif;
}

.ps-navbar__menu-link:hover {
    color: #dc4797;
}

.ps-navbar__menu-item--active .ps-navbar__menu-link {
    color: #752776;
}

/* ==========================================================================
   7. Activity Stream Posts
   ========================================================================== */

.ps-post__author a {
    color: #752776;
    font-weight: 600;
}

.ps-post__author a:hover {
    color: #dc4797;
}

.ps-post__action:hover {
    color: #dc4797;
}

.ps-post__action--reaction.active,
.ps-post__action--reaction:hover {
    color: #dc4797;
}

/* Post date and meta — subtle */
.ps-post__date a,
.ps-post__date {
    color: #737378;
}

.ps-post__date a:hover {
    color: #dc4797;
}

/* Pinned post badge */
.ps-post--pinned::before {
    color: #f7941d;
}

/* Postbox — compose area */
.ps-postbox .ps-btn--postbox {
    background: #dc4797 !important;
    color: #fff !important;
    box-shadow: none !important;
}

.ps-postbox .ps-btn--postbox:hover {
    background: #b02aac !important;
}

/* Hashtags */
.ps-post__hashtags a {
    color: #92278f;
}

.ps-post__hashtags a:hover {
    color: #dc4797;
}

/* ==========================================================================
   8. Profile Page
   ========================================================================== */

.ps-profile__about-field-title {
    color: #752776;
    font-weight: 600;
}

.ps-profile__progress-bar {
    background: linear-gradient(90deg, #752776, #dc4797) !important;
}

.ps-profile__edit a {
    color: #752776;
}

.ps-profile__edit a:hover {
    color: #dc4797;
}

/* Profile tab navigation */
.ps-profile .ps-tabs__item--active {
    color: #752776 !important;
    border-color: #dc4797 !important;
}

/* ==========================================================================
   9. Registration Page
   ========================================================================== */

.ps-form--register .ps-form__legend,
.ps-register h2,
.ps-register h3 {
    color: #752776;
    font-weight: 700;
}

/* Registration submit — matches Impreza us-btn-style_1 exactly.
   Covers both <button> and <input type="submit"> (PeepSo uses the latter),
   and directly overrides .ps-btn--sm sizing. */
.ps-form--register .ps-form__row--submit .ps-btn,
.ps-form--register .ps-btn--sm,
.ps-form--register button[type="submit"],
.ps-form--register input[type="submit"] {
    background: #dc4797 !important;
    color: #fff !important;
    padding: 11.2px 27.2px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 32px !important;
    border: none !important;
    box-shadow: none !important;
    min-width: 200px;
    width: auto !important;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.ps-form--register .ps-form__row--submit .ps-btn:hover,
.ps-form--register .ps-btn--sm:hover,
.ps-form--register button[type="submit"]:hover,
.ps-form--register input[type="submit"]:hover {
    background: #b02aac !important;
}

.ps-form--register .ps-form__row--submit .ps-btn:active,
.ps-form--register button[type="submit"]:active,
.ps-form--register input[type="submit"]:active {
    transform: scale(0.98);
}

/* Terms/consent links */
.ps-form--register a {
    color: #752776;
}

.ps-form--register a:hover {
    color: #dc4797;
}

/* ==========================================================================
   10. Members Directory
   ========================================================================== */

.ps-members__header {
    font-family: "Poppins", sans-serif;
}

.ps-member a:hover {
    color: #dc4797;
}

/* Member search input */
.ps-members__search .ps-input:focus {
    border-color: #dc4797 !important;
}

/* Filter tabs */
.ps-members__tab--active {
    color: #752776;
    border-color: #dc4797;
}

/* ==========================================================================
   11. Notifications
   ========================================================================== */

.ps-notification--unread {
    border-left-color: #dc4797 !important;
}

.ps-notification a {
    color: #752776;
}

.ps-notification a:hover {
    color: #dc4797;
}

/* Notification count badge */
.ps-navbar__notifications .ps-btn__count,
.ps-js-notifications-count {
    background: #dc4797;
    color: #fff;
}

/* ==========================================================================
   12. Alerts & Messages
   ========================================================================== */

.ps-alert {
    border-radius: 8px;
    font-family: "Poppins", sans-serif;
}

.ps-alert a {
    color: #752776;
    font-weight: 600;
}

.ps-alert a:hover {
    color: #dc4797;
}

/* ==========================================================================
   13. Comments (PeepSo activity comments)
   ========================================================================== */

.ps-comment .ps-post__author a {
    color: #752776;
    font-weight: 600;
}

.ps-comment .ps-post__author a:hover {
    color: #dc4797;
}

/* ==========================================================================
   14. Avatars — purple border accent
   ========================================================================== */

.ps-avatar--online::after {
    background-color: #00b935;
}

/* ==========================================================================
   15. Modals & Lightboxes
   ========================================================================== */

.ps-modal .ps-btn--action {
    background: #dc4797 !important;
    color: #fff !important;
}

.ps-modal .ps-btn--action:hover {
    background: #b02aac !important;
}

.ps-modal h3,
.ps-modal h4 {
    color: #752776;
    font-family: "Poppins", sans-serif;
}

/* ==========================================================================
   16. Loading Indicators
   ========================================================================== */

.ps-loading-pulse {
    background-color: #dc4797;
}

/* ==========================================================================
   17. Dropdown Menus
   ========================================================================== */

.ps-dropdown a:hover {
    background-color: #f5e6f5;
    color: #752776;
}

/* ==========================================================================
   18. Tags
   ========================================================================== */

.ps-tag {
    background: #f5e6f5;
    color: #752776;
    border-radius: 2rem;
}

.ps-tag:hover {
    background: #dc4797;
    color: #fff;
}

/* ==========================================================================
   19. Search
   ========================================================================== */

.ps-search .ps-input:focus {
    border-color: #dc4797 !important;
}

/* ==========================================================================
   20. Password Strength / Visibility Toggle
   ========================================================================== */

.ps-password-preview {
    color: #752776;
}

.ps-password-preview:hover {
    color: #dc4797;
}

/* ==========================================================================
   21. Registration Page — Checklist Fields as Pill Toggles
   Converts ps-checkbox groups (e.g. "Issues I Care About") into
   selectable pill buttons matching the vision submission form style.
   ========================================================================== */

/* Flex-wrap the field container so pills flow naturally */
.ps-form--register .ps-form__field {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: flex-start;
}

/* When only one child exists it's a single-checkbox field (e.g. terms) —
   revert to block so it doesn't look odd beside its label */
.ps-form--register .ps-form__field > .ps-checkbox:only-child {
    display: block;
    width: 100%;
}

/* Visually hide the native checkbox while keeping it focusable/accessible */
.ps-form--register .ps-form__field .ps-checkbox__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Restore visibility for single-checkbox rows (terms, single toggles) */
.ps-form--register .ps-form__field > .ps-checkbox:only-child .ps-checkbox__input {
    position: static;
    opacity: 1;
    width: 1rem;
    height: 1rem;
    pointer-events: auto;
}

/* Pill label — inactive state */
.ps-form--register .ps-form__field .ps-checkbox__label {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #752776;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
    margin: 0;
    user-select: none;
}

.ps-form--register .ps-form__field .ps-checkbox__label:hover {
    background: #f0e0f0;
    border-color: #dc4797;
    color: #752776;
}

/* Pill label — selected/active state */
.ps-form--register .ps-form__field .ps-checkbox__input:checked + .ps-checkbox__label {
    background: #dc4797;
    border-color: #dc4797;
    color: #fff;
}

.ps-form--register .ps-form__field .ps-checkbox__input:checked + .ps-checkbox__label:hover {
    background: #b02aac;
    border-color: #b02aac;
    color: #fff;
}

/* Keyboard-focus ring so accessibility isn't lost with hidden input */
.ps-form--register .ps-form__field .ps-checkbox__input:focus + .ps-checkbox__label {
    outline: 2px solid #dc4797;
    outline-offset: 2px;
}

/* ==========================================================================
   22. Messages (PeepSo Messages addon)
   ========================================================================== */

/* Send button — circle arrow in compose area */
.ps-messages__send-btn,
.ps-messages .ps-btn--action,
.ps-messages [class*="send"],
.ps-msg__send,
.gcm-send-btn,
[class*="ps-messages"] .ps-btn {
    background: #dc4797 !important;
    color: #fff !important;
    border-color: #dc4797 !important;
}

[class*="ps-messages"] .ps-btn:hover,
.ps-messages__send-btn:hover {
    background: #b02aac !important;
    border-color: #b02aac !important;
}

/* Active/selected icon buttons in the messages toolbar */
.ps-messages .ps-btn--active,
.ps-messages .ps-btn.active,
.ps-messages [class*="btn"][class*="active"],
.ps-messages__tab--active {
    background: #dc4797 !important;
    color: #fff !important;
}

/* Message toolbar action buttons (sticker, gif, image icons) */
.ps-messages__toolbar .ps-btn,
.ps-messages__toolbar button,
.ps-messages__toolbar [class*="btn"] {
    color: #752776;
}

.ps-messages__toolbar .ps-btn:hover,
.ps-messages__toolbar button:hover {
    color: #dc4797;
    background: transparent !important;
}

/* Unread badge / count dots */
.ps-messages .ps-btn__count,
[class*="ps-messages"] .ps-badge {
    background: #dc4797;
    color: #fff;
}

/* Active conversation highlight */
.ps-messages__thread--active,
.ps-messages__conversation--active {
    border-left-color: #dc4797 !important;
}

/* Links inside messages */
.ps-messages a {
    color: #752776;
}

.ps-messages a:hover {
    color: #dc4797;
}
