/**
 * Secure Fields Payment Form Styling
 * Matches the black/yellow theme of the plugin
 */

.mzb-securefields-container {
    background: #000;
    border: 2px solid #fff;
    border-radius: 6px;
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .mzb-securefields-container {
        margin: 10px;
        padding: 15px;
    }
}

/* Payment Summary Section */
.mzb-payment-summary-sf {
    background: #000;
    border: 1px solid #fff;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.mzb-payment-summary-sf .summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #fff;
    font-size: 15px;
}

.mzb-payment-summary-sf .summary-row.total {
    padding-top: 10px;
    border-top: 2px solid #fff;
    margin-top: 10px;
    font-weight: bold;
}

.mzb-payment-summary-sf .summary-row.total .amount {
    color: #fefb1f;
    font-size: 18px;
}

/* Bank Payment Section (Promoted First) */
.mzb-bank-payment-option {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: 2px solid #fff;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.mzb-bank-payment-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(254, 251, 31, 0.3);
}

.mzb-bank-payment-option .title {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mzb-bank-payment-option .savings {
    background: #fefb1f;
    color: #000;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.mzb-bank-payment-option .description {
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
}

/* Digital Wallet Section */
.mzb-digital-wallet-option {
    background: linear-gradient(135deg, #000 0%, #333 100%);
    border: 2px solid #fff;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.mzb-digital-wallet-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mzb-digital-wallet-option .title {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mzb-digital-wallet-option .description {
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
}

/* Card Payment Section */
.mzb-card-payment-section {
    margin-top: 20px;
}

.mzb-card-payment-section .section-title {
    color: #fefb1f;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

/* Secure Field Containers */
.mzb-field-group {
    margin-bottom: 15px;
}

.mzb-field-label {
    display: block;
    color: #fff;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.mzb-field-container {
    background: #fff;
    border: 2px solid #fff;
    border-radius: 4px;
    padding: 0;
    min-height: 42px;
    position: relative;
    transition: border-color 0.3s;
}

.mzb-field-container:focus-within {
    border-color: #fefb1f;
    box-shadow: 0 0 0 3px rgba(254, 251, 31, 0.1);
}

.mzb-field-container.error {
    border-color: #dc3545;
}

/* Secure field iframes */
.mzb-field-container iframe {
    width: 100%;
    height: 42px;
    border: none;
    display: block;
}

/* Two-column layout for expiry and CVV */
.mzb-field-row {
    display: flex;
    gap: 15px;
}

.mzb-field-row .mzb-field-group {
    flex: 1;
}

@media (max-width: 480px) {
    .mzb-field-row {
        flex-direction: column;
        gap: 15px;
    }
}

/* Field Error Messages */
.mzb-field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.mzb-field-group.has-error .mzb-field-error {
    display: block;
}

/* Payment Amount Display */
.mzb-payment-display {
    text-align: center;
    font-size: 13px;
    font-weight: normal;
    color: #999;
    background: transparent;
    padding: 8px;
    border: none;
    margin-top: 10px;
    margin-bottom: 10px;
}

.mzb-payment-display #mzb-button-amount {
    color: #999;
    font-size: 13px;
    font-weight: normal;
}

/* Submit Button - Let SDK control it */
.mzb-submit-button,
#mzb-card-submit {
    width: 100%;
    margin-top: 20px;
    cursor: pointer;
    border: none !important;
    outline: none !important;
    background: transparent;
    padding: 0;
    min-height: 50px;
}

#mzb-card-submit:focus {
    outline: none !important;
    border: none !important;
}

#mzb-card-submit iframe {
    width: 100% !important;
    min-height: 50px !important;
    height: 50px !important;
    border: none !important;
}

/* Hide any SDK-generated submit buttons */
#mzb-securefields-form input[type="submit"],
#mzb-securefields-form button[type="submit"]:not(#mzb-card-submit) {
    display: none !important;
}

.mzb-submit-button:disabled,
#mzb-card-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mzb-submit-button.processing,
#mzb-card-submit.processing {
    position: relative;
    color: transparent;
}

.mzb-submit-button.processing::after,
#mzb-card-submit.processing::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid #000;
    border-radius: 50%;
    border-top-color: transparent;
    animation: mzb-spinner 0.8s linear infinite;
}

@keyframes mzb-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Error Display Section */
.mzb-error-display {
    background: #fff3cd;
    border-left: 4px solid #dc3545;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    display: none;
}

.mzb-error-display.show {
    display: block;
}

.mzb-error-title {
    color: #721c24;
    font-weight: bold;
    margin-bottom: 8px;
}

.mzb-error-message {
    color: #856404;
    font-size: 14px;
    line-height: 1.5;
}

.mzb-error-details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ffeaa7;
}

.mzb-error-details-toggle {
    color: #856404;
    text-decoration: underline;
    cursor: pointer;
    font-size: 13px;
}

.mzb-error-details-content {
    display: none;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    font-family: monospace;
    background: #fff;
    padding: 10px;
    border-radius: 3px;
}

.mzb-error-details-content.show {
    display: block;
}

/* Success Display */
.mzb-success-display {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    display: none;
}

.mzb-success-display.show {
    display: block;
}

.mzb-success-title {
    color: #155724;
    font-weight: bold;
    margin-bottom: 8px;
}

.mzb-success-message {
    color: #155724;
    font-size: 14px;
}

/* Loading Overlay */
.mzb-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.mzb-loading-overlay.show {
    display: flex;
}

.mzb-loading-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.mzb-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #fefb1f;
    border-radius: 50%;
    animation: mzb-spinner 1s linear infinite;
    margin: 0 auto 15px;
}

.mzb-loading-text {
    color: #333;
    font-size: 16px;
}

/* Fallback to HPP Link */
.mzb-fallback-link {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 4px;
    display: none;
}

.mzb-fallback-link.show {
    display: block;
}

.mzb-fallback-link a {
    color: #856404;
    text-decoration: underline;
    font-weight: 600;
}

.mzb-fallback-link a:hover {
    color: #533f03;
}

/* Security Badge */
.mzb-security-badge {
    text-align: center;
    color: #ccc;
    font-size: 12px;
    margin-top: 15px;
}

.mzb-security-badge::before {
    content: "🔒 ";
}
