/*
 * Shared action-button treatment for member-feature modules.
 * Loaded conditionally by header.php and header_member.php.
 * Navigation, tabs, dropdown triggers, icon controls and overlays retain their
 * module-specific styling.
 */
:root {
    --member-action-start: #d6558f;
    --member-action-end: #9052f6;
    --member-action-hover-start: #00ffb1;
    --member-action-hover-end: #9052f5;
}

@property --member-action-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

@property --member-action-x {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 10%;
}

@keyframes member-action-border {
    from { --member-action-angle: 0deg; }
    to { --member-action-angle: 360deg; }
}

@keyframes member-action-position {
    from { --member-action-x: 10%; }
    to { --member-action-x: 90%; }
}

:is(
    .btn,
    .btn-default,
    .btn-primary,
    .btn-success,
    .btn-info,
    .btn-warning,
    .btn-danger,
    .add-btns,
    .my_add_button,
    .is2-post-btn,
    .wall-load-more,
    .wall-cover-upload,
    .wall-comment-form button[type="submit"],
    .bids-clear,
    .bids-detail-btn,
    .bids-submit-btn,
    .bids-company-more-info,
    .bids-company-gate-later,
    .bids-company-gate-signup,
    .interest-btn,
    .modal-btn,
    .bid-cancel-btn,
    .bid-submit-btn,
    .create-bid-submit,
    [data-map-button],
    [data-remove-selected],
    [data-remove-id],
    #member-profile-save,
    [data-profile-confirm-cancel],
    [data-profile-confirm-save],
    .member-profile-side-heading button,
    .member-settings-actions button[type="submit"],
    [data-support-open-form],
    [data-support-file-trigger],
    .member-support-admin-filters button[type="submit"],
    .member-support-modal footer button,
    .member-chat-compose-actions button[type="submit"],
    .member-support-ticket-actions button[type="submit"],
    .s3-event-register,
    .se-register,
    .s3-news-subscribe,
    .s3-filter-reset,
    .s3-mobile-filter-button,
    .sg-mobile-filter,
    .sg-reset,
    .sg-start-discussion,
    .sg-load-replies,
    .sg-comment-form footer button,
    .sg-modal footer button,
    .s3-message-btn,
    .s3-looking-more,
    .member-demo-action
) {
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 38px;
    padding: 8px 12px !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    background:
        linear-gradient(90deg, var(--member-action-start), var(--member-action-end)) padding-box,
        conic-gradient(from var(--member-action-angle) at var(--member-action-x) 50%, var(--member-action-start) 0%, var(--member-action-hover-start) 20%, var(--member-action-end) 25%) border-box !important;
    box-shadow: 0 4px 10px rgba(144, 82, 246, 0.2) !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    text-align: center;
    text-decoration: none !important;
    text-shadow: none !important;
    white-space: nowrap;
    cursor: pointer;
    opacity: 1;
    animation: member-action-border 5s linear infinite, member-action-position 5s ease-in-out infinite alternate;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.25s ease !important;
}

/* The reference .btn-default uses a generated inner layer. The shared
 * two-layer background above replaces it and also works for plain-text buttons. */
.btn-default::after {
    display: none !important;
}

[hidden] {
    display: none !important;
}

:is(
    .btn,
    .btn-default,
    .btn-primary,
    .btn-success,
    .btn-info,
    .btn-warning,
    .btn-danger,
    .add-btns,
    .my_add_button,
    .is2-post-btn,
    .wall-load-more,
    .wall-cover-upload,
    .wall-comment-form button[type="submit"],
    .bids-clear,
    .bids-detail-btn,
    .bids-submit-btn,
    .bids-company-more-info,
    .bids-company-gate-later,
    .bids-company-gate-signup,
    .interest-btn,
    .modal-btn,
    .bid-cancel-btn,
    .bid-submit-btn,
    .create-bid-submit,
    [data-map-button],
    [data-remove-selected],
    [data-remove-id],
    #member-profile-save,
    [data-profile-confirm-cancel],
    [data-profile-confirm-save],
    .member-profile-side-heading button,
    .member-settings-actions button[type="submit"],
    [data-support-open-form],
    [data-support-file-trigger],
    .member-support-admin-filters button[type="submit"],
    .member-support-modal footer button,
    .member-chat-compose-actions button[type="submit"],
    .member-support-ticket-actions button[type="submit"],
    .s3-event-register,
    .se-register,
    .s3-news-subscribe,
    .s3-filter-reset,
    .s3-mobile-filter-button,
    .sg-mobile-filter,
    .sg-reset,
    .sg-start-discussion,
    .sg-load-replies,
    .sg-comment-form footer button,
    .sg-modal footer button,
    .s3-message-btn,
    .s3-looking-more,
    .member-demo-action
):not(:disabled):not([aria-disabled="true"]):hover {
    background:
        linear-gradient(90deg, var(--member-action-hover-start), var(--member-action-hover-end)) padding-box,
        linear-gradient(120deg, var(--member-action-hover-start), var(--member-action-end), var(--member-action-hover-start)) border-box !important;
    box-shadow: 0 6px 14px rgba(0, 255, 177, 0.22) !important;
    color: #fff !important;
    transform: translateY(-1px);
}

