/* Styles for the Multi-Step Form Sections plugin */

/* Hide all sections by default (JS will show the current one) */
/* .before-group-row {
    display: none; 
} */
/* JS handles display:none initially, but this can be a fallback */

.msfs-active-section {
    display: block !important; /* Ensure the active section is visible */
    /* Add any specific styling for the active section if needed */
    /* animation: msfsFadeIn 0.5s; */
}

.msfs-navigation {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex; /* Use flexbox for button alignment */
    justify-content: space-between; /* Space out buttons */
    align-items: center;
}

.msfs-nav-button,
.msfs-submit-btn { /* Ensure submit button also gets some styling if we generate it */
    padding: 10px 20px;
    border: 1px solid #ccc;
    background-color: #f7f7f7;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1em;
    text-decoration: none; /* For button elements that might look like links */
    display: inline-block; /* Ensure proper spacing and sizing */
}

.msfs-nav-button:hover,
.msfs-submit-btn:hover {
    background-color: #e9e9e9;
    border-color: #bbb;
}

#msfs-prev-btn {
    /* Styles for previous button if needed */
}

#msfs-next-btn {
    /* Styles for next button if needed */
}

/* Style for the original submit button if it's moved */
.msfs-navigation input[type="submit"],
.msfs-navigation button[type="submit"] {
    /* Ensure it fits well within the nav container */
}


/* Optional: Style for invalid fields during validation */
.msfs-invalid-field {
    border-color: red !important;
    background-color: #fff5f5;
}

/* Optional: Fade-in animation for sections */
/* @keyframes msfsFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
} */

/* Styling for Category and Skill Selection Buttons (Revised for Layout) */
.cmb-type-taxonomy-multicheck .cmb-td,
.cmb-type-taxonomy-radio .cmb-td {
    /* This ensures the container of our button group behaves as a block */
    /* and doesn't get unexpectedly affected by parent flex/grid if our list becomes flex */
}

.cmb2-checkbox-list.msfs-button-group,
.cmb2-radio-list.msfs-button-group {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; /* This is key for the button layout */
    flex-wrap: wrap;
    gap: 10px; /* Spacing between buttons */
    /* Adding clear to prevent issues if parent elements use floats, though less common now */
    clear: both; 
}

.cmb2-checkbox-list.msfs-button-group li,
.cmb2-radio-list.msfs-button-group li {
    margin-bottom: 0; 
    flex-basis: calc(33.333% - 10px); /* Default to 3 per row, considering gap */
    flex-grow: 1; /* Allow items to grow if space allows */
    /* min-width: 120px; /* Optional: ensure buttons don't get too small */
    box-sizing: border-box; /* Important for padding/border in width calculation */
}

.cmb2-checkbox-list.msfs-button-group input[type="checkbox"],
.cmb2-checkbox-list.msfs-button-group input[type="radio"],
.cmb2-radio-list.msfs-button-group input[type="checkbox"],
.cmb2-radio-list.msfs-button-group input[type="radio"] {
    display: none; /* Hide the actual checkbox/radio */
    position: absolute; /* Keep them out of layout flow */
    opacity: 0;
}

.cmb2-checkbox-list.msfs-button-group label,
.cmb2-radio-list.msfs-button-group label {
    display: block; /* Make label a block to fill the li */
    padding: 15px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f7f7f7;
    color: #333;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    font-size: 0.95em;
    line-height: 1.4;
    width: 100%; 
    height: 100%; /* Make label fill the li height for consistent click area */
    box-sizing: border-box;
}

.cmb2-checkbox-list.msfs-button-group label:hover,
.cmb2-radio-list.msfs-button-group label:hover {
    background-color: #e9e9e9;
    border-color: #ccc;
}

/* Style for selected state */
.cmb2-checkbox-list.msfs-button-group input[type="checkbox"]:checked + label,
.cmb2-checkbox-list.msfs-button-group input[type="radio"]:checked + label,
.cmb2-radio-list.msfs-button-group input[type="checkbox"]:checked + label,
.cmb2-radio-list.msfs-button-group input[type="radio"]:checked + label {
    background-color: #0074aa00; 
    color: #fff;
    border-color: #43a062; 
    font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cmb2-checkbox-list.msfs-button-group li,
    .cmb2-radio-list.msfs-button-group li {
        flex-basis: calc(50% - 10px); /* 2 per row */
    }
}

@media (max-width: 480px) {
    .cmb2-checkbox-list.msfs-button-group li,
    .cmb2-radio-list.msfs-button-group li {
        flex-basis: 100%; /* 1 per row */
        /* Reset gap effect for single column or adjust margin if needed */
    }
    .cmb2-checkbox-list.msfs-button-group label,
    .cmb2-radio-list.msfs-button-group label {
        padding: 12px 8px;
        font-size: 0.9em;
    }
}

/* Message styling (if not already present) */
.msfs-message {
    padding: 10px;
    background-color: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-top: 15px;
    text-align: center;
    color: #555;
    clear: both; /* Ensure it clears any floats from button group if that was an issue */
}

/* Styling for invalid field groups (like categories if none selected) */
.msfs-invalid-group {
    border: 1px solid red !important; 
    padding: 10px; 
    border-radius: 4px; 
    margin-bottom: 10px; /* Add some space if it's around the group */
}

/* Styling for invalid field labels */
.msfs-invalid-label .cmb-th, 
.msfs-invalid-label .cmb-th .required { 
    color: red !important; 
}

/* Hide the "Select / Deselect All" button if you are using this button UI */
/* You can choose to keep it or hide it. If hiding: */
.cmb-type-taxonomy-multicheck .cmb-multicheck-toggle {
    /* display: none; */ /* Uncomment this line to hide "Select / Deselect All" */
}

