/**
 * Stripe Payment Frontend CSS
 *
 * @package HRM_Stripe_Payment
 */

/* ============================================
   RESET - Override theme styles
   ============================================ */

.hrm-stripe-payment-section,
.hrm-stripe-payment-section *,
.hrm-stripe-button-wrapper,
.hrm-stripe-button-wrapper * {
    box-sizing: border-box !important;
    float: none !important;
}

/* Payment button section */
.hrm-stripe-payment-section {
    margin-top: 30px !important;
    padding: 30px !important;
    background: #f9f9f9 !important;
    border-radius: 8px !important;
    border: 1px solid #e0e0e0 !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
}

.hrm-stripe-payment-summary {
    text-align: center !important;
    width: 100% !important;
    display: block !important;
}

.hrm-stripe-payment-summary h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    text-align: center !important;
}

.hrm-stripe-payment-details {
    background: white;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 500px !important;
}

.hrm-stripe-payment-details .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.hrm-stripe-payment-details .detail-row:last-child {
    border-bottom: none;
}

.hrm-stripe-payment-details .detail-label {
    font-weight: 600;
    color: #666;
}

.hrm-stripe-payment-details .detail-value {
    color: #333;
    font-weight: 600;
}

/* ============================================
   Button Wrapper - FORCE CENTER
   ============================================ */

.hrm-stripe-button-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    text-align: center !important;
    margin: 20px auto !important;
    padding: 0 !important;
    float: none !important;
    clear: both !important;
    position: relative !important;
}

/* Override any flex from themes */
.hrm-stripe-button-wrapper,
div.hrm-stripe-button-wrapper,
.hrm-stripe-payment-section .hrm-stripe-button-wrapper,
.hrm-stripe-payment-summary .hrm-stripe-button-wrapper {
    display: block !important;
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
}

/* ============================================
   Payment Button - FORCE CENTER
   ============================================ */

.hrm-stripe-pay-button,
a.hrm-stripe-pay-button,
.hrm-stripe-button-wrapper .hrm-stripe-pay-button,
.hrm-stripe-button-wrapper a.hrm-stripe-pay-button {
    display: inline-block !important;
    float: none !important;
    margin: 0 auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    padding: 14px 40px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    transition: all 0.3s ease !important;
    border: none !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
    text-align: center !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
}

.hrm-stripe-pay-button:hover,
a.hrm-stripe-pay-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4) !important;
    text-decoration: none !important;
    color: white !important;
}

.hrm-stripe-pay-button:active {
    transform: translateY(0);
}

.hrm-stripe-pay-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.hrm-stripe-pay-button:visited,
a.hrm-stripe-pay-button:visited {
    color: white !important;
}

/* Payment container */
.hrm-stripe-payment-button-container {
    margin: 30px 0;
    text-align: center !important;
    width: 100% !important;
}

/* Payment status messages */
.hrm-stripe-success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 4px solid #66bb6a;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.hrm-stripe-error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 4px solid #ef5350;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.hrm-stripe-info-message {
    background: #f3e5f5;
    color: #6a1b9a;
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 4px solid #ab47bc;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .hrm-stripe-payment-section {
        padding: 20px !important;
    }

    .hrm-stripe-payment-summary h3 {
        font-size: 18px;
    }

    .hrm-stripe-pay-button,
    a.hrm-stripe-pay-button {
        width: auto !important;
        max-width: 100% !important;
        padding: 12px 20px !important;
        font-size: 14px !important;
    }
}

/* Test mode indicator */
.hrm-stripe-test-mode {
    background: #fff3cd;
    color: #856404;
    padding: 12px 20px;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.hrm-stripe-test-mode::before {
    content: '⚠️';
    margin-right: 8px;
}

/* Loading state */
.hrm-stripe-pay-button.loading {
    position: relative;
    color: transparent !important;
}

.hrm-stripe-pay-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: hrm-stripe-spin 0.6s linear infinite;
}

@keyframes hrm-stripe-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .hrm-stripe-pay-button,
    .hrm-stripe-pay-button:hover {
        transition: none;
        transform: none;
    }

    .hrm-stripe-pay-button.loading::after {
        animation: none;
        border-top-color: rgba(255, 255, 255, 0.3);
    }
}

/* Focus states for accessibility */
.hrm-stripe-pay-button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .hrm-stripe-payment-section {
        background: #2a2a2a !important;
        border-color: #444 !important;
    }

    .hrm-stripe-payment-summary h3 {
        color: #f0f0f0;
    }

    .hrm-stripe-payment-details {
        background: #333;
        border-color: #444;
    }

    .hrm-stripe-payment-details .detail-label {
        color: #999;
    }

    .hrm-stripe-payment-details .detail-value {
        color: #f0f0f0;
    }
}
