/* Interactive Follow-up Question System Styles */

.enhanced-followup {
    margin-top: 1.5rem;
}

.followup-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.followup-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.followup-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    flex-shrink: 0;
}

.followup-icon.success {
    background: #10b981;
}

.followup-icon.error {
    background: #ef4444;
}

.followup-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.followup-question {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #3b82f6;
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
}

.followup-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.followup-answer-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s;
    white-space: nowrap;
}

.followup-answer-btn:hover {
    background: #f3f4f6;
    border-color: #3b82f6;
    color: #3b82f6;
}

.followup-answer-btn.selected {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.custom-answer-section {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.answer-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.followup-answer-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 3rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.followup-answer-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.answer-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.followup-submit-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.875rem;
}

.followup-submit-btn:hover {
    background: #2563eb;
}

.followup-skip-btn {
    padding: 0.5rem 1rem;
    background: white;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.followup-skip-btn:hover {
    background: #f9fafb;
    color: #374151;
    border-color: #9ca3af;
}

.followup-response {
    margin-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
}

.followup-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    color: #6b7280;
}

.loading-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.followup-result {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.followup-result-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.followup-result-content {
    padding: 1.5rem;
}

.refined-answer {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f0f9ff;
    border-radius: 6px;
    border-left: 4px solid #0ea5e9;
}

.refined-answer h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0c4a6e;
}

.answer-highlight {
    font-style: italic;
    color: #0369a1;
    background: white;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #bae6fd;
}

.refined-result {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.refined-result pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #374151;
}

.additional-followup {
    padding: 1rem;
    background: #fef7cd;
    border-radius: 6px;
    border-left: 4px solid #f59e0b;
    margin-top: 1rem;
}

.additional-followup strong {
    color: #92400e;
    display: block;
    margin-bottom: 0.5rem;
}

.additional-followup p {
    margin: 0;
    color: #78350f;
    line-height: 1.5;
}

.followup-actions-bottom {
    display: flex;
    justify-content: center;
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.followup-error {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #fca5a5;
    background: #fef2f2;
}

.error-content h4 {
    margin: 0 0 0.5rem 0;
    color: #dc2626;
    font-size: 1rem;
}

.error-content p {
    margin: 0 0 1rem 0;
    color: #7f1d1d;
    line-height: 1.5;
}

.followup-skipped {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f3f4f6;
    border-radius: 8px;
    color: #6b7280;
    font-style: italic;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    font-size: 0.875rem;
}

.btn-secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .followup-container {
        padding: 1rem;
        margin: 0.75rem 0;
    }
    
    .followup-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .followup-icon {
        width: 2rem;
        height: 2rem;
    }
    
    .followup-title {
        font-size: 1rem;
    }
    
    .quick-answers {
        flex-direction: column;
    }
    
    .followup-answer-btn {
        width: 100%;
        text-align: center;
    }
    
    .answer-buttons {
        flex-direction: column;
    }
    
    .followup-submit-btn,
    .followup-skip-btn {
        width: 100%;
        justify-content: center;
    }
    
    .followup-result-content {
        padding: 1rem;
    }
    
    .refined-answer {
        padding: 0.75rem;
    }
}

/* Animation for smooth transitions */
.followup-container {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.followup-response {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Focus states for accessibility */
.followup-answer-btn:focus,
.followup-submit-btn:focus,
.followup-skip-btn:focus,
.followup-answer-input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .followup-container {
        border-width: 3px;
    }
    
    .followup-answer-btn {
        border-width: 2px;
    }
    
    .followup-answer-btn.selected {
        border-width: 3px;
    }
}

