/* Main container */
.interview-preparation-container {
    max-width: 800px;
    margin: 20px auto; /* Added top/bottom margin */
    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;
}

/* Interview steps */
.interview-step {
    display: none;
    padding: 30px 40px; /* Increased padding */
}

.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; /* Increased margin */
}

.interview-heading h2 {
    font-size: 26px; /* Slightly smaller */
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 600; /* Bolder */
}

.interview-heading p {
    font-size: 16px;
    color: #7f8c8d;
    line-height: 1.4;
}

/* Form styles */
.form-group {
    margin-bottom: 25px; /* Increased spacing */
}

.form-group label {
    display: block;
    margin-bottom: 8px; /* Increased spacing */
    font-weight: 500;
    color: #34495e;
    font-size: 15px;
}

input[type="text"],
textarea,
select {
    width: 100%;
    padding: 12px 15px; /* Adjusted padding */
    border: 1px solid #dcdcdc; /* Lighter border */
    border-radius: 5px; /* Slightly more rounded */
    font-size: 14px;
    color: #333;
    background-color: #fdfdfd;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box; /* Include padding in width */
}

textarea {
    min-height: 100px; /* Minimum height */
    resize: vertical; /* Allow vertical resize */
}


input[type="text"]:focus,
textarea:focus,
select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15); /* Softer focus ring */
    background-color: #fff;
}

/* File upload */
.file-upload-wrapper {
    position: relative;
    margin-top: 5px;
    display: flex; /* Align items */
    align-items: center;
}

/* Hide the default file input visually */
input[type="file"] {
    position: absolute;
    width: 1px; /* Use 1px instead of 0.1px for better compatibility */
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
 }


.file-upload-label {
    display: inline-block;
    padding: 10px 18px; /* Adjusted padding */
    background-color: #3498db;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.3s;
    margin-right: 10px; /* Space between button and text */
}

.file-upload-label:hover {
    background-color: #2980b9;
}

.file-upload-icon { /* Using Dashicons */
    font-size: 18px;
    line-height: 1;
    margin-right: 8px;
    vertical-align: middle; /* Align icon */
    display: inline-block;
}


.selected-file {
    display: inline-block;
    font-size: 14px;
    color: #555; /* Darker text */
    font-style: italic;
}

