.koala-form-container {
    position: relative;
}
.koala-form-float-form {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 600px;
    background: #fff;
    padding: 20px;
    border: 1px solid #a8bdb5;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: none;
    z-index: 999!important; /* Base z-index for inactive forms */
}
.koala-form-float-form.active {
    display: block;
    z-index: 1000!important; /* Increased for active forms to ensure above buttons */
}	
.koala-form-float-form input,
.koala-form-float-form select,
.koala-form-float-form textarea {
    padding: 10px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
}
.edit-form-button {
    background: #df6200;
    color: #fff;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 10px;
    z-index: 10!important; /* Lower than active forms to prevent overlap */
}
.edit-form-button:hover {
    background: #005433;
}
.acf-button,
.cancel-form-button {
    padding: 10px 20px !important;
    font-size: 16px;
    border: none;
    cursor: pointer;
}
.acf-button {
    background: #df6200 !important;
    color: #fff !important;
}
.acf-button:hover {
    background: #005433 !important;
}
.cancel-form-button {
    background: #4b7592;
    color: white;
    margin-left: 10px;
}
.cancel-form-button:hover {
    background: rgba(52,81,102,0.95);
}
.acf-form-submit {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}
.acf-fields > .acf-field:last-child {
    margin-bottom: 30px !important;
}
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(52,81,102,0.25);
    border-radius: 4px;
    display: none;
    position: relative;
}
.success-message .close-button {
    position: absolute;
    right: 10px;
    top: 10px;
    cursor: pointer;
    font-size: 16px;
    color: #155724;
}
.acf-field[data-name="medical_record_number"] {
    display: none;
}/* Non-floating styles for koala_rescue_form */
.koala-rescue-form {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    display: none;
}
.koala-rescue-form.active {
    display: block;
}
.koala-rescue-form .acf-form-submit {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
}
.koala-rescue-form .acf-form-submit button {
    flex: 1 1 45%;
    min-width: 200px;
    padding: 10px 0;
    font-size: 16px;
}
.koala-rescue-form .acf-button {
    background: #df6200;
    color: #fff;
    border: none;
}
.koala-rescue-form .acf-button:hover {
    background: #004226;
}
.koala-rescue-form .cancel-form-button {
    background: #6c757d;
    color: #fff;
    border: none;
}
.koala-rescue-form .cancel-form-button:hover {
    background: #343a40;
}
/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .edit-form-button {
        z-index: 10 !important;
        position: relative;
    }
    .koala-form-float-form.active {
        z-index: 1000 !important;
        max-height: 85vh !important; /* Added: Limit height for scrolling */
        overflow-y: auto !important; /* Added: Enable scrolling */
        -webkit-overflow-scrolling: touch !important; /* Added: Smooth iOS scrolling */
    }
    .koala-form-float-form .acf-form {
        max-height: 100% !important; /* Added: Ensure form content scrolls */
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .koala-form-container {
        padding-bottom: 20px;
    }
}