/**
 * VDPB Event Registration Frontend Styles
 */

/* Form Wrapper */
.vdpb-event-registration-wrapper {
    max-width: 700px;
    margin: 0 auto;
}

/* Form Header with Title and Toggle */
.vdpb-form-header {
    margin-bottom: 20px;
}

.vdpb-form-title {
    margin: 0 0 5px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.vdpb-form-toggle-link {
    display: inline-block;
    font-size: 14px;
    color: #0073aa;
    text-decoration: none;
    cursor: pointer;
}

.vdpb-form-toggle-link:hover {
    text-decoration: underline;
    color: #005a87;
}

/* Toggle Container */
.vdpb-forms-toggle-container {
    max-width: 700px;
    margin: 0 auto;
}

.vdpb-toggle-panel {
    display: none;
}

.vdpb-toggle-panel.active {
    display: block;
}

.vdpb-toggle-panel .vdpb-event-registration-wrapper,
.vdpb-toggle-panel .vdpb-event-cancellation-wrapper {
    max-width: none;
    margin: 0;
}

/* Form Container */
.vdpb-event-registration-form {
    background: #fff;
    padding: 30px;
    border: 1px solid #e1e1e1 !important;
    border-radius: 4px;
}

/* Form Rows */
.vdpb-form-row {
    margin-bottom: 20px;
}

.vdpb-form-row:last-child {
    margin-bottom: 0;
}

/* Labels */
.vdpb-form-row > label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.vdpb-form-row > label.vdpb-required::after {
    content: ' *';
    color: #c00;
}

/* Input Fields */
.vdpb-event-registration-form input[type="text"],
.vdpb-event-registration-form input[type="email"],
.vdpb-event-registration-form input[type="tel"],
.vdpb-event-registration-form select,
.vdpb-event-registration-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc !important;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 0.2s ease;
}

.vdpb-event-registration-form input[type="text"]:focus,
.vdpb-event-registration-form input[type="email"]:focus,
.vdpb-event-registration-form input[type="tel"]:focus,
.vdpb-event-registration-form select:focus,
.vdpb-event-registration-form textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Select Dropdown */
.vdpb-event-registration-form select {
    background-color: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}

/* Textarea */
.vdpb-event-registration-form textarea {
    min-height: 100px;
    resize: vertical;
}

/* Checkbox & Radio Groups */
.vdpb-checkbox-group,
.vdpb-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.vdpb-checkbox-label,
.vdpb-radio-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal;
}

.vdpb-checkbox-label input[type="checkbox"],
.vdpb-radio-label input[type="radio"] {
    margin-right: 10px;
    margin-top: 4px;
    flex-shrink: 0;
}

/* Consent Sections */
.vdpb-form-consent {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-top: 20px;
}

.vdpb-form-consent .vdpb-checkbox-label {
    display: flex;

    font-size: 14px;
    line-height: 1.5;
}

.vdpb-required-marker {
    color: #c00;
    font-weight: bold;
}

/* Dietary Allergies (conditional) */
.vdpb-dietary-allergies-wrapper {
    margin-top: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e1e1e1 !important;
    border-radius: 4px;
}

.vdpb-dietary-allergies-wrapper label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

/* Submit Button */
.vdpb-form-submit {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.vdpb-submit-button {
    display: inline-block;
    padding: 12px 30px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.vdpb-submit-button:hover {
    background: #005a87;
}

.vdpb-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading Indicator */
.vdpb-loading-indicator {
    display: inline-block;
    margin-left: 15px;
    color: #666;
}

/* Required Note */
.vdpb-required-note {
    margin-top: 15px;
    font-size: 13px;
    color: #666;
}

/* Messages */
.vdpb-form-messages {
    margin-bottom: 20px;
}

.vdpb-form-messages:empty {
    display: none;
    margin-bottom: 0;
}

.vdpb-message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.vdpb-message:last-child {
    margin-bottom: 0;
}

.vdpb-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb !important;
}

.vdpb-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb !important;
}

.vdpb-message-info {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff !important;
}

/* Event Info Box */
.vdpb-event-info {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 25px;
}