/* Submit button */
.submit-button {
    display: block;
    width: 100%;
    padding: 14px;
    background-color: #2ecc71;
    color: #fff;
    border: none;
    border-radius: 5px; /* Match input radius */
    font-size: 16px;
    font-weight: 600; /* Bolder */
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.submit-button:hover {
    background-color: #27ae60;
     box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.submit-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    box-shadow: none;
}

/* Loading indicator */
/* Loading indicator */
.loading-indicator {
    display: none; /* Hidden by default */
    text-align: center;
    padding: 30px 20px;
    position: absolute; /* Position over content */
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent overlay */
    z-index: 10;
    /* REMOVE or COMMENT OUT the conflicting display: flex here */
    /* display: flex; */
    flex-direction: column; /* Keep these flex properties for when it's shown */
    justify-content: center;
    align-items: center;
    /* You can optionally add display: none again at the end for absolute certainty */
}

.spinner {
    margin-top: 100px;
    display: inline-block;
    width: 60px; /* Smaller spinner */
    height: 60px;
    border: 4px solid rgba(52, 152, 219, 0.2); /* Lighter border */
    border-radius: 50%;
    border-top-color: #3498db; /* Primary color */
    animation: spin 0.8s linear infinite; /* Faster spin */
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-indicator p {
    margin-top: 100px; /* Increased space */
    color: #555; /* Darker text */
    font-size: 15px;
    font-weight: 500;
}

/* --- Question Step --- */
.interview-step-questions {
    position: relative; /* Needed for absolute positioning of loader */
}


.question-container {
    background-color: #f8f9fa; /* Lighter background */
    border: 1px solid #e9ecef; /* Subtle border */
    border-radius: 8px;
    padding: 25px 30px; /* Increased padding */
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.question-text {
    font-size: 19px; /* Slightly larger */
    line-height: 1.6; /* Better readability */
    margin-bottom: 25px;
    color: #343a40; /* Darker text */
    font-weight: 500; /* Semi-bold */
}

/* --- ADDED: Styles for Audio Controls (from Institutional) --- */
.audio-controls {
    display: flex;
    align-items: center;
    margin-top: 15px; /* Add some space above */
    margin-bottom: 20px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.start-recording,
.stop-recording {
    padding: 10px 18px; /* Consistent padding */
    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; /* Spacing for wrapping */
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.start-recording {
    background-color: #e74c3c; /* Red */
    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; /* Grey */
    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; /* Hidden initially by JS */
    margin-left: 15px;
    margin-bottom: 10px; /* Spacing for wrapping */
    display: flex; /* Will be shown by JS */
    align-items: center;
    color: #e74c3c; /* Match start button */
    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; /* Smoother pulse */
}

@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; }
}
/* --- END ADDED: Audio Controls --- */


/* --- ADDED: Custom Modal Styles (from Institutional, adapted IDs) --- */
.ipa-modal { /* Use new ID prefix */
    position: fixed;
    z-index: 1001; /* Ensure it's above other elements */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5); /* Slightly darker overlay */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.ipa-modal-content {
    background-color: #fefefe;
    padding: 30px;
    border: 1px solid #ddd; /* Lighter border */
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    position: relative;
    text-align: center;
    animation: slideInFromTop 0.3s ease-out;
}

@keyframes slideInFromTop {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.ipa-modal-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1; /* Prevent extra space */
}

.ipa-modal-close:hover,
.ipa-modal-close:focus {
    color: #555;
    text-decoration: none;
}

.ipa-modal-title {
    margin-top: 0;
    color: #d35400; /* Orange/Red for error/warning */
    font-size: 22px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    font-weight: 600;
}

.ipa-modal-body {
    margin-bottom: 25px; /* More space */
    font-size: 16px;
    line-height: 1.6; /* Better readability */
    color: #555;
}
/* Allow links inside modal body */
.ipa-modal-body a {
    color: #0073aa; /* Standard WP link blue */
    text-decoration: underline;
}
.ipa-modal-body a:hover {
    color: #00a0d2;
}


.ipa-modal-footer {
    text-align: center;
}

.ipa-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;
}
.ipa-modal-close-button:hover {
    background: #e0e0e0;
    border-color: #bbb;
    color: #333;
}
/* --- END ADDED: Custom Modal Styles --- */

/* --- ADDED: Wallet Cost Notice Style --- */
.cost-notice {
    /* Styles defined inline in template for basic look */
    /* Additional styles if needed */
    font-size: 14px; /* Slightly smaller */
    line-height: 1.5;
}
.cost-notice strong {
     font-weight: 600;
}
.cost-notice .dashicons {
    vertical-align: middle;
    font-size: 18px;
    line-height: 1;
}
/* --- END ADDED --- */

/* Minor Adjustments to existing styles if needed */
/* Example: Ensure question step loader doesn't overlap buttons */
.interview-step-questions .loading-indicator {
    /* Add styles if needed, e.g., ensure it has a background */
     background-color: rgba(255, 255, 255, 0.9);
}
.interview-step-results .loading-indicator {
    background-color: rgba(255, 255, 255, 0.9);
}
.interview-step-form .loading-indicator {
     background-color: rgba(255, 255, 255, 0.9);
}



/* Answer container */
.answer-container {
    margin-bottom: 25px;
}
.answer-container label {
    font-weight: 500;
    color: #34495e;
    font-size: 15px;
    margin-bottom: 8px;
    display: block;
}


/* Question actions */
.question-actions {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap; /* Allow wrapping */
}

.generate-followup,
.next-question {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-weight: 600; /* Bolder */
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.2s;
    flex: 1; /* Try to take equal space */
    margin: 5px; /* Spacing when wrapped */
    min-width: 180px; /* Minimum width */
    text-align: center;
     box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.generate-followup {
    background-color: #9b59b6; /* Purple */
    color: #fff;
    margin-right: 10px; /* Space between buttons */
}

.generate-followup:hover:not(:disabled) {
    background-color: #8e44ad;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.next-question {
    background-color: #3498db; /* Blue */
    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; /* Consistent disabled grey */
    color: #7f8c8d !important;
    cursor: not-allowed;
    box-shadow: none !important;
    opacity: 0.7;
}


/* --- Results Step --- */
.interview-step-results {
     position: relative; /* Needed for absolute positioning of loader */
}


.results-container {
    /* Styles applied dynamically by JS, base container has no specific style */
     margin-bottom: 30px;
}

/* Analysis summary */
.analysis-summary {
    text-align: center;
    margin-bottom: 35px;
    padding: 25px 20px;
    background-color: #eaf5ff; /* Light blue background */
    border-radius: 8px;
    border: 1px solid #cce4ff; /* Subtle border */
}

.analysis-summary h3 {
     margin-bottom: 15px;
     color: #1b6aaa;
     font-size: 18px;
     font-weight: 600;
}

.score {
    font-size: 48px; /* Slightly smaller */
    font-weight: 700;
    color: #2ecc71; /* Green score */
    margin: 5px 0 10px 0; /* Adjusted margin */
    line-height: 1.1;
}

.score span {
    font-size: 20px; /* Smaller '/100' */
    color: #7f8c8d; /* Grey */
    font-weight: 400;
    margin-left: 5px;
}

.rating {
    font-size: 18px; /* Slightly smaller */
    font-weight: 500;
    color: #3498db; /* Blue rating */
}

/* 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; /* Allow wrapping */
}

.metric-name {
    width: 150px; /* Fixed width for name */
    flex-shrink: 0; /* Prevent shrinking */
    font-weight: 500;
    color: #495057; /* Darker grey */
    font-size: 14px;
    padding-right: 15px;
}

.metric-bar {
    flex-grow: 1; /* Take remaining space */
    height: 10px; /* Thinner bar */
    background-color: #e9ecef; /* Lighter grey background */
    border-radius: 5px;
    overflow: hidden;
    margin: 0 10px;
    min-width: 100px; /* Ensure bar is visible */
}

.metric-progress {
    height: 100%;
    background-color: #3498db; /* Blue progress */
    border-radius: 5px;
    transition: width 0.5s ease-out; /* Animate progress change */
}

.metric-score {
    width: 40px; /* Fixed width for score */
    text-align: right;
    font-weight: 600; /* Bolder score */
    font-size: 14px;
    color: #3498db; /* Blue score */
    flex-shrink: 0; /* Prevent shrinking */
}

/* Feedback content */
.analysis-feedback {
    margin-bottom: 35px;
    padding: 25px;
    background-color: #fff; /* White background */
    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; /* Increased line height */
    font-size: 15px;
    color: #495057;
}
.feedback-content br {
    margin-bottom: 0.5em; /* Space after line breaks */
}

/* Questions review */
.questions-review {
    margin-bottom: 35px;
}

.accordion {
    border: 1px solid #dee2e6; /* Match other borders */
    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; /* More padding */
    background-color: #f8f9fa; /* Light grey header */
    font-weight: 600; /* Bolder */
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative; /* For pseudo-element */
    color: #495057;
}

.accordion-header:hover {
    background-color: #e9ecef; /* Darker hover */
}

.accordion-header::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: #adb5bd; /* Lighter grey icon */
    transition: transform 0.3s ease;
}

.accordion-header.active {
    background-color: #e2e6ea; /* Slightly darker active header */
}


.accordion-header.active::after {
    content: '−'; /* Minus sign */
     transform: translateY(-50%) rotate(180deg); /* Rotate plus */
}

.accordion-content {
    display: none; /* Hidden by default */
    padding: 20px; /* More padding */
    background-color: #fff;
    border-top: 1px solid #dee2e6; /* Separator line */
}

.review-question,
.review-answer,
.review-followup-question,
.review-followup-answer,
.review-feedback {
    margin-bottom: 15px; /* Increased spacing */
    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; /* Indent answers */
    color: #6c757d; /* Lighter text for answers */
}
.review-answer em, .review-followup-answer em {
    color: #adb5bd;
}


.review-feedback {
    padding: 15px; /* More padding */
    background-color: #f1f3f5; /* Very light grey */
    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; /* Match details background */
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.improvement-suggestions ul {
    padding-left: 20px;
    margin: 0; /* Reset default margin */
}

.improvement-suggestions li {
    margin-bottom: 12px; /* Spacing between items */
    line-height: 1.6;
    font-size: 15px;
    color: #495057;
}
.improvement-suggestions li::marker {
    color: #3498db; /* Blue marker */
}

/* Interview actions (results page) */
.interview-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6; /* Separator */
    flex-wrap: wrap;
}

.restart-interview,
.download-report {
    padding: 12px 25px; /* More horizontal padding */
    border: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.2s;
    margin: 5px; /* Spacing */
    flex: 1;
    min-width: 180px;
    text-align: center;
     box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.restart-interview {
    background-color: #3498db; /* Blue */
    color: #fff;
}

.restart-interview:hover {
    background-color: #2980b9;
     box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.download-report {
    background-color: #2ecc71; /* Green */
    color: #fff;
}

.download-report:hover {
    background-color: #27ae60;
     box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Responsive styles */
@media (max-width: 768px) {
    .interview-preparation-container {
        margin: 10px;
        box-shadow: none;
        border-radius: 0;
    }
    .interview-step {
        padding: 20px;
    }

    .question-actions, .interview-actions {
        flex-direction: column; /* Stack buttons */
    }

    .generate-followup,
    .next-question,
    .restart-interview,
    .download-report {
        width: 100%; /* Full width */
        margin: 8px 0; /* Vertical spacing */
    }
     .generate-followup {
         margin-right: 0;
     }

     .metric {
        flex-direction: column;
        align-items: flex-start; /* Align items left */
        margin-bottom: 20px;
    }

    .metric-name {
        width: 100%; /* Full width */
        margin-bottom: 5px;
        padding-right: 0;
    }

    .metric-bar {
        width: 100%;
        margin: 5px 0;
    }

    .metric-score {
        width: auto; /* Auto width */
        text-align: left;
        margin-top: 5px;
    }

     .accordion-header {
         padding-right: 45px; /* Ensure space for icon */
     }
     .accordion-header::after {
         right: 15px; /* Adjust icon position */
     }

}

@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; /* Center buttons */
     }
     .start-recording, .stop-recording {
         width: calc(50% - 10px); /* Two buttons per row */
         margin: 5px;
         text-align: center;
     }
     .recording-indicator {
         width: 100%;
         justify-content: center;
         margin-left: 0;
         margin-top: 10px;
     }
}