/**
 * JustDonate: GiveWP Connector - Button Widget Styles
 * 
 * Professional default styling for connector button widget with
 * brand-consistent appearance and smooth interactions.
 * 
 * @file        button-styles.css
 * @description  Default styling for connector button widget
 * @version     1.2.0
 * @author      JustDonate
 * @since       1.2.0
 * @package     JustDonate
 * @subpackage  GiveWPConnector
 */

/* ==========================================================================
   CONNECTOR BUTTON - DEFAULT APPEARANCE
   ========================================================================== */

.connector-execute-btn {
    /* Brand Colors */
    background-color: #512da8;
    color: white;
    
    /* Typography */
    font-family: inherit;
    font-weight: bold;
    font-size: inherit;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    
    /* Spacing & Dimensions */
    padding: 15px 30px;
    width: 100%;
    min-height: 50px;
    
    /* Border & Shape */
    border: none;
    border-radius: 5px;
    
    /* Interactive States */
    cursor: pointer;
    transition: all 0.3s ease;
    
    /* Visual Effects */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    
    /* Layout */
    display: inline-block;
    vertical-align: middle;
    position: relative;
    
    /* User Selection */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ==========================================================================
   CONNECTOR BUTTON - HOVER STATE
   ========================================================================== */

.connector-execute-btn:hover {
    /* Hover Colors */
    background-color: #673ab7;
    color: white;
    
    /* Hover Effects */
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.connector-execute-btn:focus {
    /* Focus State */
    outline: 2px solid #512da8;
    outline-offset: 2px;
}

.connector-execute-btn:active {
    /* Active State */
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   CONNECTOR BUTTON - DISABLED STATE
   ========================================================================== */

.connector-execute-btn:disabled,
.connector-execute-btn.disabled {
    /* Disabled Appearance */
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* ==========================================================================
   CONNECTOR BUTTON - LOADING STATE
   ========================================================================== */

.connector-execute-btn.loading {
    /* Loading State */
    background-color: #512da8;
    color: white;
    cursor: wait;
    position: relative;
}

.connector-execute-btn.loading::before {
    /* Loading Spinner */
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: justdonate-spin 1s linear infinite;
}

/* ==========================================================================
   CONNECTOR BUTTON - WRAPPER RESPONSIVE
   ========================================================================== */

.justdonate-button-wrapper {
    /* Button Container */
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: left; /* Default alignment */
}

/* Alignment variations */
.justdonate-button-wrapper[data-align="center"] {
    text-align: center;
}

.justdonate-button-wrapper[data-align="right"] {
    text-align: right;
}

.justdonate-button-wrapper[data-align="justify"] {
    text-align: justify;
}

.justdonate-button-wrapper[data-align="justify"] .connector-execute-btn {
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .connector-execute-btn {
        /* Mobile Optimization */
        padding: 12px 24px;
        font-size: 16px;
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .connector-execute-btn {
        /* Small Mobile Optimization */
        padding: 10px 20px;
        font-size: 14px;
        min-height: 44px;
    }
}

/* ==========================================================================
   CONNECTOR BUTTON - ANIMATIONS
   ========================================================================== */

@keyframes justdonate-spin {
    /* Loading Spinner Animation */
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   CONNECTOR BUTTON - ACCESSIBILITY
   ========================================================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .connector-execute-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .connector-execute-btn {
        transition: none;
    }
    
    .connector-execute-btn:hover {
        transform: none;
    }
    
    .connector-execute-btn.loading::before {
        animation: none;
    }
}

/* ==========================================================================
   CONNECTOR BUTTON - ELEMENTOR INTEGRATION
   ========================================================================== */

/* Ensure Elementor controls can override these styles */
.elementor-widget-wrap .connector-execute-btn {
    /* Allow Elementor to control these properties */
    font-family: var(--e-global-typography-primary-font-family, inherit);
    font-size: var(--e-global-typography-primary-font-size, inherit);
}

/* Elementor hover animations integration */
.elementor-animation-grow .connector-execute-btn:hover {
    transform: translateY(-1px) scale(1.05);
}

.elementor-animation-shrink .connector-execute-btn:hover {
    transform: translateY(-1px) scale(0.95);
}

.elementor-animation-float .connector-execute-btn:hover {
    transform: translateY(-3px);
}

/* ==========================================================================
   CONNECTOR BUTTON - ELEMENTOR STYLE PRESETS
   ========================================================================== */

/* Default Style */
.elementor-button-default .connector-execute-btn {
    background-color: #512da8;
    color: #ffffff;
}

.elementor-button-default .connector-execute-btn:hover {
    background-color: #673ab7;
}

/* Info Style */
.elementor-button-info .connector-execute-btn {
    background-color: #17a2b8;
    color: #ffffff;
}

.elementor-button-info .connector-execute-btn:hover {
    background-color: #138496;
}

/* Success Style */
.elementor-button-success .connector-execute-btn {
    background-color: #28a745;
    color: #ffffff;
}

.elementor-button-success .connector-execute-btn:hover {
    background-color: #218838;
}

/* Warning Style */
.elementor-button-warning .connector-execute-btn {
    background-color: #ffc107;
    color: #212529;
}

.elementor-button-warning .connector-execute-btn:hover {
    background-color: #e0a800;
}

/* Danger Style */
.elementor-button-danger .connector-execute-btn {
    background-color: #dc3545;
    color: #ffffff;
}

.elementor-button-danger .connector-execute-btn:hover {
    background-color: #c82333;
}

/* ==========================================================================
   CONNECTOR BUTTON - DEBUGGING HELPER
   ========================================================================== */

/* Debug mode - show button boundaries */
.justdonate-debug .connector-execute-btn {
    border: 1px dashed #ff0000;
}

.justdonate-debug .justdonate-button-wrapper::before {
    content: "JustDonate Button";
    position: absolute;
    top: -20px;
    left: 0;
    font-size: 10px;
    color: #ff0000;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 4px;
    border-radius: 2px;
}
