/* CF7 Stripe Payment Redirector Plugin Styles */

/* Main form container */
.cf7-stripe-form-container,
.payment-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Payment options styling for both CF7 and shortcode forms */
.wpcf7-radio,
.payment-options-list {
    display: block;
    margin: 20px 0;
}

.wpcf7-radio .wpcf7-list-item,
.payment-option-item {
    display: block;
    margin: 8px 0;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.wpcf7-radio .wpcf7-list-item:hover,
.payment-option-item:hover {
    border-color: #007cba;
    background: #f0f8ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wpcf7-radio .wpcf7-list-item input[type="radio"],
.payment-option-item input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2);
    accent-color: #007cba;
}

.wpcf7-radio .wpcf7-list-item input[type="radio"]:checked + .wpcf7-list-item-label,
.payment-option-item input[type="radio"]:checked + .payment-option-label {
    font-weight: bold;
    color: #007cba;
}

/* Highlight selected option */
.wpcf7-radio .wpcf7-list-item:has(input[type="radio"]:checked),
.payment-option-item:has(input[type="radio"]:checked) {
    border-color: #007cba;
    background: #f0f8ff;
    box-shadow: 0 2px 8px rgba(0,124,186,0.2);
}

/* Label styling */
.wpcf7-radio .wpcf7-list-item-label,
.payment-option-label {
    font-size: 14px;
    line-height: 1.4;
    display: block;
    cursor: pointer;
}

/* Special styling for savings options */
.wpcf7-radio .wpcf7-list-item:has([value*="SAVE"]),
.payment-option-item:has([value*="SAVE"]) {
    border-left: 4px solid #28a745;
}

.wpcf7-radio .wpcf7-list-item:has([value*="SAVE"]) .wpcf7-list-item-label:after,
.payment-option-item:has([value*="SAVE"]) .payment-option-label:after {
    content: " ✓ Best Value";
    color: #28a745;
    font-weight: bold;
    font-size: 12px;
}

/* Payment plan options styling */
.wpcf7-radio .wpcf7-list-item:has([value*="PAYMENT PLAN"]),
.payment-option-item:has([value*="PAYMENT PLAN"]) {
    border-left: 4px solid #ffc107;
}

.wpcf7-radio .wpcf7-list-item:has([value*="PAYMENT PLAN"]) .wpcf7-list-item-label:after,
.payment-option-item:has([value*="PAYMENT PLAN"]) .payment-option-label:after {
    content: " 📅 Flexible";
    color: #856404;
    font-weight: bold;
    font-size: 12px;
}

/* Form input styling */
.form-row {
    margin: 15px 0;
}

.form-row input[type="text"],
.form-row input[type="email"],
.cf7-stripe-form input[type="text"],
.cf7-stripe-form input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-row input[type="text"]:focus,
.form-row input[type="email"]:focus,
.cf7-stripe-form input[type="text"]:focus,
.cf7-stripe-form input[type="email"]:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 5px rgba(0,124,186,0.3);
}

/* Payment button styling */
.payment-buttons {
    text-align: center;
    margin-top: 20px;
}

#payment-submit,
.payment-submit-btn {
    background: #007cba;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

#payment-submit:hover,
.payment-submit-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#payment-submit:disabled,
.payment-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading state */
.payment-loading #payment-submit,
.payment-loading .payment-submit-btn {
    background: #ccc;
    cursor: not-allowed;
    position: relative;
}

.payment-loading #payment-submit:after,
.payment-loading .payment-submit-btn:after {
    content: "";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Error message styling */
.cf7-stripe-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 15px 0;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .cf7-stripe-form-container,
    .payment-form-container {
        margin: 10px;
        padding: 15px;
    }
    
    .wpcf7-radio .wpcf7-list-item,
    .payment-option-item {
        padding: 10px 12px;
    }
    
    #payment-submit,
    .payment-submit-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .wpcf7-radio .wpcf7-list-item-label,
    .payment-option-label {
        font-size: 13px;
    }
}

/* Course grouping styles (optional enhancement) */
.course-options h3 {
    margin: 25px 0 15px 0;
    padding: 10px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
}

.course-options h3:first-child {
    margin-top: 0;
}

.course-options .wpcf7-radio {
    margin-bottom: 25px;
    padding: 0 10px;
}

/* Different colors for different course types */
.course-options h3:nth-of-type(1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.course-options h3:nth-of-type(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.course-options h3:nth-of-type(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Plugin admin styles */
.cf7-stripe-admin-container {
    max-width: 1200px;
}

.payment-option-row {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.payment-option-row h4 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.remove-payment-option {
    background: #dc3545 !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    margin-top: 10px;
}

.remove-payment-option:hover {
    background: #c82333 !important;
}