/**
 * TalentGro Razorpay Checkout - Elementor Widget Styles
 * 
 * Enhanced styling for the Elementor payment button widget
 */

/* Widget wrapper */
.tgrc-elementor-widget-wrapper {
    display: inline-block;
    width: 100%;
}

/* Payment button base styles */
.tgrc-payment-button.elementor-button {
    display: inline-block;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
    touch-action: manipulation;
    user-select: none;
    background-image: none;
    outline: none;
}

/* Button styles */
.tgrc-payment-button.tgrc-style-blue {
    background-color: #0073aa !important;
    color: white !important;
}

.tgrc-payment-button.tgrc-style-blue:hover {
    background-color: #005a87 !important;
    color: white !important;
}

.tgrc-payment-button.tgrc-style-green {
    background-color: #28a745 !important;
    color: white !important;
}

.tgrc-payment-button.tgrc-style-green:hover {
    background-color: #218838 !important;
    color: white !important;
}

.tgrc-payment-button.tgrc-style-red {
    background-color: #dc3545 !important;
    color: white !important;
}

.tgrc-payment-button.tgrc-style-red:hover {
    background-color: #c82333 !important;
    color: white !important;
}

.tgrc-payment-button.tgrc-style-orange {
    background-color: #fd7e14 !important;
    color: white !important;
}

.tgrc-payment-button.tgrc-style-orange:hover {
    background-color: #e8650e !important;
    color: white !important;
}

.tgrc-payment-button.tgrc-style-purple {
    background-color: #6f42c1 !important;
    color: white !important;
}

.tgrc-payment-button.tgrc-style-purple:hover {
    background-color: #5e37a6 !important;
    color: white !important;
}

.tgrc-payment-button.tgrc-style-dark {
    background-color: #343a40 !important;
    color: white !important;
}

.tgrc-payment-button.tgrc-style-dark:hover {
    background-color: #23272b !important;
    color: white !important;
}

/* Button sizes */
.tgrc-payment-button.tgrc-size-small {
    padding: 8px 16px !important;
    font-size: 13px !important;
    min-height: 32px;
}

.tgrc-payment-button.tgrc-size-medium {
    padding: 12px 24px !important;
    font-size: 16px !important;
    min-height: 40px;
}

.tgrc-payment-button.tgrc-size-large {
    padding: 16px 32px !important;
    font-size: 18px !important;
    min-height: 48px;
}

/* Button width */
.tgrc-payment-button.tgrc-width-full {
    width: 100% !important;
    display: block;
}

/* Loading state */
.tgrc-payment-button.tgrc-loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.tgrc-payment-button.tgrc-loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: tgrc-spin 1s linear infinite;
}

/* Completed state */
.tgrc-payment-button.tgrc-payment-completed {
    cursor: not-allowed;
    opacity: 0.8;
    /* Background and color will be set by JavaScript to preserve original styling */
}

/* Animations */
@keyframes tgrc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus states for accessibility */
.tgrc-payment-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tgrc-payment-button.tgrc-size-large {
        padding: 14px 28px !important;
        font-size: 16px !important;
    }
    
    .tgrc-payment-button.tgrc-size-medium {
        padding: 10px 20px !important;
        font-size: 15px !important;
    }
    
    .tgrc-payment-button.tgrc-size-small {
        padding: 8px 14px !important;
        font-size: 13px !important;
    }
}

/* Elementor editor specific styles */
.elementor-editor .tgrc-payment-button {
    cursor: default !important;
    pointer-events: none;
}

.elementor-editor .tgrc-elementor-widget-wrapper {
    position: relative;
}

.elementor-editor .tgrc-elementor-widget-wrapper:before {
    content: '👆 Payment Button (Click to edit settings)';
    position: absolute;
    top: -25px;
    left: 0;
    font-size: 11px;
    color: #666;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.elementor-editor .tgrc-elementor-widget-wrapper:hover:before {
    opacity: 1;
}

/* RTL support */
[dir="rtl"] .tgrc-payment-button {
    text-align: center;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tgrc-payment-button {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .tgrc-payment-button {
        transition: none;
    }
    
    .tgrc-payment-button.tgrc-loading:after {
        animation: none;
    }
}

/* Print styles */
@media print {
    .tgrc-payment-button {
        background: white !important;
        color: black !important;
        border: 1px solid black !important;
    }
    
    .tgrc-payment-button:after {
        content: ' (Payment Button)';
        font-size: 0.8em;
        opacity: 0.7;
    }
}