/**
 * Main.css - Styles for RPT Plugin Wizard
 */

/* The main container for the wizard */
.position-questions-wizard {
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    padding: 15px;
    border-radius: 5px;
}

/* Wizard Intro Text */
.wizard-intro {
    text-align: center;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.wizard-intro strong {
    font-size: 1.25rem;
    display: block;
    margin-bottom: 5px;
}

/* Wizard Steps (Sections) */
.form-section {
    display: none;
    /* Hide all steps by default */
    animation: fadeIn 0.5s;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.form-section.active-step {
    display: block;
    /* Show the active step */
}

.form-section h3 {
    color: #333;
    border-bottom: 2px solid #103795;
    /* WordPress blue */
    padding-bottom: 8px;
    font-size: 1.25rem;
    margin-bottom: 20px;
}

/* --- Spinner Styles --- */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    /* Light grey */
    border-top: 4px solid #103795;
    /* WordPress Blue */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* Small Spinner */
.loading-spinner-small {
    display: inline-block;
    vertical-align: middle;
    /* Aligns with label text */
    margin-left: 8px;
    /* Space from label */
    border: 2px solid #f3f3f3;
    border-top: 2px solid #103795;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Form Styling */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    font-weight: bold;
    color: #444;
}

.form-dashboard #position-questions .form-group label,
#position-questions .form-group label {
    margin-bottom: 0;
}

.form-group label .required {
    color: #D32F2F;
    font-weight: bold;
    margin-left: 2px;
}

.form-group .field-input input[type="text"],
.form-group .field-input textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Validation Styles */
.form-group .field-input .is-invalid {
    border-color: #D32F2F;
    box-shadow: 0 0 0 1px #D32F2F;
}

/* --- Radio Button / Chip Styling --- */

.form-group .radio-group {
    display: flex;
    /* Arrange chips in a row */
    flex-wrap: wrap;
    /* Allow them to wrap on mobile */
    gap: 8px;
    /* Spacing between chips */
    margin-top: 5px;
    /* Space from label */
}

.form-group .radio-group.is-invalid {
    /* Updated validation style for chips */
    padding: 10px;
    border: 1px solid #D32F2F;
    border-radius: 4px;
}

.form-group .radio-option {
    margin-bottom: 0;
    /* Handled by 'gap' now */
}

/* Hide the actual radio button */
.form-group .radio-option input[type="radio"] {
    opacity: 0;
    position: fixed;
    width: 0;
}

/* Style the label as the chip */
.form-group .radio-option label {
    display: inline-block;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 20px;
    /* Rounded chip shape */
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

/* Hover state */
.form-group .radio-option label:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

/* "Checked" state */
.form-group .radio-option input[type="radio"]:checked+label {
    background: #103795;
    /* WordPress Blue */
    color: #fff;
    border-color: #103795;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Focus state for accessibility */
.form-group .radio-option input[type="radio"]:focus+label {
    border-color: #103795;
    box-shadow: 0 0 0 2px #103795;
}

/* --- END OF CHIP STYLING --- */


/* Wizard Navigation */
.wizard-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.wizard-validation-error {
    width: 100%;
    text-align: center;
    color: #D32F2F;
    font-weight: bold;
    padding: 8px 0;
    min-height: 1.5em;
}

.step-indicator {
    font-size: 0.9em;
    color: #777;
    font-style: italic;
    order: 2;
}

.wizard-nav button {
    font-size: 16px;
    padding: 10px 25px;
    border: none;
    border-radius: 20px;
    color: #fff;
    background-color: #103795;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.wizard-nav .wizard-prev {
    order: 1;
}

.wizard-nav .wizard-next {
    order: 3;
}

.wizard-nav button:hover {
    background-color: #005a87;
}

.wizard-nav button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Responsive (Mobile-Ready) */
@media (max-width: 600px) {
    .wizard-nav {
        flex-direction: column-reverse;
    }

    .wizard-nav button {
        width: 100%;
        margin-bottom: 10px;
        order: 0;
    }

    .step-indicator {
        margin-bottom: 15px;
        align-self: center;
        order: 0;
    }

    .wizard-validation-error {
        order: 0;
    }
}

/* Animation for fading in steps */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#civi-global-form-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    padding: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    clear: both;
    display: block;
    /* Ensure it takes space */
}

.candidate-profile-display .block-archive-inner {
    margin-bottom: 30px;
}

.candidate-profile-display h4.title-candidate {
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    color: #0f3795;
}

.profile-list,
.civi-custom-answers-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-list li,
.civi-custom-answers-list li {
    margin-bottom: 10px;
}

.civi-custom-answers-list li {
    padding-bottom: 10px;
    border-bottom: 1px solid #f9f9f9;
    display: flex;
    flex-direction: column;
}

.civi-custom-answers-list li:last-child {
    border-bottom: none;
}

.civi-custom-answers-list strong {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.civi-custom-answers-list span.answer {
    color: #555;
}

.view-file {
    display: inline-block;
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    color: #333;
    width: fit-content;
    margin-top: 5px;
}

.view-file:hover {
    background: #e0e0e0;
}