/* Stripe Payment Styles */
/* 基于stripe.html的样式，适配现有的divination-international设计 */

.stripe-payment-form {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 30px 40px; /* Increased horizontal padding */
    margin: 20px 0;
    max-width: 850px; /* Increased maximum width */
    width: 100%;
    min-width: 500px; /* Ensure minimum width for card fields */
}

.stripe-header {
    text-align: center;
    margin-bottom: 30px;
}

.stripe-header h3 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 10px;
    font-weight: 600;
}

.stripe-header p {
    color: #666;
    font-size: 1.1em;
    margin: 0;
}

/* Stripe Card Element Container */
#stripe-card-element-10,
#stripe-card-element-30,
#stripe-card-element-50,
#stripe-card-element-1000,
#stripe-card-element-1001,
#stripe-card-element-2001,
#stripe-card-element-2002,
[id^="stripe-card-element-"] {
    background: white;
    padding: 25px 30px; /* Increased padding for more space */
    border-radius: 12px;
    border: 2px solid #e1e5e9;
    margin: 25px 0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    min-height: 60px; /* Increased minimum height */
    width: 100%;
    box-sizing: border-box;
}

[id^="stripe-card-element-"]:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Error Messages */
.stripe-error {
    color: #c62828;
    background: #ffebee;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 0.9em;
    border-left: 4px solid #c62828;
}

/* Buttons */
.stripe-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.stripe-submit-btn {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 50px;
}

.stripe-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

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

.stripe-cancel-btn {
    flex: 0 0 auto;
    background: transparent;
    color: #666;
    border: 2px solid #e1e5e9;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 50px;
}

.stripe-cancel-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

/* Loading State */
.stripe-loading {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
}

.stripe-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: stripe-spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.stripe-loading p {
    color: #666;
    font-size: 1.1em;
    margin: 0;
}

/* Success Message */
.stripe-success {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 15px 0;
    border-left: 4px solid #4caf50;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 600px) {
    .stripe-payment-form {
        padding: 20px 15px; /* Reduce padding on mobile */
        margin: 10px 0;
        min-width: auto; /* Remove min-width constraint on mobile */
    }
    
    .stripe-payment-interface {
        padding: 1rem; /* Reduce padding on mobile */
        min-width: auto; /* Remove min-width constraint on mobile */
    }
    
    .stripe-payment-container {
        min-width: auto; /* Remove min-width constraint on mobile */
    }
    
    [id^="stripe-card-element-"] {
        padding: 20px 15px; /* Reduce padding on mobile */
        margin: 20px 0;
    }
    
    .StripeElement {
        padding: 12px 15px; /* Reduce padding on mobile */
        height: 45px; /* Slightly smaller on mobile */
    }
    
    .stripe-header h3 {
        font-size: 1.5em;
    }
    
    .stripe-header p {
        font-size: 1em;
    }
    
    .stripe-buttons {
        flex-direction: column;
    }
    
    .stripe-cancel-btn {
        flex: 1;
    }
}

/* Integration with existing styles */
.payment-container .stripe-payment-form {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

.payment-modal .stripe-payment-form {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* Stripe Payment Interface Styles */
.stripe-payment-interface {
    padding: 1.5rem 2rem; /* More generous horizontal padding */
    max-width: 850px; /* Increased to match payment form */
    margin: 0 auto;
    width: 100%;
    min-width: 500px; /* Ensure minimum width */
}

.stripe-payment-container {
    width: 100%;
    max-width: 850px; /* Increased to match payment form */
    margin: 0 auto;
    min-width: 500px; /* Ensure minimum width */
}

/* Override any restrictive PayPal styles */
.paypal-payment-interface {
    max-width: 700px; /* Override account.css restriction */
}

/* Payment Modal Specific Styles */
#paymentModal .modal-content {
    max-width: 900px; /* Even wider for credit card forms */
    min-width: 600px; /* Ensure minimum width for card fields */
    width: 85vw; /* Use more screen space */
}

/* Responsive adjustments for payment modal */
@media (max-width: 1000px) {
    #paymentModal .modal-content {
        max-width: 95vw;
        min-width: auto;
        margin: 1rem;
        width: 95vw;
    }
}

@media (max-width: 650px) {
    #paymentModal .modal-content {
        width: 98vw;
        margin: 0.5rem;
    }
}

/* Overlay styles for modal */
.stripe-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.stripe-overlay .stripe-payment-form {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

/* Animations */
.stripe-payment-form {
    animation: stripe-slideIn 0.3s ease-out;
}

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

/* Focus states */
.stripe-submit-btn:focus,
.stripe-cancel-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Stripe Elements specific styles */
.StripeElement {
    background-color: white;
    height: 50px; /* Increased height for better visibility */
    padding: 15px 20px; /* More generous padding */
    border-radius: 8px;
    border: 1px solid transparent;
    box-shadow: 0 1px 3px 0 #e6ebf1;
    transition: box-shadow 150ms ease;
    font-size: 16px; /* Explicit font size */
    width: 100%;
    box-sizing: border-box;
}

.StripeElement--focus {
    box-shadow: 0 1px 3px 0 #cfd7df;
}

.StripeElement--invalid {
    border-color: #fa755a;
}

.StripeElement--webkit-autofill {
    background-color: #fefde5 !important;
}

/* Product-specific color schemes */
.stripe-payment-form[data-product="subscription"] .stripe-submit-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.stripe-payment-form[data-product="premium"] .stripe-submit-btn {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.stripe-payment-form[data-product="coins"] .stripe-submit-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    color: #333;
}
