/* ==================== MAIN CONTAINER ==================== */
.sa-assessment-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #333;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ==================== PROGRESS BAR ==================== */
.sa-progress-container {
    margin-bottom: 30px;
}

.sa-progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.sa-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4dabf7, #339af0);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.sa-progress-text {
    text-align: center;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

/* ==================== HEADER ==================== */
.sa-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f3f5;
}

.sa-header h1 {
    color: #2b2d42;
    font-size: 32px;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.sa-subtitle {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

/* ==================== CATEGORY HEADER ==================== */
.sa-category-header {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #339af0;
}

.sa-category-header h2 {
    color: #2b2d42;
    font-size: 24px;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sa-category-description {
    color: #495057;
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

/* ==================== QUESTIONS ==================== */
.sa-questions {
    margin-bottom: 40px;
}

.sa-question-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.sa-question-item:hover {
    border-color: #339af0;
    box-shadow: 0 2px 8px rgba(51, 154, 240, 0.1);
}

.sa-question-text {
    font-size: 18px;
    font-weight: 600;
    color: #2b2d42;
    margin-bottom: 20px;
    line-height: 1.4;
}

.sa-question-number {
    background: #339af0;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 14px;
    font-weight: 600;
}

/* ==================== OPTIONS ==================== */
.sa-options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sa-option {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.sa-option:hover {
    background: #edf2ff;
    border-color: #bac8ff;
}

.sa-option.selected {
    background: #edf2ff;
    border-color: #339af0;
    box-shadow: 0 0 0 3px rgba(51, 154, 240, 0.1);
}

.sa-option-selector {
    width: 20px;
    height: 20px;
    border: 2px solid #adb5bd;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
}

.sa-option.selected .sa-option-selector {
    border-color: #339af0;
    background: #339af0;
}

.sa-option.selected .sa-option-selector::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.sa-option-text {
    font-size: 16px;
    color: #495057;
    line-height: 1.4;
}

/* ==================== TEXT INPUT ==================== */
.sa-text-input-container {
    width: 100%;
}

.sa-text-input {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.sa-text-input:focus {
    outline: none;
    border-color: #339af0;
    background: white;
    box-shadow: 0 0 0 3px rgba(51, 154, 240, 0.1);
}

.sa-text-hint {
    font-size: 14px;
    color: #6c757d;
    margin-top: 8px;
    font-style: italic;
}

/* ==================== NAVIGATION BUTTONS ==================== */
.sa-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid #e9ecef;
    margin-top: 20px;
}

.sa-btn {
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sa-btn-prev, .sa-btn-back {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
}

.sa-btn-prev:hover, .sa-btn-back:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.sa-btn-next, .sa-btn-submit, .sa-btn-primary {
    background: linear-gradient(135deg, #4dabf7, #339af0);
    color: white;
}

.sa-btn-next:hover, .sa-btn-submit:hover, .sa-btn-primary:hover {
    background: linear-gradient(135deg, #339af0, #228be6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(51, 154, 240, 0.2);
}

.sa-btn-outline {
    background: white;
    color: #339af0;
    border: 2px solid #339af0;
}

.sa-btn-outline:hover {
    background: #f0f7ff;
}

.sa-btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
}

.sa-btn-secondary:hover {
    background: #e9ecef;
}

/* ==================== WHATSAPP BUTTON ==================== */
.sa-btn-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border: none;
}

.sa-btn-whatsapp:hover {
    background: linear-gradient(135deg, #1ebe5d, #0d7c6d);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}

.sa-btn-whatsapp:active {
    background: linear-gradient(135deg, #1a9f50, #0b6b5e);
    transform: translateY(0);
}

.sa-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ==================== EMAIL FORM ==================== */
.sa-email-container {
    animation: fadeIn 0.5s ease;
}

.sa-email-form {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

/* ==================== FORM FIELDS ==================== */
.sa-form-fields {
    max-width: 400px;
    margin: 0 auto 20px auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sa-input-group {
    text-align: left;
}

.sa-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 15px;
}

.sa-input-group .sa-text-input {
    text-align: left;
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
    background: #fff;
}

.sa-input-group .sa-text-input:focus {
    border-color: #339af0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(51, 154, 240, 0.1);
}

.sa-email-form h2 {
    color: #2b2d42;
    font-size: 28px;
    margin: 0 0 16px 0;
}

.sa-email-description {
    color: #495057;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.sa-email-input-group {
    max-width: 400px;
    margin: 0 auto 20px auto;
}

.sa-email-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.sa-email-input:focus {
    outline: none;
    border-color: #339af0;
    box-shadow: 0 0 0 3px rgba(51, 154, 240, 0.1);
}

.sa-error-message {
    color: #e03131;
    font-size: 14px;
    margin-top: 8px;
    text-align: left;
}

.sa-email-consent {
    margin-bottom: 30px;
}

.sa-checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #495057;
    font-size: 15px;
    cursor: pointer;
}

.sa-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.sa-email-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.sa-email-note {
    color: #6c757d;
    font-size: 14px;
}

/* ==================== RESULTS ==================== */
.sa-results-container {
    animation: fadeIn 0.5s ease;
}

.sa-results {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.sa-results-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #4dabf7, #339af0);
    color: white;
    margin-bottom: 30px;
}

.sa-results-header h2 {
    font-size: 32px;
    margin: 0 0 10px 0;
}

.sa-results-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin: 0 0 8px 0;
}

.sa-results-date {
    font-size: 14px;
    opacity: 0.8;
    margin: 0;
}

.sa-results-content {
    padding: 0 30px 30px 30px;
}

.sa-analysis-content {
    font-size: 16px;
    line-height: 1.7;
    color: #495057;
    margin-bottom: 30px;
}

.sa-analysis-content h2 {
    color: #2b2d42;
    font-size: 24px;
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f3f5;
}

.sa-analysis-content h3 {
    color: #2b2d42;
    font-size: 20px;
    margin: 25px 0 12px 0;
}

.sa-summary-box {
    background: #f0f7ff;
    border-left: 4px solid #339af0;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    border: 1px solid #a5d8ff;
}

.sa-summary-box h4 {
    color: #2b2d42;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 700;
}

.sa-summary-box h4:before {
    content: "📋";
    margin-right: 10px;
}

.sa-summary-box p {
    color: #495057;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

.sa-summary-box strong {
    color: #2b2d42;
    font-weight: 700;
    background-color: #d0ebff;
    padding: 2px 4px;
    border-radius: 3px;
}

.sa-email-status {
    background: #e7f5ff;
    border: 1px solid #a5d8ff;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    text-align: center;
}

.sa-share-options {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 30px 0;
}

.sa-share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.sa-next-steps {
    background: #fff3bf;
    border: 1px solid #ffd43b;
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
}

.sa-next-steps h4 {
    color: #2b2d42;
    margin: 0 0 15px 0;
    font-size: 18px;
}

.sa-next-steps ul {
    margin: 0;
    padding-left: 20px;
}

.sa-next-steps li {
    margin-bottom: 10px;
    color: #495057;
}

.sa-restart-section {
    text-align: center;
    padding: 30px;
    border-top: 1px solid #e9ecef;
}

/* ==================== LOADING OVERLAY ==================== */
.sa-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.sa-loading-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.sa-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f1f3f5;
    border-top-color: #339af0;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    animation: spin 1s linear infinite;
}

.sa-loading-content p {
    color: #2b2d42;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.sa-loading-subtext {
    color: #6c757d;
    font-size: 14px;
    font-weight: normal;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .sa-assessment-container {
        padding: 15px;
        border-radius: 8px;
    }
    
    .sa-header h1 {
        font-size: 24px;
    }
    
    .sa-category-header h2 {
        font-size: 20px;
    }
    
    .sa-question-text {
        font-size: 16px;
    }
    
    .sa-question-item {
        padding: 16px;
    }
    
    .sa-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .sa-email-form {
        padding: 25px 20px;
    }
    
    .sa-results-header h2 {
        font-size: 24px;
    }
    
    .sa-results-content {
        padding: 0 15px 20px 15px;
    }
    
    .sa-share-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .sa-share-buttons .sa-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .sa-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .sa-navigation .sa-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Add WhatsApp button styling for mobile */
    .sa-share-buttons .sa-btn-whatsapp {
        background: linear-gradient(135deg, #25D366, #128C7E) !important;
        color: white !important;
    }
    
    .sa-share-buttons .sa-btn-whatsapp:hover {
        background: linear-gradient(135deg, #1ebe5d, #0d7c6d) !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
    }
}

@media (max-width: 480px) {
    .sa-header h1 {
        font-size: 22px;
    }
    
    .sa-question-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
        margin-right: 8px;
    }
    
    .sa-option {
        padding: 12px;
    }
    
    .sa-option-text {
        font-size: 15px;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .sa-navigation,
    .sa-email-form,
    .sa-share-options,
    .sa-restart-section {
        display: none !important;
    }
    
    .sa-assessment-container {
        box-shadow: none;
        padding: 0;
    }
    
    .sa-results-header {
        background: #f8f9fa !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ==================== MARKDOWN FORMATTING ==================== */

.sa-analysis-content strong {
    color: #2b2d42;
    font-weight: 700;
    background-color: #f0f7ff;
    padding: 2px 4px;
    border-radius: 3px;
}

.sa-analysis-content h1 {
    color: #2b2d42;
    font-size: 28px;
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f3f5;
    font-weight: 700;
}

.sa-analysis-content h2 {
    color: #2b2d42;
    font-size: 24px;
    margin: 25px 0 15px 0;
    font-weight: 700;
}

.sa-analysis-content h3 {
    color: #2b2d42;
    font-size: 20px;
    margin: 20px 0 12px 0;
    font-weight: 600;
}

.sa-analysis-content p {
    margin-bottom: 16px;
    line-height: 1.7;
    color: #495057;
}

.sa-analysis-content br {
    margin-bottom: 8px;
    display: block;
    content: "";
}

/* Improve the overall readability */
.sa-analysis-content {
    font-size: 16px;
    line-height: 1.7;
    color: #495057;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #339af0;
}

/* Style for numbered/bulleted lists that might be in AI response */
.sa-analysis-content ul,
.sa-analysis-content ol {
    margin: 15px 0 15px 20px;
    padding-left: 20px;
}

.sa-analysis-content li {
    margin-bottom: 10px;
    color: #495057;
    line-height: 1.6;
}

.sa-analysis-content ul li {
    list-style-type: disc;
}

.sa-analysis-content ol li {
    list-style-type: decimal;
}

/* Make sure text doesn't overflow */
.sa-analysis-content * {
    max-width: 100%;
    word-wrap: break-word;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sa-analysis-content {
        padding: 15px;
        font-size: 15px;
    }
    
    .sa-analysis-content h1 {
        font-size: 24px;
    }
    
    .sa-analysis-content h2 {
        font-size: 20px;
    }
    
    .sa-analysis-content h3 {
        font-size: 18px;
    }
}