/**
 * BuddyBlog AI Writing Assistant — Frontend Styles
 *
 * @package BuddyBlog_AI_Assistant
 */

/* ------------------------------------------------------------------
   Wrapper
   ------------------------------------------------------------------ */
.bbai-assistant-wrapper {
    display: inline-block;
    margin-top: 15px;
    margin-bottom: 0;
    text-align: center;
    width: 100%;
}

/* ------------------------------------------------------------------
   Button — base
   ------------------------------------------------------------------ */
.bbai-improve-btn {
    display: inline-block;
    align-items: center;
    padding: 10px 10px;
    border: none;
    border-radius: 7px;
    background: linear-gradient( 135deg, #6a67ce 0%, #4f8ef7 100% );
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition:
        opacity       0.2s ease,
        transform     0.12s ease,
        box-shadow    0.2s ease,
        background    0.3s ease;
    box-shadow: 0 2px 10px rgba( 106, 103, 206, 0.38 );
    user-select: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    width: 80%;
    text-align: center;
}

.bbai-btn-label {
    margin-left: 5px;
}

/* Shimmer sweep on hover (when enabled) */
.bbai-improve-btn:not(:disabled):not(.bbai-improve-btn--empty)::after {
    content: '';
    position: absolute;
    top: 0; left: -75%;
    width: 50%; height: 100%;
    background: linear-gradient(
        120deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.22) 50%,
        rgba(255,255,255,0) 100%
    );
    transform: skewX( -15deg );
    transition: left 0.5s ease;
}
.bbai-improve-btn:hover:not(:disabled):not(.bbai-improve-btn--empty)::after {
    left: 130%;
}

/* Hover (active/enabled state) */
.bbai-improve-btn:hover:not(:disabled):not(.bbai-improve-btn--empty) {
    opacity: 0.93;
    transform: translateY( -1px );
    box-shadow: 0 5px 16px rgba( 106, 103, 206, 0.45 );
}

/* Press */
.bbai-improve-btn:active:not(:disabled):not(.bbai-improve-btn--empty) {
    transform: translateY( 0 );
    box-shadow: 0 2px 6px rgba( 106, 103, 206, 0.3 );
}

/* ------------------------------------------------------------------
   Button — disabled / waiting for input
   ------------------------------------------------------------------ */
.bbai-improve-btn:disabled,
.bbai-improve-btn--empty {
    background: #c0c6d4;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
    transform: none !important;
    color: #f0f2f5;
}

/* Tooltip hint text rendered via the native title attribute;
   we also add a small lock icon via CSS for extra clarity */
.bbai-improve-btn--empty .bbai-btn-icon {
    opacity: 0.7;
}

/* ------------------------------------------------------------------
   Button — busy / loading
   ------------------------------------------------------------------ */
.bbai-improve-btn--busy {
    background: linear-gradient( 135deg, #9896d8 0%, #82aef9 100% );
    cursor: wait !important;
    box-shadow: none;
}

/* Spin animation on the icon */
.bbai-btn-icon {
    font-size: 15px;
    line-height: 1;
    display: inline-block;
    transition: transform 0.2s;
}

.bbai-btn-icon.bbai-icon-spin {
    animation: bbai-spin 1s linear infinite;
}

@keyframes bbai-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ------------------------------------------------------------------
   Status message
   ------------------------------------------------------------------ */
.bbai-status {
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
    line-height: 1.4;
    display: inline-block;
    margin-top: 12px;
    width: 100%;
    letter-spacing: 1.5px;
    text-align: center;
}

.bbai-status:empty { display: none; }

.bbai-status--success { color: #1a8f4f; }
.bbai-status--error   { color: #c0392b; }

/* ------------------------------------------------------------------
   Upsell / upgrade notice (shown to non-members when restricted)
   ------------------------------------------------------------------ */
.bbai-upsell-notice {
    display: inline-block;
    align-items: flex-start;
    margin-top: 12px;
    margin-bottom: 6px;
    padding: 11px 15px;
    background: #fef9ec;
    border: 1px solid #f0c040;
    font-size: 13.5px;
    color: #6b4c00;
    line-height: 1.5;
    width: 100%;
    text-align: center;
    letter-spacing: 1px;
}

.bbai-upsell-icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; display: none; }
.bbai-upsell-text { font-weight: 500; }
.bbai-upsell-text a {
    color: #b32d2e;
}

/* ------------------------------------------------------------------
   Theme resets for BuddyBoss / BuddyPress
   ------------------------------------------------------------------ */
.bb-template-default .bbai-improve-btn,
.buddypress .bbai-improve-btn,
.buddyboss  .bbai-improve-btn {
    border-radius: 7px;
    text-transform: none;
    letter-spacing: 0;
}

/* ------------------------------------------------------------------
   Dark-mode aware
   ------------------------------------------------------------------ */
@media ( prefers-color-scheme: dark ) {
    .bbai-status--success { color: #4cde87; }
    .bbai-status--error   { color: #ff6b6b; }
    .bbai-improve-btn:disabled,
    .bbai-improve-btn--empty {
        background: #3a3d48;
        color: #6e7585;
    }
    .bbai-upsell-notice {
        background: #2a2206;
        border-color: #a07010;
        color: #f0c865;
    }
}