
/*
 * /reactions/reactions.css
 * My Recipes Without Ads
 *
 * Reusable recipe and cookbook reaction controls.
 * Like / Dislike / Save
 */

/* ============================================================
   REACTION TOOLBAR
   ============================================================ */

.bw-reactions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;

    width: 100%;
    margin-top: 12px;
}

.bw-reactions[hidden],
.bw-reaction[hidden] {
    display: none !important;
}

.bw-reactions[data-position="left"] {
    justify-content: flex-start;
}

.bw-reactions[data-position="center"] {
    justify-content: center;
}

.bw-reactions[data-position="bottom-right"] {
    justify-content: flex-end;
}

/* ============================================================
   INDIVIDUAL BUTTONS
   ============================================================ */

.bw-reaction {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    min-width: 38px;
    min-height: 38px;
    padding: 7px 9px;

    border: 1px solid rgba(48, 42, 32, .18);
    border-radius: 10px;

    background: #fffdf8;
    color: #716d64;

    font: inherit;
    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease,
        color .15s ease,
        transform .15s ease;
}

.bw-reaction:hover {
    background: #f8f1e6;
    border-color: rgba(48, 42, 32, .35);
    transform: translateY(-1px);
}

.bw-reaction:focus-visible {
    outline: 3px solid #d6a94d;
    outline-offset: 3px;
}

.bw-reaction:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   ICONS AND LABELS
   ============================================================ */

.bw-reaction-icon {
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.bw-reaction-icon svg {
    display: block;
    width: 100%;
    height: 100%;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bw-reaction-label {
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.bw-reactions[data-show-text="false"] .bw-reaction-label {
    display: none;
}

/* ============================================================
   SELECTED STATES
   ============================================================ */

.bw-reaction[data-action="like"][aria-pressed="true"] {
    color: #2f6b45;
    background: #e9f4e9;
    border-color: #8bbb94;
}

.bw-reaction[data-action="dislike"][aria-pressed="true"] {
    color: #b32c2c;
    background: #fff0ee;
    border-color: #dfa09a;
}

.bw-reaction[data-action="save"][aria-pressed="true"] {
    color: #9a6519;
    background: #fff4d9;
    border-color: #d6a94d;
}

/* Fill selected icons while preserving their outline. */

.bw-reaction[aria-pressed="true"] .bw-reaction-icon svg {
    fill: currentColor;
}

/* ============================================================
   SIZE MODES
   ============================================================ */

.bw-reactions[data-size="small"] .bw-reaction {
    min-width: 32px;
    min-height: 32px;
    padding: 5px 7px;
}

.bw-reactions[data-size="small"] .bw-reaction-icon {
    width: 16px;
    height: 16px;
}

.bw-reactions[data-size="large"] .bw-reaction {
    min-width: 46px;
    min-height: 46px;
    padding: 10px 12px;
}

.bw-reactions[data-size="large"] .bw-reaction-icon {
    width: 25px;
    height: 25px;
}

/* ============================================================
   SAVE MODAL BACKDROP
   ============================================================ */

.bw-save-modal[hidden] {
    display: none !important;
}

.bw-save-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 16px;

    background: rgba(20, 17, 13, .65);
}

.bw-save-dialog {
    position: relative;

    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;

    padding: 25px;

    border: 1px solid rgba(48, 42, 32, .18);
    border-radius: 18px;

    background: #fffdf8;
    color: #292722;

    box-shadow: 0 20px 65px rgba(0, 0, 0, .28);
}

.bw-save-title {
    margin: 0 35px 10px 0;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.5rem;
    line-height: 1.2;
}

.bw-save-description {
    margin: 0 0 18px;
    color: #716d64;
    line-height: 1.5;
}

.bw-save-item-title {
    font-weight: 800;
    color: #292722;
}

/* ============================================================
   MODAL BUTTONS
   ============================================================ */

.bw-save-close {
    position: absolute;
    top: 14px;
    right: 14px;

    width: 34px;
    height: 34px;

    border: 0;
    border-radius: 8px;

    background: #f0e9dd;
    color: #292722;

    font-size: 22px;
    cursor: pointer;
}

.bw-save-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bw-save-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;
    padding: 10px 16px;

    border: 1px solid transparent;
    border-radius: 10px;

    font: inherit;
    font-size: .9rem;
    font-weight: 800;
    text-align: center;
    text-decoration: none;

    cursor: pointer;
}

.bw-save-action.primary {
    background: #c92f2f;
    color: white;
}

.bw-save-action.secondary {
    background: #f3ede1;
    color: #292722;
    border-color: rgba(48, 42, 32, .18);
}

.bw-save-close:focus-visible,
.bw-save-action:focus-visible {
    outline: 3px solid #d6a94d;
    outline-offset: 3px;
}

/* ============================================================
   VISUAL STYLE: MINIMAL
   Keeps the original boxed style available.
   ============================================================ */

.bw-reactions[data-style="minimal"] {
    gap: 3px;
    margin-top: 2px;
    padding: 0 3px 0 0;
}

.bw-reactions[data-style="minimal"] .bw-reaction {
    min-width: 0;
    min-height: 0;
    padding: 2px 4px;

    border: none;
    border-radius: 5px;

    background: transparent;
    box-shadow: none;

    transform: none;
}

.bw-reactions[data-style="minimal"] .bw-reaction:hover {
    border: none;
    background: transparent;
    transform: none;
    opacity: .7;
}

/* Selected buttons retain their colors without colored boxes. */

.bw-reactions[data-style="minimal"] .bw-reaction[aria-pressed="true"] {
    border: none;
    background: transparent;
}

/* Keep the icons compact. */

.bw-reactions[data-style="minimal"] .bw-reaction-icon {
    width: 19px;
    height: 19px;
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 650px) {
    .bw-reactions {
        gap: 6px;
    }

    .bw-save-dialog {
        padding: 20px;
    }

    .bw-save-actions {
        flex-direction: column;
    }

    .bw-save-action {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bw-reaction {
        transition: none;
    }
}
