/**
 * Public styles for Marketplace Payments
 */

/* Payment Form */
.marketplace-payment-form {
    max-width: 600px;
    margin: 30px auto;
}

.payment-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.payment-summary h3 {
    margin: 0 0 20px;
    font-size: 20px;
}

.payment-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.payment-line:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 18px;
    padding-top: 15px;
}

/* Stripe Elements */
.payment-method-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.payment-method-section h4 {
    margin: 0 0 20px;
    font-size: 18px;
}

#card-element {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    transition: border-color 0.3s;
}

#card-element.StripeElement--focus {
    border-color: #2271b1;
}

#card-element.StripeElement--invalid {
    border-color: #d63638;
}

#card-errors {
    color: #d63638;
    font-size: 14px;
    margin-top: 10px;
    display: none;
}

#card-errors.visible {
    display: block;
}

.payment-form-actions {
    margin-top: 30px;
}

.payment-submit-btn {
    width: 100%;
    padding: 15px 30px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.payment-submit-btn:hover {
    background: #135e96;
}

.payment-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.payment-submit-btn.processing {
    position: relative;
    color: transparent;
}

.payment-submit-btn.processing:after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Vendor Earnings */
.vendor-earnings-dashboard {
    display: grid;
    gap: 30px;
}

.earnings-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.earnings-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
}

.earnings-card h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
}

.earnings-amount {
    font-size: 36px;
    font-weight: 700;
    color: #2271b1;
    margin: 0;
}

.earnings-card.available .earnings-amount {
    color: #46b450;
}

.earnings-comparison {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
}

.earnings-comparison.positive {
    color: #46b450;
}

.earnings-comparison.negative {
    color: #d63638;
}

/* Payout Request */
.payout-request-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
}

.payout-request-section h3 {
    margin: 0 0 20px;
}

.payout-form {
    display: flex;
    gap: 15px;
    align-items: end;
}

.payout-amount-input {
    flex: 1;
}

.payout-amount-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.payout-amount-input input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.request-payout-btn {
    padding: 10px 20px;
    background: #46b450;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.request-payout-btn:hover {
    background: #3a9b3e;
}

.request-payout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.payout-info {
    margin-top: 15px;
    padding: 15px;
    background: #f0f6ff;
    border-radius: 5px;
    font-size: 14px;
}

/* Payouts History */
.payouts-history {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
}

.payouts-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.payouts-table th,
.payouts-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.payouts-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.payout-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.payout-status.pending {
    background: #fff3e0;
    color: #e65100;
}

.payout-status.processing {
    background: #e3f2fd;
    color: #0d47a1;
}

.payout-status.paid {
    background: #e8f5e9;
    color: #1b5e20;
}

.payout-status.failed {
    background: #ffebee;
    color: #b71c1c;
}

/* Stripe Onboarding */
.stripe-onboarding-section {
    max-width: 600px;
    margin: 30px auto;
}

.stripe-status-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
}

.stripe-status-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.stripe-status-card.connected .stripe-status-icon {
    color: #46b450;
}

.stripe-status-card.pending .stripe-status-icon {
    color: #ff9800;
}

.stripe-status-card.not-connected .stripe-status-icon {
    color: #999;
}

.stripe-status-message {
    font-size: 18px;
    margin-bottom: 20px;
}

.stripe-onboarding-btn {
    padding: 15px 30px;
    background: #635bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.stripe-onboarding-btn:hover {
    background: #5048e5;
}

.stripe-account-details {
    margin-top: 30px;
    text-align: left;
}

.account-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.account-detail-label {
    font-weight: 600;
    color: #666;
}

.account-detail-value {
    color: #333;
}

.capability-status {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: 8px;
}

.capability-status.active {
    background: #46b450;
}

.capability-status.inactive {
    background: #d63638;
}

/* Payment Methods */
.payment-methods-section {
    max-width: 800px;
    margin: 30px auto;
}

.payment-methods-list {
    display: grid;
    gap: 15px;
}

.payment-method-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.payment-method-icon {
    font-size: 32px;
    color: #666;
}

.payment-method-details {
    flex: 1;
}

.payment-method-brand {
    font-weight: 600;
    text-transform: capitalize;
}

.payment-method-last4 {
    color: #666;
    font-size: 14px;
}

.payment-method-actions {
    display: flex;
    gap: 10px;
}

.payment-method-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
}

.payment-method-btn:hover {
    background: #f8f9fa;
}

.payment-method-btn.remove {
    color: #d63638;
    border-color: #d63638;
}

.add-payment-method {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background: #2271b1;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
}

.add-payment-method:hover {
    background: #135e96;
}

/* Responsive */
@media (max-width: 768px) {
    .earnings-overview {
        grid-template-columns: 1fr;
    }
    
    .payout-form {
        flex-direction: column;
    }
    
    .payment-method-card {
        flex-wrap: wrap;
    }
    
    .payment-method-actions {
        width: 100%;
        justify-content: flex-end;
    }
}