/* ===================================================================
   Author Subscriptions – front-end styles
   Designed to blend with BuddyPress / GeneratePress button patterns.
   =================================================================== */

/* ── Base button ─────────────────────────────────────────────────────────── */
.as-subscribe-btn {
    display:         inline-flex;
    align-items:     center;
    gap:             6px;
    padding:         8px 18px;
    font-size:       13px;
    font-weight:     600;
    line-height:     1.4;
    border-radius:   4px;
    border:          2px solid #4f46e5;
    background:      transparent;
    color:           #4f46e5;
    cursor:          pointer;
    text-decoration: none;
    transition:      background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
                     transform 0.15s ease, box-shadow 0.2s ease;
    white-space:     nowrap;
    vertical-align:  middle;
}

.as-subscribe-btn:hover {
    background:   #4f46e5;
    color:        #fff;
    box-shadow:   0 3px 10px rgba(79, 70, 229, 0.35);
    transform:    translateY(-1px);
}

/* Active / subscribed state */
.as-subscribe-btn.is-subscribed {
    background:   #4f46e5;
    color:        #fff;
    border-color: #4f46e5;
}

.as-subscribe-btn.is-subscribed:hover {
    background:   #c7d2fe;
    color:        #4338ca;
    border-color: #c7d2fe;
    box-shadow:   none;
}

/* Loading state */
.as-subscribe-btn.as-loading {
    opacity:    0.65;
    cursor:     wait;
    pointer-events: none;
}

/* ── BuddyPress context ───────────────────────────────────────────────────── */
/* BP wraps buttons in <div id="item-buttons"> — inherit its sizing */
#item-buttons .as-subscribe-btn,
.as-subscribe-btn--bp {
    /* Match typical BP button sizing */
    font-size: 12px;
    padding:   7px 14px;
}

/* ── Single-post context ─────────────────────────────────────────────────── */
.as-post-subscribe-wrap {
    display:        flex;
    align-items:    center;
    gap:            14px;
    flex-wrap:      wrap;
    margin:         36px 0 8px;
    padding:        20px 24px;
    background:     #f8f9fc;
    border:         1px solid #e8eaf0;
    border-left:    4px solid #4f46e5;
    border-radius:  6px;
}

.as-post-subscribe-label {
    font-size:   14px;
    color:       #555;
    line-height: 1.4;
}

.as-subscribe-btn--post {
    font-size: 14px;
    padding:   9px 20px;
}

/* ── Toast notifications ─────────────────────────────────────────────────── */
.as-toast {
    position:      fixed;
    bottom:        24px;
    right:         24px;
    z-index:       999999;
    padding:       12px 20px;
    border-radius: 6px;
    font-size:     13px;
    font-weight:   600;
    color:         #fff;
    opacity:       0;
    transform:     translateY(10px);
    transition:    opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    box-shadow:    0 4px 16px rgba(0,0,0,.18);
    max-width:     320px;
}

.as-toast--visible {
    opacity:   1;
    transform: translateY(0);
}

.as-toast--success { background: #16a34a; }
.as-toast--info    { background: #6b7280; }
.as-toast--error   { background: #dc2626; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .as-post-subscribe-wrap { flex-direction: column; align-items: flex-start; }
    .as-toast              { right: 12px; bottom: 12px; left: 12px; max-width: none; }
}
