.craue_formflow_buttons {
    overflow: hidden;
    padding: 2px;
    align-items: center;
    display: flex;
    justify-content: space-between;
    flex-flow: row-reverse;
    background-color: rgb(231 223 223);
    border-radius: 10px;
}

.craue_formflow_buttons button {
    float: right;
}

.btn-precedant, .btn-suivant, .btn-publier {
    width: 150px;
    height: 40px;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    border: none;
    margin: 2px;
    display: flex;
    align-items: center;
    justify-content: space-around; /* Align text and icons nicely */
    position: relative; /* Required for the hover animation */
    overflow: hidden; /* Hide the animated background edges */
    z-index: 1; /* Keep text and icon above hover background */
}

/* Base button colors */
.btn-precedant {
    padding-right: 4px;
    background-color: #086ec2; /* Red */
    border: 2px solid rgb(8, 147, 228);
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}

.btn-suivant {
    background-color: #770505; /* Dark red */
    border: 2px solid rgb(228, 34, 8);
    padding-left: 4px;
}

.btn-publier {
    padding-left: 4px;
    background-color: #28a745; /* Green */
    border: 2px solid rgb(6, 87, 60);
}

.btn-suivant, .btn-publier{
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
}

/* Hover Background Animation using ::after */
.btn-precedant::after, .btn-suivant::after, .btn-publier::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #111111; /* Hover background color */
    z-index: 0; /* Behind the text and icons */
    transition: top 0.4s ease-in-out;
}

/* Move hover background up on hover */
.btn-precedant:hover::after, .btn-suivant:hover::after, .btn-publier:hover::after {
    top: 0;
}

/* Icon BEFORE text for Précédent */
.btn-precedant::before {
    font-family: "Font Awesome 5 Free";
    content: "\f100"; /* FontAwesome double left arrow (<<) */
    font-weight: 900;
    margin-right: 5px; /* Space between icon and text */
    z-index: 1; /* Ensure icon is above hover background */
    position: relative; /* Keep icon isolated from hover animation */
    width: 50px;
    height: 50px;
    align-content: center;
    border: 4px double rgb(8, 147, 228);
    background-color: rgb(8, 147, 228);
    border-radius: 50%;
}

/* Icon AFTER text for Suivant */
.btn-suivant::before {
    font-family: "Font Awesome 5 Free";
    content: "\f101"; /* FontAwesome double right arrow (>>) */
    font-weight: 900;
    margin-left: 20px; /* Space between text and icon */
    z-index: 1; /* Ensure icon is above hover background */
    position: relative; /* Keep icon isolated from hover animation */
    border: 4px double #e60c0c;
    background-color: rgb(228, 34, 8);
}

.btn-precedant::before, .btn-suivant::before, .btn-publier::before {
    width: 50px;
    height: 50px;
    align-content: center;
    border-radius: 50%;
}

/* Icon AFTER text for Publier */
.btn-publier::before {
    font-family: "Font Awesome 5 Free";
    content: "\f058"; /* FontAwesome check-circle */
    font-weight: 900;
    margin-left: 30px; /* Space between text and icon */
    z-index: 1; /* Ensure icon is above hover background */
    position: relative; /* Keep icon isolated from hover animation */
    border: 4px double rgb(6,87,60);
    background-color: rgb(6, 87, 60);
}

/* Ensure both text and icons are visible above the hover background */
.btn-precedant span, .btn-suivant span, .btn-publier span {
    z-index: 1; /* Keep text and icons above hover background */
    position: relative; /* Isolate from hover animation */
}

/* Suivant Icon after Text Fix: Reverse the row order */
.btn-suivant, .btn-publier {
    flex-direction: row-reverse; /* Ensure icon is after text */
}

