/**
 * NEM Donatie - Frontend Styling
 */

/* Container */
.nem-donatie-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Form sections */
.nem-form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.nem-form-section:last-of-type {
    border-bottom: none;
}

.nem-form-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
}

/* Form rows */
.nem-form-row {
    margin-bottom: 15px;
}

.nem-form-row label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

.nem-form-row input[type="text"],
.nem-form-row input[type="email"],
.nem-form-row input[type="tel"],
.nem-form-row select,
.nem-form-row textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.nem-form-row input:focus,
.nem-form-row select:focus,
.nem-form-row textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
    outline: none;
}

/* Checkbox rows */
.nem-checkbox-row label {
    display: flex;
    align-items: flex-start;
    font-weight: normal;
    cursor: pointer;
}

.nem-checkbox-row input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
}

.nem-checkbox-row a {
    color: #0073aa;
    text-decoration: underline;
}

/* Donatie opties */
.nem-donatie-options {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nem-option {
    margin-bottom: 10px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.nem-option:hover {
    border-color: #0073aa;
    background-color: #f8f9fa;
}

.nem-option label {
    display: block;
    cursor: pointer;
}

.nem-option input[type="radio"] {
    margin-right: 10px;
}

.nem-option-title {
    font-weight: 600;
    font-size: 16px;
}

.nem-option-description {
    display: block;
    margin-top: 5px;
    margin-left: 26px;
    font-size: 14px;
    color: #666;
}

.nem-option.selected,
.nem-option:has(input:checked) {
    border-color: #0073aa;
    background-color: #f0f8ff;
}

/* Sub-options */
.nem-suboptions-container {
    display: none;
    margin-top: 10px;
    margin-left: 26px;
}

.nem-option.selected .nem-suboptions-container,
.nem-suboptions-container[style*="block"] {
    display: block;
}

.nem-suboption-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    background-color: #fff;
}

.nem-suboption-select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Amount buttons */
.nem-amount-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nem-amount-buttons li {
    flex: 1 1 auto;
    min-width: 70px;
    padding: 15px 20px;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s;
    background: #fff;
}

.nem-amount-buttons li:hover {
    border-color: #0073aa;
    background-color: #f8f9fa;
}

.nem-amount-buttons li.selected {
    border-color: #0073aa;
    background-color: #0073aa;
    color: #fff;
}

.nem-amount-buttons .nem-other-amount {
    flex: 2 1 auto;
    min-width: 120px;
    padding: 0;
    display: flex;
    align-items: center;
}

.nem-amount-buttons .nem-other-amount input {
    width: 100%;
    height: 100%;
    border: none;
    padding: 15px 20px;
    font-size: 16px;
    text-align: center;
    border-radius: 4px;
    box-sizing: border-box;
}

.nem-amount-buttons .nem-other-amount input:focus {
    outline: none;
}

.nem-amount-buttons .nem-other-amount.selected {
    border-color: #0073aa;
}

/* Hidden fields for periodic donations (naam, adres, telefoon) */
.nem-periodic-field {
    display: none;
}

.nem-donatie-form.show-periodic .nem-periodic-field {
    display: block;
}

/* Hidden fields for machtiging (IBAN fields) */
.nem-machtiging-field {
    display: none;
}

.nem-donatie-form.show-machtiging .nem-machtiging-field {
    display: block;
}

/* Fixed periodic frequency - show machtiging and periodic fields by default */
.nem-fixed-periodic .nem-machtiging-field,
.nem-fixed-periodic .nem-periodic-field {
    display: block;
}

/* Hide BIC field for fixed periodic (will be shown via JS when foreign country) */
.nem-fixed-periodic .nem-bic-field {
    display: none;
}

.nem-fixed-periodic.show-foreign .nem-bic-field {
    display: block;
}

/* BIC field - only visible when machtiging AND foreign country */
.nem-donatie-form.show-machtiging .nem-bic-field {
    display: none;
}

.nem-donatie-form.show-machtiging.show-foreign .nem-bic-field {
    display: block;
}

/* Foreign BIC field */
.nem-foreign-only {
    display: none;
}

.nem-donatie-form.show-foreign .nem-foreign-only {
    display: block;
}

/* Hide payment type dropdown for periodic donations only */
.nem-donatie-form.is-periodic .nem-payment-type-row {
    display: none;
}

/* Submit button */
.nem-submit-btn {
    display: block;
    width: 100%;
    padding: 15px 30px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.nem-submit-btn:hover {
    background-color: #005a87;
}

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

/* Messages */
.nem-form-messages {
    margin-top: 20px;
}

.nem-donatie-message {
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.nem-donatie-message.nem-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.nem-donatie-message.nem-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.nem-donatie-message h3 {
    margin-top: 0;
}

/* Loading state */
.nem-donatie-form.loading .nem-submit-btn {
    position: relative;
    color: transparent;
}

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

@keyframes nem-spin {
    to {
        transform: rotate(360deg);
    }
}

/* reCAPTCHA v3 badge - hide but keep accessible */
.grecaptcha-badge {
    visibility: hidden !important;
}

/* Status badges (admin) */
.nem-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.nem-status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.nem-status-paid {
    background-color: #d4edda;
    color: #155724;
}

.nem-status-failed {
    background-color: #f8d7da;
    color: #721c24;
}

/* Responsive */
@media (max-width: 600px) {
    .nem-donatie-container {
        padding: 15px;
    }

    .nem-amount-buttons {
        flex-direction: column;
    }

    .nem-amount-buttons li {
        width: 100%;
    }

    .nem-form-row input,
    .nem-form-row select {
        font-size: 16px; /* Prevent iOS zoom */
    }
}

/* Address fields in row - only when periodic fields are visible */
@media (min-width: 500px) {
    .nem-donatie-form.show-periodic .nem-address-row {
        display: inline-block;
        width: calc(50% - 5px);
        vertical-align: top;
    }
}