.vdpb-event-info-item {
    margin-bottom: 8px;
}

.vdpb-event-info-item:last-child {
    margin-bottom: 0;
}

.vdpb-event-info-item strong {
    display: inline-block;
    min-width: 80px;
}

/* Capacity Info */
.vdpb-capacity-info {
    margin-bottom: 20px;
    padding: 12px 15px;
    border-radius: 4px;
}

.vdpb-capacity-available {
    color: #155724;
    background: #d4edda;
    display: block;
    padding: 10px;
    border-radius: 4px;
}

.vdpb-capacity-full {
    color: #856404;
    background: #fff3cd;
    display: block;
    padding: 10px;
    border-radius: 4px;
}

/* Success State (form hidden) */
.vdpb-event-registration-form.vdpb-form-success {
    display: none;
}

.vdpb-success-message {
    background: #d4edda;
    color: #155724;
    padding: 30px;
    border-radius: 4px;
    text-align: center;
}

.vdpb-success-message h3 {
    margin: 0 0 10px 0;
    color: #155724;
}

/* Confirmation Messages (on redirect page) */
.vdpb-confirmation-message {
    background: #dff0d8;
    padding: 1em;
    border-left: 5px solid #3c763d;
    margin-bottom: 1.5em;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Design */
@media screen and (max-width: 600px) {
    .vdpb-event-registration-form {
        padding: 20px;
    }

    .vdpb-submit-button {
        width: 100%;
    }

    .vdpb-loading-indicator {
        display: block;
        margin-left: 0;
        margin-top: 10px;
        text-align: center;
    }
}

/* Form Validation Styles - only show after form submission attempt */
.vdpb-event-registration-form.vdpb-validated input:invalid,
.vdpb-event-registration-form.vdpb-validated select:invalid,
.vdpb-event-registration-form.vdpb-validated textarea:invalid {
    border-color: #c00;
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.2);
}

.vdpb-event-registration-form .vdpb-field-error {
    border-color: #c00 !important;
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.2) !important;
}

.vdpb-error-text {
    color: #c00;
    font-size: 13px;
    margin-top: 4px;
}

/* Shake Animation for Error Feedback */
@keyframes vdpb-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.vdpb-shake {
    animation: vdpb-shake 0.5s ease-in-out;
}

/* Ensure error message is visible */
.vdpb-form-messages:not(:empty) {
    display: block;
    margin-bottom: 20px;
}

/* Newsletter Form Styles (existing form compatibility) */
.vdpb-newsletter-form {
    max-width: 500px;
}

.vdpb-newsletter-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.vdpb-newsletter-form input[type="text"],
.vdpb-newsletter-form input[type="email"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc !important;
    border-radius: 4px;
}

.vdpb-newsletter-form input[type="submit"] {
    background: #0073aa;
    color: #fff;
    padding: 10px 25px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.vdpb-newsletter-form input[type="submit"]:hover {
    background: #005a87;
}

/* Event Cancellation Form */
.vdpb-event-cancellation-wrapper {
    max-width: 500px;
    margin: 0 auto;
}

.vdpb-event-cancellation-form {
    background: #fff;
    padding: 30px;
    border: 1px solid #e1e1e1 !important;
    border-radius: 4px;
}

.vdpb-cancellation-intro {
    margin-bottom: 20px;
    color: #666;
}

.vdpb-event-cancellation-form .vdpb-form-row {
    margin-bottom: 20px;
}

.vdpb-event-cancellation-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.vdpb-event-cancellation-form input[type="email"],
.vdpb-event-cancellation-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc !important;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
}

.vdpb-event-cancellation-form input[type="email"]:focus,
.vdpb-event-cancellation-form textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.vdpb-field-hint {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.vdpb-cancel-button {
    background: #dc3545 !important;
}

.vdpb-cancel-button:hover {
    background: #c82333 !important;
}

.vdpb-event-cancellation-form.vdpb-form-success {
    display: none;
}

.vdpb-event-cancellation-form .vdpb-field-error {
    border-color: #c00 !important;
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.2) !important;
}
