.cost-notice {
    /* Styles defined inline in template for basic look */
    /* Additional styles if needed */
    font-size: 15px;
    line-height: 1.5;
}
.cost-notice strong {
     font-weight: 600;
}


/* --- Custom Modal Styles --- */
.iib-modal {
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    display: none; /* Hidden by default */
    justify-content: center; /* Center content horizontally */
    align-items: center; /* Center content vertically */
    padding: 20px; /* Add some padding around the modal */
    box-sizing: border-box; /* Include padding in width/height */
}

.iib-modal-content {
    background-color: #fefefe;
    padding: 30px; /* Increased padding */
    border: 1px solid #888;
    width: 90%; /* Responsive width */
    max-width: 500px; /* Max width */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative; /* For the close button */
    text-align: center; /* Center text inside modal */
    animation: slideInFromTop 0.3s ease-out; /* Simple animation */
}

@keyframes slideInFromTop {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.iib-modal-close {
    color: #aaa;
    float: right; /* Position top right */
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.iib-modal-close:hover,
.iib-modal-close:focus {
    color: #555;
    text-decoration: none;
    cursor: pointer;
}

.iib-modal-title {
    margin-top: 0;
    color: #e74c3c; /* Red color for error title */
    font-size: 22px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.iib-modal-body {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
    color: #555;
}

.iib-modal-footer {
    text-align: center;
}

.iib-modal-close-button {
     /* Match WordPress button-secondary style */
     display: inline-block;
     padding: 8px 15px;
     text-decoration: none;
     font-size: 14px;
     cursor: pointer;
     border: 1px solid #ccc;
     border-radius: 4px;
     background: #f0f0f0;
     color: #555;
     transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.iib-modal-close-button:hover {
    background: #e0e0e0;
    border-color: #bbb;
    color: #333;
}


/* --- Layout and Steps --- */
/* Main container */
.institutional-interview-container {
    max-width: 800px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    color: #333;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative; /* Needed for absolute positioning of global loader and step loaders */
}

/* Interview steps */
.interview-step {
    display: none;
    padding: 30px 40px;
    position: relative; /* Needed for step-specific loaders positioned absolutely inside */
    min-height: 300px; /* Give steps a minimum height so loader has space */
}

.interview-step.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* Headings */
.interview-heading {
    text-align: center;
    margin-bottom: 35px;
    position: relative; /* Allows absolute positioning of banks step loader message */
}

.interview-heading h2 {
    font-size: 26px;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 600;
}

.interview-heading p {
    font-size: 16px;
    color: #7f8c8d;
    line-height: 1.4;
}

/* Back link */
.iib-back-to-banks-link {
    display: inline-block;
    margin-bottom: 20px;
    text-decoration: none;
    font-weight: bold;
    color: #0073aa;
}
.iib-back-to-banks-link:before {
    content: "\2039"; /* Left angle quote */
    margin-right: 5px;
    font-size: 1.2em;
    line-height: 1;
    vertical-align: -1px;
}
.iib-back-to-banks-link:hover {
    text-decoration: underline;
}


/* --- Bank Selection Step --- */
.iib-step-banks .bank-list-container {
    margin-top: 20px;
}

.iib-step-banks .bank-list-container ul {
    list-style: none;
    padding: 0;
}

.iib-step-banks .bank-list-container li {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    margin-bottom: 10px;
    padding: 15px 20px;
    transition: background-color 0.2s ease;
}

.iib-step-banks .bank-list-container li:hover {
    background-color: #e9ecef;
}

.iib-step-banks .bank-list-container li a {
    text-decoration: none;
    font-size: 18px;
    color: #34495e;
    font-weight: 500;
    display: block; /* Make the whole area clickable */
}

/* Banks step specific loading message (within heading) */
.iib-step-banks .interview-heading .loading-message {
    position: absolute; /* Position relative to .interview-heading */
    top: 100%; /* Place below heading */
    left: 0;
    right: 0;
    margin-top: 10px; /* Spacing below heading */
    color: #555;
    font-size: 15px;
    font-weight: 500;
    display: none; /* Hidden by default, JS shows it */
}


/* --- Interview Step --- */
.iib-step-interview {
    position: relative; /* Already had this - good */
}

.question-container {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px 30px;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.question-text {
    font-size: 19px;
    line-height: 1.6;
    margin-bottom: 25px; /* Adjusted margin now that audio player is gone */
    color: #343a40;
    font-weight: 500;
}

/* Audio controls (Web Speech API) */
.audio-controls {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.start-recording,
.stop-recording {
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.2s;
    margin-right: 10px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.start-recording {
    background-color: #e74c3c;
    color: #fff;
}

.start-recording:hover:not(:disabled) {
    background-color: #c0392b;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.stop-recording {
    background-color: #7f8c8d;
    color: #fff;
}

.stop-recording:hover:not(:disabled) {
    background-color: #6c7a7d;
     box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}


.recording-indicator {
    display: none; /* JS controls visibility */
    margin-left: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    color: #e74c3c;
    font-weight: 500;
    font-size: 14px;
}

.recording-pulse {
    width: 10px;
    height: 10px;
    background-color: #e74c3c;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1.2s ease-out infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

/* Answer container */
.answer-container {
    margin-bottom: 25px;
}
.answer-container label {
    font-weight: 500;
    color: #34495e;
    font-size: 15px;
    margin-bottom: 8px;
    display: block;
}

textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dcdcdc;
    border-radius: 5px;
    font-size: 14px;
    color: #333;
    background-color: #fdfdfd;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
    min-height: 100px;
    resize: vertical;
}
textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    background-color: #fff;
}


/* Question actions */
.question-actions {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.generate-followup,
.next-question {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.2s;
    flex: 1;
    margin: 5px;
    min-width: 180px;
    text-align: center;
     box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.generate-followup {
    background-color: #9b59b6;
    color: #fff;
    margin-right: 10px;
}

.generate-followup:hover:not(:disabled) {
    background-color: #8e44ad;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.next-question {
    background-color: #3498db;
    color: #fff;
}

.next-question:hover:not(:disabled) {
    background-color: #2980b9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Consistent disabled style */
button:disabled {
    background-color: #bdc3c7 !important;
    color: #7f8c8d !important;
    cursor: not-allowed;
    box-shadow: none !important;
    opacity: 0.7;
}


/* --- Results Step --- */
.iib-step-results {
     position: relative; /* Needed for absolute positioning of loader */
}


.results-container {
     margin-bottom: 30px;
}

/* Analysis summary */
.analysis-summary {
    text-align: center;
    margin-bottom: 35px;
    padding: 25px 20px;
    background-color: #eaf5ff;
    border-radius: 8px;
    border: 1px solid #cce4ff;
}

.analysis-summary h3 {
     margin-bottom: 15px;
     color: #1b6aaa;
     font-size: 18px;
     font-weight: 600;
}

.score {
    font-size: 48px;
    font-weight: 700;
    color: #2ecc71;
    margin: 5px 0 10px 0;
    line-height: 1.1;
}

.score span {
    font-size: 20px;
    color: #7f8c8d;
    font-weight: 400;
    margin-left: 5px;
}

.rating {
    font-size: 18px;
    font-weight: 500;
    color: #3498db;
}

/* Performance metrics */
 .analysis-details {
     margin-bottom: 35px;
     padding: 25px;
     background-color: #f8f9fa;
     border-radius: 8px;
     border: 1px solid #e9ecef;
 }
 .analysis-details h3 {
     margin-bottom: 20px;
     color: #343a40;
     font-size: 18px;
     font-weight: 600;
     border-bottom: 1px solid #dee2e6;
     padding-bottom: 10px;
 }


.performance-metrics {
    /* Container for metrics */
}

.metric {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.metric-name {
    width: 150px;
    flex-shrink: 0;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
    padding-right: 15px;
}

.metric-bar {
    flex-grow: 1;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin: 0 10px;
    min-width: 100px;
}

.metric-progress {
    height: 100%;
    background-color: #3498db;
    border-radius: 5px;
    transition: width 0.5s ease-out;
}

.metric-score {
    width: 40px;
    text-align: right;
    font-weight: 600;
    font-size: 14px;
    color: #3498db;
    flex-shrink: 0;
}

/* Feedback content */
.analysis-feedback {
    margin-bottom: 35px;
    padding: 25px;
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
 .analysis-feedback h3, .questions-review h3, .improvement-suggestions h3 {
     margin-bottom: 20px;
     color: #343a40;
     font-size: 18px;
     font-weight: 600;
     border-bottom: 1px solid #dee2e6;
     padding-bottom: 10px;
 }


.feedback-content {
    line-height: 1.7;
    font-size: 15px;
    color: #495057;
}
.feedback-content br {
    margin-bottom: 0.5em;
}

/* Questions review */
.questions-review {
    margin-bottom: 35px;
}

.accordion {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
}

.accordion-item {
    border-bottom: 1px solid #dee2e6;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    padding: 15px 20px;
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative;
    color: #495057;
}

.accordion-header:hover {
    background-color: #e9ecef;
}

.accordion-header::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: #adb5bd;
    transition: transform 0.3s ease;
}

.accordion-header.active {
    background-color: #e2e6ea;
}


.accordion-header.active::after {
    content: '−';
     transform: translateY(-50%) rotate(180deg);
}

.accordion-content {
    display: none;
    padding: 20px;
    background-color: #fff;
    border-top: 1px solid #dee2e6;
}

.review-question,
.review-answer,
.review-followup-question,
.review-followup-answer,
.review-feedback {
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 14px;
    color: #495057;
}
.review-question strong,
.review-followup-question strong {
    color: #343a40;
    margin-right: 5px;
}

.review-answer, .review-followup-answer {
    padding-left: 20px;
    color: #6c757d;
}
.review-answer em, .review-followup-answer em {
    color: #adb5bd;
}


.review-feedback {
    padding: 15px;
    background-color: #f1f3f5;
    border-radius: 5px;
    border: 1px solid #e9ecef;
    margin-top: 15px;
    font-size: 14px;
}
.review-feedback strong {
    color: #343a40;
    display: block;
    margin-bottom: 5px;
}


/* Improvement suggestions */
.improvement-suggestions {
    padding: 25px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.improvement-suggestions ul {
    padding-left: 20px;
    margin: 0;
}

.improvement-suggestions li {
    margin-bottom: 12px;
    line-height: 1.6;
    font-size: 15px;
    color: #495057;
}
.improvement-suggestions li::marker {
    color: #3498db;
}

/* Interview actions (results page) */
.interview-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    flex-wrap: wrap;
}

.restart-interview,
.download-report {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.2s;
    margin: 5px;
    flex: 1;
    min-width: 180px;
    text-align: center;
     box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.restart-interview {
    background-color: #3498db;
    color: #fff;
}

.restart-interview:hover {
    background-color: #2980b9;
     box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.download-report {
    background-color: #2ecc71;
    color: #fff;
}

.download-report:hover {
    background-color: #27ae60;
     box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* --- Loading indicator styles --- */

/* Global loader (covers the whole container) */
.institutional-interview-container > .loading-indicator {
     display: none; /* Hidden by default */
     position: absolute;
     top: 0; left: 0; right: 0; bottom: 0;
     background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent overlay */
     z-index: 10;
     flex-direction: column;
     justify-content: center;
     align-items: center;
     text-align: center;
     padding: 30px 20px;
}

/* Step-specific loader (covers only the content within the step) */
/* Add these styles */
.interview-step > .loading-indicator {
    display: none; /* Hidden by default */
    position: absolute; /* Position relative to its parent .interview-step */
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent overlay */
    z-index: 5; /* Z-index below the global loader */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 30px 20px;
}


/* Spinner styling (applies to both global and step-specific loaders) */
/* Modified selector to be more general */
.loading-indicator .spinner {
    margin-top: 0; /* Reset margin */
    display: inline-block;
    width: 60px;
    height: 60px;
    border: 4px solid rgba(52, 152, 219, 0.2);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading message styling (applies to both global and step-specific loaders) */
/* Modified selector to be more general */
.loading-indicator .loading-message {
    margin-top: 20px; /* Adjusted spacing */
    color: #555;
    font-size: 15px;
    font-weight: 500;
}


/* Login Notice */
#iib-login-notice {
    /* Styled inline in template, or add styles here */
}


/* Responsive styles - Adjust as needed */
@media (max-width: 768px) {
    .institutional-interview-container {
        margin: 10px;
        box-shadow: none;
        border-radius: 0;
    }
    .interview-step {
        padding: 20px;
    }

    .question-actions, .interview-actions {
        flex-direction: column;
    }

    .generate-followup,
    .next-question,
    .restart-interview,
    .download-report {
        width: 100%;
        margin: 8px 0;
    }
     .generate-followup {
         margin-right: 0;
     }

     .metric {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 20px;
    }

    .metric-name {
        width: 100%;
        margin-bottom: 5px;
        padding-right: 0;
    }

    .metric-bar {
        width: 100%;
        margin: 5px 0;
    }

    .metric-score {
        width: auto;
        text-align: left;
        margin-top: 5px;
    }

     .accordion-header {
         padding-right: 45px;
     }
     .accordion-header::after {
         right: 15px;
     }

     /* Adjust step loader padding on smaller screens */
     .interview-step > .loading-indicator {
         padding: 20px;
     }

}

@media (max-width: 480px) {
     .interview-heading h2 {
         font-size: 22px;
     }
     .interview-heading p {
         font-size: 14px;
     }
     .question-text {
         font-size: 17px;
     }
     .score {
         font-size: 40px;
     }
     .score span {
         font-size: 18px;
     }
     .rating {
         font-size: 16px;
     }
      .audio-controls {
         justify-content: center;
     }
     .start-recording, .stop-recording {
         width: calc(50% - 10px);
         margin: 5px;
         text-align: center;
     }
     .recording-indicator {
         width: 100%;
         justify-content: center;
         margin-left: 0;
         margin-top: 10px;
     }
}