/* Add this CSS to your styles.css file */
.job-details {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    z-index: 999999;
    overflow-y: auto;
}

.job-details.open {
    right: 0;
}

.close-btn {
    position: sticky;
    top: 0;
    right: 0;
    padding: 10px 20px;
    background: #333;
    color: #fff;
    border: none;
    cursor: pointer;
    margin-bottom: 20px;
    z-index: 1000000;
}

#job-content {
    padding: 20px;
}

.asc-button-container {
    margin: 20px 0;
    text-align: center;
}

.asc-application-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
}

.asc-application-btn:hover {
    background: #005177;
    color: #fff;
}

/* Application Panel Styles */
.application-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    z-index: 999999;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.application-panel.open {
    right: 0;
}

.application-panel .application-content {
    padding-top: 20px;
}

/* Ensure forms don't overflow */
.application-panel .frm_forms {
    max-width: 100%;
    box-sizing: border-box;
    min-height: 400px; /* Keep form visible during AJAX */
}

/* Style form elements */
.application-panel .frm_forms input[type="text"],
.application-panel .frm_forms input[type="email"],
.application-panel .frm_forms textarea,
.application-panel .frm_forms select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Forms container */
#application-forms-container {
    position: relative;
}

.frm_page {
    display: none;
}

.frm_page[data-page="1"] {
    display: block;
}

.custom-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
}

.custom-page-nav {
    padding: 8px 16px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.custom-page-nav:hover {
    background: #005177;
}

.custom-page-nav:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.page-indicator {
    font-size: 14px;
    color: #666;
}

.frm_error {
    border-color: #dc3232 !important;
}

.frm_error_message {
    color: #dc3232;
    font-size: 12px;
    margin-top: 5px;
}

/* Hide Formidable's default navigation */
.frm_rootline_group,
.frm_next_page,
.frm_prev_page {
    display: none !important;
}

/* Form specific styles */
.jlpd-form-wrapper {
    position: relative;
    padding-top: 20px;
}

.jlpd-form-wrapper .frm_forms {
    margin: 0;
    padding: 0;
}

.jlpd-form-wrapper .frm_form_field {
    margin-bottom: 15px;
}

/* Ensure form fields don't overflow */
.jlpd-form-wrapper input[type="text"],
.jlpd-form-wrapper input[type="email"],
.jlpd-form-wrapper textarea,
.jlpd-form-wrapper select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Fix for any form elements that might be positioned incorrectly */
.jlpd-form-wrapper .frm_form_field.frm_left_container,
.jlpd-form-wrapper .frm_form_field.frm_right_container,
.jlpd-form-wrapper .frm_form_field.frm_first,
.jlpd-form-wrapper .frm_form_field.frm_last {
    float: none;
    width: 100%;
}

/* Ensure submit button is visible */
.jlpd-form-wrapper .frm_submit {
    clear: both;
    margin-top: 20px;
}

/* Fix for any absolute positioned elements */
.jlpd-form-wrapper .frm_error_style,
.jlpd-form-wrapper .frm_message {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
}

.loading {
    text-align: center;
    padding: 20px;
    font-size: 16px;
}

.error {
    color: #dc3232;
    text-align: center;
    padding: 20px;
    font-size: 16px;
}

@media screen and (max-width: 768px) {
    .job-details,
    .application-panel {
        width: 95%;
    }
}