/**
 * Echo AI Custom Assessment Styles
 */

.echo-ai-custom-assessment-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.echo-ai-custom-assessment-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.echo-ai-custom-assessment-description {
    background: #f9f9f9;
    padding: 15px;
    border-left: 4px solid #97CA46;
    margin-bottom: 30px;
    line-height: 1.6;
}

.echo-ai-custom-assessment-error,
.echo-ai-custom-assessment-info {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
}

.echo-ai-custom-assessment-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.echo-ai-custom-assessment-info h3 {
    margin-top: 0;
    color: #856404;
}

/* Progress Bar */
.echo-ai-custom-progress {
    margin-bottom: 30px;
}

.echo-ai-custom-progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.echo-ai-custom-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #97CA46 0%, #7ab82d 100%);
    transition: width 0.3s ease;
    border-radius: 15px;
}

.echo-ai-custom-progress-text {
    text-align: center;
    margin-top: 10px;
    font-weight: 600;
    color: #555;
}

/* Form Container */
.echo-ai-custom-form-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Loading Overlay */
.echo-ai-custom-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.echo-ai-custom-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #97CA46;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: echo-ai-spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes echo-ai-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.echo-ai-custom-loading p {
    font-size: 18px;
    color: #555;
    font-weight: 600;
}

/* Results Container */
.echo-ai-custom-results {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.echo-ai-custom-results h3 {
    color: #97CA46;
    font-size: 24px;
    margin-bottom: 20px;
    border-bottom: 2px solid #97CA46;
    padding-bottom: 10px;
}

.echo-ai-custom-ai-response {
    background: #f9f9f9;
    padding: 20px;
    border-left: 4px solid #97CA46;
    margin-bottom: 30px;
    line-height: 1.8;
    color: #333;
}

.echo-ai-custom-ai-response h4 {
    color: #97CA46;
    margin-top: 20px;
    margin-bottom: 10px;
}

.echo-ai-custom-ai-response p {
    margin-bottom: 15px;
}

.echo-ai-custom-ai-response ul,
.echo-ai-custom-ai-response ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.echo-ai-custom-ai-response li {
    margin-bottom: 8px;
}

/* Framework Scores */
.echo-ai-custom-framework-scores {
    margin-bottom: 30px;
}

.echo-ai-custom-framework-scores h4 {
    color: #333;
    font-size: 20px;
    margin-bottom: 15px;
}

.echo-ai-framework-scores-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.echo-ai-framework-scores-list li {
    background: #f9f9f9;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    border-left: 4px solid #97CA46;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.echo-ai-framework-scores-list li strong {
    color: #333;
}

/* Actions */
.echo-ai-custom-actions {
    text-align: center;
    margin-top: 30px;
}

.echo-ai-custom-download-pdf {
    background: #97CA46;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s ease;
}

.echo-ai-custom-download-pdf:hover {
    background: #7ab82d;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .echo-ai-custom-assessment-wrapper {
        padding: 10px;
    }

    .echo-ai-custom-assessment-title {
        font-size: 22px;
    }

    .echo-ai-custom-form-container,
    .echo-ai-custom-results {
        padding: 15px;
    }

    .echo-ai-framework-scores-list li {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Inline Results (after form submission) */
/* .echo-ai-submission-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 20px;
    border-radius: 4px;
    margin: 20px 0;
} */
.echo-ai-submission-success {
  display: none !important;
}
.echo-ai-inline-response {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.echo-ai-inline-response > h4 {
    margin-top: 0;
    color: #97CA46;
    font-size: 22px;
    border-bottom: 3px solid #97CA46;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.ai-response-content {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ai-response-content p {
    margin-bottom: 18px;
    line-height: 1.8;
    color: #333;
    text-align: justify;
}

.ai-response-content p:last-child {
    margin-bottom: 0;
}

.ai-response-content strong {
    color: #155724;
    font-weight: 600;
}

.ai-response-content em {
    font-style: italic;
    color: #555;
}

.ai-response-content h3,
.ai-response-content h4,
.ai-response-content h5 {
    color: #97CA46;
    margin-top: 25px;
    margin-bottom: 12px;
    font-weight: 600;
}

.ai-response-content h3 {
    font-size: 20px;
    border-bottom: 2px solid #97CA46;
    padding-bottom: 8px;
}

.ai-response-content h4 {
    font-size: 18px;
}

.ai-response-content h4.emoji-header {
    font-size: 19px;
    color: #333;
    margin-top: 30px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-left: 4px solid #97CA46;
    border-radius: 4px;
}

.ai-response-content h5 {
    font-size: 16px;
}

.ai-response-content ul,
.ai-response-content ol {
    margin-left: 30px;
    margin-bottom: 18px;
    line-height: 1.8;
}

.ai-response-content li {
    margin-bottom: 10px;
    color: #333;
}

.ai-response-content ul li {
    list-style-type: disc;
}

.ai-response-content ol li {
    list-style-type: decimal;
}

/* Inline Scores */
.echo-ai-inline-scores {
    background: white;
    padding: 20px;
    border-radius: 4px;
    margin: 20px 0;
    border: 1px solid #ddd;
}

.echo-ai-inline-scores h4 {
    margin-top: 0;
    color: #97CA46;
    font-size: 20px;
    border-bottom: 2px solid #97CA46;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.echo-ai-inline-scores ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.echo-ai-inline-scores li {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.echo-ai-inline-scores strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-size: 16px;
}

/* Loading Spinner in Success Message */
.echo-ai-loading-spinner {
    text-align: center;
    padding: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hide form after submission */
.echo-ai-form-hidden {
    display: none !important;
}

/* Hide Fluent Forms and related elements when results are showing */
.echo-ai-submission-success ~ .echo-ai-custom-form-container,
.echo-ai-submission-success ~ .echo-ai-custom-progress,
.echo-ai-submission-success ~ .fluentform {
    display: none !important;
}

/* Also hide when wrapper has results class */
.echo-ai-results-showing .echo-ai-custom-form-container,
.echo-ai-results-showing .echo-ai-custom-progress,
.echo-ai-results-showing .fluentform,
.echo-ai-results-showing form.fluentform,
.echo-ai-results-showing .ff-message-success,
.echo-ai-results-showing .ff-el-is-success {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* WRAPPER MESSAGE BOX */
.echo-ai-custom-assessment-info {
    background: #FAF7EF; /* soft beige */
    border: 1px solid #E5E1D6;
    padding: 24px;
    border-radius: 12px;
    margin: 20px 0 40px;
    font-family: 'Work Sans', sans-serif;
}

/* TITLE */
.echo-ai-custom-assessment-info h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    color: #111111; /* charcoal black */
    font-family: 'Avenir', sans-serif;
}

/* DESCRIPTION TEXT */
.echo-ai-custom-assessment-info p {
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
    color: #333333;
    font-family: 'Work Sans', sans-serif;
}

.echo-ai-custom-assessment-info {
    position: relative;
    padding-left: 56px;
}

.echo-ai-custom-assessment-info::before {
    content: "!";
    position: absolute;
    left: 20px;
    top: 22px;
    background: #96CA42;
    color: white;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Avenir, sans-serif;
}

button.echo-ai-generate-pdf-btn { border-radius: var(--bb-button-radius); }