/*
 * Pjax-resilient widget control styles.
 *
 * yii2's jquery.pjax only re-executes <script> tags from a swapped fragment; it
 * never injects <style>/<link> from the fragment head. So small widgets that
 * style themselves via $view->registerCss() (inline <style>) render UNSTYLED
 * after a Pjax content swap (e.g. the org profile tabs) - the markup arrives
 * but the inline CSS is dropped, leaving plain square buttons.
 *
 * Loaded globally via AppAsset, these rules sit in <head> from the initial page
 * load and persist across every swap. They mirror the inline CSS in:
 *   - widgets/FavoriteButtonWidget.php   (.favorite-btn ...)
 *   - widgets/CopyableContentWidget.php  (.copyable-content-btn ...)
 *   - widgets/EntityActionsDropdownWidget.php (.entity-actions-menu ...)
 * Keep them in sync if those widgets' styles change.
 */

/* ---- FavoriteButtonWidget (heart) ---- */
.favorite-btn {
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: transform 0.2s;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 0;
    line-height: 1;
}

.favorite-btn-sm {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
}

.favorite-btn-md {
    width: 40px;
    height: 40px;
    font-size: 1.125rem;
}

.favorite-btn-overlay {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.favorite-btn-inline {
    position: relative;
}

.favorite-btn .fa-heart {
    color: #6c757d;
    transition: color 0.2s, transform 0.2s;
}

.favorite-btn.is-favorited .fa-heart {
    color: #e74c3c;
}

.favorite-btn:hover .fa-heart {
    transform: scale(1.2);
}

.favorite-btn:hover:not(.is-favorited) .fa-heart {
    color: #e74c3c;
}

@keyframes favorite-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.favorite-btn.pulse .fa-heart {
    animation: favorite-pulse 0.3s ease;
}

[data-theme="dark"] .favorite-btn {
    background: rgba(33, 37, 41, 0.85);
}

/* ---- CopyableContentWidget (inline copy button) ---- */
.copyable-content-btn {
    background: transparent;
    border: 0;
    padding: 0 0.2em;
    margin: 0 0.1em;
    color: inherit;
    font-size: inherit;
    line-height: 1;
    vertical-align: baseline;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.15s ease;
}

.copyable-content-btn:hover,
.copyable-content-btn:focus-visible {
    opacity: 1;
    outline: none;
}

.copyable-content-btn .fas {
    font-size: 0.6em;
}

/* ---- EntityActionsDropdownWidget (three-dots nested menu) ---- */
.entity-actions-menu .dropend > .dropdown-menu {
    margin-left: 0.125rem;
    margin-top: -0.25rem;
}

.entity-actions-menu .entity-actions-submenu-toggle::after {
    display: none;
}

.entity-actions-menu .entity-actions-submenu-toggle .fa-chevron-right {
    opacity: 0.55;
    margin-left: 0.5rem;
}

.entity-actions-menu .entity-actions-submenu-toggle {
    cursor: pointer;
}