:is(
    .btn,
    .btn-default,
    .add-btns,
    .is2-post-btn,
    .bids-detail-btn,
    .bids-submit-btn,
    .bid-submit-btn,
    .create-bid-submit,
    [data-map-button],
    [data-remove-selected],
    [data-remove-id],
    #member-profile-save,
    [data-support-open-form],
    .s3-event-register,
    .se-register,
    .s3-news-subscribe,
    .sg-start-discussion,
    .s3-message-btn
):focus-visible {
    outline: 3px solid rgba(0, 255, 177, 0.38) !important;
    outline-offset: 2px !important;
}

:is(
    .btn,
    .btn-default,
    .btn-primary,
    .btn-success,
    .btn-info,
    .btn-warning,
    .btn-danger,
    .add-btns,
    .my_add_button,
    .is2-post-btn,
    .wall-load-more,
    .wall-cover-upload,
    .wall-comment-form button[type="submit"],
    .bids-clear,
    .bids-detail-btn,
    .bids-submit-btn,
    .bids-company-more-info,
    .bids-company-gate-later,
    .bids-company-gate-signup,
    .interest-btn,
    .modal-btn,
    .bid-cancel-btn,
    .bid-submit-btn,
    .create-bid-submit,
    [data-map-button],
    [data-remove-selected],
    [data-remove-id],
    #member-profile-save,
    [data-profile-confirm-cancel],
    [data-profile-confirm-save],
    .member-profile-side-heading button,
    .member-settings-actions button[type="submit"],
    [data-support-open-form],
    [data-support-file-trigger],
    .member-support-admin-filters button[type="submit"],
    .member-support-modal footer button,
    .member-chat-compose-actions button[type="submit"],
    .member-support-ticket-actions button[type="submit"],
    .s3-event-register,
    .se-register,
    .s3-news-subscribe,
    .s3-filter-reset,
    .s3-mobile-filter-button,
    .sg-mobile-filter,
    .sg-reset,
    .sg-start-discussion,
    .sg-load-replies,
    .sg-comment-form footer button,
    .sg-modal footer button,
    .s3-message-btn,
    .s3-looking-more,
    .member-demo-action
):disabled,
:is(
    .btn,
    .btn-default,
    .btn-primary,
    .btn-success,
    .btn-info,
    .btn-warning,
    .btn-danger,
    .add-btns,
    .my_add_button,
    .is2-post-btn,
    .bids-submit-btn,
    .bid-submit-btn,
    .create-bid-submit,
    [data-map-button],
    [data-remove-selected],
    #member-profile-save,
    .member-settings-actions button[type="submit"],
    [data-support-open-form],
    [data-support-file-trigger],
    .s3-message-btn
)[aria-disabled="true"] {
    border-color: transparent !important;
    background: #d4d7df !important;
    box-shadow: none !important;
    color: #7a8291 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
    transform: none !important;
}

:is(
    .btn,
    .btn-default,
    .btn-primary,
    .btn-success,
    .btn-info,
    .btn-warning,
    .btn-danger,
    .is2-post-btn,
    .bids-clear,
    .bids-detail-btn,
    .bids-submit-btn,
    .bid-submit-btn,
    .create-bid-submit,
    #member-profile-save,
    .s3-event-register,
    .se-register,
    .s3-news-subscribe,
    .sg-mobile-filter,
    .sg-reset,
    .sg-start-discussion,
    .s3-message-btn
) :where(svg, i) {
    color: currentColor !important;
    fill: currentColor;
}

/* Actions used by Reels and Content Library, plus action links highlighted in
 * the existing member dashboards. Media controls and navigation tabs are
 * deliberately excluded. */
html body :is(
    .reels-add,
    .reel-watch,
    .reel-load-more,
    .reels-mobile-filter,
    .reels-filter-reset,
    .reels-filter-close,
    .reel-upload-modal footer button,
    .sg-view,
    .s3-news-read,
    .is2-outline-btn,
    .applicant-action
) {
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 38px;
    padding: 8px 12px !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    background:
        linear-gradient(90deg, var(--member-action-start), var(--member-action-end)) padding-box,
        conic-gradient(from var(--member-action-angle) at var(--member-action-x) 50%, var(--member-action-start) 0%, var(--member-action-hover-start) 20%, var(--member-action-end) 25%) border-box !important;
    box-shadow: 0 4px 10px rgba(144, 82, 246, 0.2) !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    text-align: center;
    text-decoration: none !important;
    text-shadow: none !important;
    white-space: nowrap;
    cursor: pointer;
    opacity: 1;
    animation: member-action-border 5s linear infinite, member-action-position 5s ease-in-out infinite alternate;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.25s ease !important;
}

