/* Parcelow Payment Gateway - Estilos do Checkout */

#parcelow-payment-form {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    border: 2px dashed #0073aa; /* Debug: borda visível */
    padding: 15px;
    background: #f0f8ff; /* Debug: fundo azul claro */
}

/* Debug: Títulos visíveis para cada seção */
#parcelow-payment-form > div::before {
    font-size: 12px;
    font-weight: bold;
    color: #0073aa;
    display: block;
    margin-bottom: 5px;
}

#parcelow-loading::before {
    content: "🔄 LOADING SECTION";
}

#parcelow-questions::before {
    content: "❓ QUESTIONS SECTION";
}

#parcelow-payment-methods::before {
    content: "💳 PAYMENT METHODS SECTION";
}

/* Loading */
#parcelow-loading, #parcelow-installments-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

#parcelow-loading::before, #parcelow-installments-loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: parcelow-spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

/* Loading específico para parcelas */
#parcelow-installments-loading {
    padding: 10px;
    background: #f0f8ff;
    border: 1px solid #0073aa;
    border-radius: 4px;
    margin: 5px 0;
}

@keyframes parcelow-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Questions Section */
#parcelow-questions {
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 15px 0;
}

#parcelow-questions h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.parcelow-question {
    margin: 15px 0;
    padding: 15px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
}

.parcelow-question label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.parcelow-question input[type="text"],
.parcelow-question input[type="email"],
.parcelow-question input[type="tel"],
.parcelow-question select,
.parcelow-question textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.parcelow-question input:focus,
.parcelow-question select:focus,
.parcelow-question textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.parcelow-question textarea {
    resize: vertical;
    min-height: 80px;
}

.parcelow-question input[type="radio"],
.parcelow-question input[type="checkbox"] {
    margin-right: 8px;
}

.parcelow-question-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.parcelow-question-option {
    display: flex;
    align-items: center;
    padding: 8px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.parcelow-question-option:hover {
    background-color: #f5f5f5;
}

.parcelow-question-option input[type="radio"]:checked + label,
.parcelow-question-option input[type="checkbox"]:checked + label {
    font-weight: 500;
}

#parcelow-submit-answers {
    background: #0073aa;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 15px;
}

#parcelow-submit-answers:hover {
    background: #005a87;
}

#parcelow-submit-answers:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Payment Methods Section */
#parcelow-payment-methods {
    margin: 20px 0;
}

#parcelow-payment-methods h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.parcelow-payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .parcelow-payment-options {
        grid-template-columns: 1fr;
    }
}

.parcelow-payment-option {
    display: block;
    padding: 20px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    position: relative;
}

.parcelow-payment-option:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.parcelow-payment-option input[type="radio"] {
    position: absolute;
    top: 15px;
    right: 15px;
    margin: 0;
}

.parcelow-payment-option input[type="radio"]:checked + .parcelow-method-label {
    color: #0073aa;
}

.parcelow-payment-option:has(input[type="radio"]:checked) {
    border-color: #0073aa;
    background: #f8fafb;
}

.parcelow-method-label {
    display: block;
    padding-right: 30px;
}

.parcelow-method-label strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.parcelow-method-label small {
    color: #666;
    font-size: 13px;
}

/* Credit Card Fields */
#parcelow-credit-card-fields {
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 15px;
}

.parcelow-field-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .parcelow-field-row {
        grid-template-columns: 1fr;
    }
}

.parcelow-field {
    display: flex;
    flex-direction: column;
}

.parcelow-field:last-child {
    margin-bottom: 0;
}

.parcelow-field label {
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    font-size: 14px;
}

.parcelow-field input,
.parcelow-field select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: #fff;
}

.parcelow-field input:focus,
.parcelow-field select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Installments Loading */
#parcelow-installments-loading {
    display: flex;
    align-items: center;
    padding: 10px;
    color: #666;
    font-size: 14px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 10px;
}

#parcelow-installments-loading::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: parcelow-spin 1s linear infinite;
    margin-right: 8px;
    flex-shrink: 0;
}

#parcelow-installments-error {
    padding: 10px;
    margin-bottom: 10px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-size: 13px;
}

.parcelow-field select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* Enhanced select styling for installments */
#parcelow_installments {
    background: linear-gradient(45deg, #fff 0%, #f8f9fa 100%);
    font-weight: 500;
}

#parcelow_installments option[data-interest="0"] {
    color: #28a745;
    font-weight: 500;
}

#parcelow_installments option[data-interest]:not([data-interest="0"]) {
    color: #dc3545;
}

/* PIX Section */
.parcelow-pix-info {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    text-align: center;
}

.parcelow-pix-info h4 {
    color: #2e7d32;
    margin: 0 0 10px 0;
}

.parcelow-pix-qr {
    margin: 15px 0;
}

.parcelow-pix-qr img {
    max-width: 200px;
    height: auto;
}

.parcelow-pix-code {
    background: #fff;
    border: 1px solid #4caf50;
    border-radius: 4px;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    word-break: break-all;
    margin: 10px 0;
}

.parcelow-copy-button {
    background: #4caf50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.parcelow-copy-button:hover {
    background: #45a049;
}

/* Admin Styles */
.parcelow-admin-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.parcelow-admin-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.parcelow-webhook-url {
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    word-break: break-all;
    margin: 10px 0;
}

/* Status Messages */
.parcelow-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 12px;
    margin: 10px 0;
}

.parcelow-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 12px;
    margin: 10px 0;
}

.parcelow-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 12px;
    margin: 10px 0;
}

/* Responsive Design */
@media (max-width: 600px) {
    #parcelow-payment-form {
        margin: 15px 0;
    }
    
    #parcelow-questions,
    #parcelow-credit-card-fields {
        padding: 15px;
    }
    
    .parcelow-payment-option {
        padding: 15px;
    }
    
    .parcelow-method-label strong {
        font-size: 14px;
    }
}

/* Accessibility */
.parcelow-sr-only {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
}

/* Loading overlay */
.parcelow-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.parcelow-loading-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.parcelow-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: parcelow-spin 1s linear infinite;
    margin: 0 auto 15px;
}

/* Print styles */
@media print {
    #parcelow-payment-form {
        display: none;
    }
}

