/**
 * MxChat Triggers - Optional Styling Classes
 *
 * These classes are optional - users can apply them if they want pre-styled triggers.
 * The trigger functionality works with any element, these just provide nice defaults.
 *
 * @package MxChat Trigger
 * @since 2.0.0
 */

/* ==========================================================================
   Base Trigger Styles
   ========================================================================== */

/**
 * Base trigger class - resets button styles and adds pointer
 * Usage: class="mxchat-trigger-btn"
 */
.mxchat-trigger-btn {
    cursor: pointer;
    transition: all 0.2s ease;
}

.mxchat-trigger-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* ==========================================================================
   Animated Triggers
   ========================================================================== */

/**
 * Subtle shake animation - draws attention without being annoying
 * Usage: class="mxchat-trigger-shake"
 */
@keyframes mxchat-subtle-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.mxchat-trigger-shake {
    animation: mxchat-subtle-shake 2.5s ease-in-out infinite;
}

.mxchat-trigger-shake:hover {
    animation: mxchat-subtle-shake 0.4s ease-in-out infinite;
}

/**
 * Pulse animation - glowing pulse effect
 * Usage: class="mxchat-trigger-pulse"
 */
@keyframes mxchat-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 124, 186, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 124, 186, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 124, 186, 0); }
}

.mxchat-trigger-pulse {
    animation: mxchat-pulse 2s infinite;
}

.mxchat-trigger-pulse:hover {
    animation: none;
    transform: scale(1.02);
}

/**
 * Bounce animation
 * Usage: class="mxchat-trigger-bounce"
 */
@keyframes mxchat-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

.mxchat-trigger-bounce {
    animation: mxchat-bounce 2s infinite;
}

.mxchat-trigger-bounce:hover {
    animation: none;
}

/* ==========================================================================
   Pre-styled Button Variants
   ========================================================================== */

/**
 * Primary button style
 * Usage: class="mxchat-btn mxchat-btn-primary"
 */
.mxchat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mxchat-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.mxchat-btn-primary {
    background: linear-gradient(135deg, #007cba, #0056b3);
    color: #fff;
}

.mxchat-btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #003d82);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
    color: #fff;
}

/**
 * Secondary/outline button style
 * Usage: class="mxchat-btn mxchat-btn-secondary"
 */
.mxchat-btn-secondary {
    background: transparent;
    color: #007cba;
    border: 2px solid #007cba;
}

.mxchat-btn-secondary:hover {
    background: #007cba;
    color: #fff;
}

/**
 * Dark button style
 * Usage: class="mxchat-btn mxchat-btn-dark"
 */
.mxchat-btn-dark {
    background: #212121;
    color: #fff;
}

.mxchat-btn-dark:hover {
    background: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/**
 * Gradient button style
 * Usage: class="mxchat-btn mxchat-btn-gradient"
 */
.mxchat-btn-gradient {
    background: linear-gradient(135deg, #e91e63, #9c27b0, #3f51b5);
    color: #fff;
    background-size: 200% 200%;
    animation: mxchat-gradient-shift 3s ease infinite;
}

@keyframes mxchat-gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.mxchat-btn-gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.4);
    color: #fff;
}

/* ==========================================================================
   Link Styles
   ========================================================================== */

/**
 * Styled link trigger
 * Usage: class="mxchat-link"
 */
.mxchat-link {
    color: #007cba;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mxchat-link:hover {
    color: #0056b3;
    text-decoration-thickness: 2px;
}

/**
 * Gradient text link (for dark backgrounds)
 * Usage: class="mxchat-link-gradient"
 */
.mxchat-link-gradient {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.8));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0.6);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mxchat-link-gradient:hover {
    background: linear-gradient(135deg, rgba(255,255,255,1), rgba(255,255,255,0.95));
    -webkit-background-clip: text;
    background-clip: text;
    text-decoration-color: rgba(255,255,255,0.9);
}

/* ==========================================================================
   Icon Support
   ========================================================================== */

/**
 * Chat icon (inline SVG placeholder class)
 * Add your own icon or use with icon fonts
 */
.mxchat-btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ==========================================================================
   Size Variants
   ========================================================================== */

.mxchat-btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.mxchat-btn-lg {
    padding: 16px 32px;
    font-size: 17px;
}

/* ==========================================================================
   Floating Trigger (Fixed Position)
   ========================================================================== */

/**
 * Fixed position floating trigger button
 * Usage: class="mxchat-floating-trigger"
 * Position it with additional classes or inline styles
 */
.mxchat-floating-trigger {
    position: fixed;
    z-index: 9998; /* Just below the chat widget */
    padding: 14px 20px;
    border-radius: 50px;
    background: linear-gradient(135deg, #007cba, #0056b3);
    color: #fff;
    font-weight: 500;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.mxchat-floating-trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Position helpers */
.mxchat-floating-trigger.bottom-left {
    bottom: 90px;
    left: 20px;
}

.mxchat-floating-trigger.bottom-right {
    bottom: 90px;
    right: 90px; /* Offset from chat button */
}

.mxchat-floating-trigger.top-right {
    top: 20px;
    right: 20px;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .mxchat-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .mxchat-btn-lg {
        padding: 14px 28px;
        font-size: 16px;
    }

    .mxchat-floating-trigger {
        padding: 12px 18px;
        font-size: 14px;
    }

    .mxchat-floating-trigger.bottom-right {
        right: 20px;
        bottom: 80px;
    }
}