html body :is(
    .reels-add,
    .reel-watch,
    .reel-load-more,
    .reels-mobile-filter,
    .reels-filter-reset,
    .reels-filter-close,
    .reel-upload-modal footer button,
    .sg-view,
    .s3-news-read,
    .is2-outline-btn,
    .applicant-action
):not(:disabled):not([aria-disabled="true"]):hover {
    background:
        linear-gradient(90deg, var(--member-action-hover-start), var(--member-action-hover-end)) padding-box,
        linear-gradient(120deg, var(--member-action-hover-start), var(--member-action-end), var(--member-action-hover-start)) border-box !important;
    box-shadow: 0 6px 14px rgba(0, 255, 177, 0.22) !important;
    color: #fff !important;
    transform: translateY(-1px);
}

/* Keep responsive filter triggers under the control of their modules. The
 * shared theme must not turn mobile-only controls into desktop controls. */
@media (min-width: 761px) {
    body.reels-page-shell :is(.reels-mobile-filter, .reels-filter-close),
    body.groups-page-shell .sg-mobile-filter {
        display: none !important;
    }
}

/* Sidebar footer actions use the full available width, matching Members. */
html body.reels-page-shell .reels-filter-footer .reels-filter-reset,
html body.groups-page-shell .sg-filters > .sg-reset {
    width: 100% !important;
    min-height: 38px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    background:
        linear-gradient(90deg, var(--member-action-start), var(--member-action-end)) padding-box,
        conic-gradient(from var(--member-action-angle) at var(--member-action-x) 50%, var(--member-action-start) 0%, var(--member-action-hover-start) 20%, var(--member-action-end) 25%) border-box !important;
}

html body.groups-page-shell .sg-filters > .sg-reset {
    width: calc(100% - 20px) !important;
    margin: 10px !important;
}

/* Card stylesheet selectors are intentionally strong, so use the page and
 * card context here to keep every View action visually consistent. */
html body.groups-page-shell .sg-card .sg-view {
    min-height: 38px !important;
    height: auto !important;
    padding: 8px 12px !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    background:
        linear-gradient(90deg, var(--member-action-start), var(--member-action-end)) padding-box,
        conic-gradient(from var(--member-action-angle) at var(--member-action-x) 50%, var(--member-action-start) 0%, var(--member-action-hover-start) 20%, var(--member-action-end) 25%) border-box !important;
    box-shadow: 0 4px 10px rgba(144, 82, 246, 0.2) !important;
    color: #fff !important;
    font-size: 14px !important;
}

/* A sticky form footer overlaps longer Settings tabs. Keep it after the
 * active panel and give the primary action a stable desktop size. */
body.member-settings-page .member-settings-actions {
    position: static !important;
    bottom: auto !important;
}

body.member-settings-page .member-settings-actions button[type="submit"] {
    min-width: 140px;
}

/* Compact actions must stay aligned with the content beside them. */
html body.posts-wall-page .wall-comment-form button[type="submit"] {
    min-height: 32px;
    height: 32px;
    padding: 0 14px !important;
    border-radius: 16px !important;
    font-size: 10px;
}

html body.posts-wall-page .is2-agency .is2-outline-btn {
    min-height: 26px;
    height: 26px;
    padding: 0 8px !important;
    border-radius: 4px !important;
    font-size: 10px;
}

@media (max-width: 767px) {
    body.member-settings-page .member-settings-actions button[type="submit"] {
        width: 100%;
        min-width: 0;
    }
}

html body :is(
    .reels-add,
    .reel-watch,
    .reel-load-more,
    .reels-mobile-filter,
    .reels-filter-reset,
    .reels-filter-close,
    .reel-upload-modal footer button,
    .sg-view,
    .s3-news-read,
    .is2-outline-btn,
    .applicant-action
):focus-visible {
    outline: 3px solid rgba(0, 255, 177, 0.38) !important;
    outline-offset: 2px !important;
}

html body :is(
    .reels-add,
    .reel-watch,
    .reel-load-more,
    .reels-mobile-filter,
    .reels-filter-reset,
    .reels-filter-close,
    .reel-upload-modal footer button,
    .applicant-action
):disabled {
    border-color: transparent !important;
    background: #d4d7df !important;
    box-shadow: none !important;
    color: #7a8291 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
}

html body :is(.reels-add, .reel-watch, .applicant-action) :where(svg, i) {
    color: currentColor !important;
    fill: currentColor;
}

@media (prefers-reduced-motion: reduce) {
    :where(button, .btn, .btn-default) {
        animation: none !important;
        transition: none !important;
    }
}
