/**
 * Decision Tree Interface Styles
 * Enhanced UI for structured question flows and confidence scoring
 */

/* Decision Tree Modal */
.rscc-decision-tree-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rscc-decision-tree-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Decision Tree Option */
.rscc-decision-tree-option {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.rscc-decision-tree-option h4 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
}

.rscc-decision-tree-option p {
    margin: 0 0 15px 0;
    opacity: 0.9;
}

/* Question Interface */
.rscc-decision-question {
    animation: fadeInLeft 0.4s ease-out;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.rscc-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.rscc-question-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.4em;
    font-weight: 600;
}

.rscc-confidence-indicator {
    background: #f7fafc;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.rscc-confidence-indicator span {
    font-weight: 600;
    color: #4a5568;
}

#current-confidence {
    color: #38a169;
    font-size: 1.1em;
}

/* Question Options */
.rscc-question-options {
    margin: 25px 0;
}

.rscc-decision-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.rscc-decision-option:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
}

.rscc-decision-option.selected {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    border-color: #4caf50;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.rscc-decision-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.rscc-decision-option label {
    display: block;
    cursor: pointer;
    font-weight: 500;
    margin: 0;
    padding-left: 30px;
    position: relative;
}

.rscc-decision-option label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    background: white;
    transition: all 0.3s ease;
}

.rscc-decision-option input[type="checkbox"] + label::before {
    border-radius: 4px;
}

.rscc-decision-option.selected label::before {
    background: white;
    border-color: white;
}

.rscc-decision-option.selected label::after {
    content: '✓';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: #4caf50;
    font-weight: bold;
    font-size: 14px;
}

/* Question Actions */
.rscc-question-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.rscc-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.rscc-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.rscc-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.rscc-btn-primary:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.rscc-btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.rscc-btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.rscc-btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.rscc-btn-outline:hover {
    background: #667eea;
    color: white;
}

/* Decision Tree Results */
.rscc-decision-results {
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

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

.rscc-decision-results h3 {
    color: #2d3748;
    margin-bottom: 25px;
    font-size: 1.6em;
}

.rscc-confidence-score {
    margin: 30px 0;
}

.rscc-confidence-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(#4caf50 0deg, #4caf50 var(--percentage, 0deg), #e9ecef var(--percentage, 0deg));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    position: relative;
}

.rscc-confidence-circle::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    background: white;
    border-radius: 50%;
}

.rscc-confidence-circle span {
    position: relative;
    z-index: 1;
    font-size: 1.5em;
    font-weight: bold;
    color: #2d3748;
}

.rscc-decision-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    text-align: left;
}

.rscc-decision-summary h4 {
    margin: 0 0 15px 0;
    color: #2d3748;
}

.rscc-decision-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rscc-decision-summary li {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.rscc-decision-summary li:last-child {
    border-bottom: none;
}

.rscc-recommendations {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    text-align: left;
}

.rscc-recommendations h4 {
    margin: 0 0 15px 0;
    color: #856404;
}

.rscc-recommendations ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rscc-recommendations li {
    padding: 8px 0;
    position: relative;
    padding-left: 25px;
}

.rscc-recommendations li::before {
    content: '💡';
    position: absolute;
    left: 0;
    top: 8px;
}

.rscc-recommendation-high {
    color: #dc3545;
    font-weight: 600;
}

.rscc-recommendation-medium {
    color: #fd7e14;
}

.rscc-recommendation-low {
    color: #28a745;
}

.rscc-decision-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Progress Indicator */
.rscc-decision-progress {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    margin-bottom: 20px;
    overflow: hidden;
}

.rscc-decision-progress::before {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: var(--progress, 0%);
    transition: width 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rscc-decision-tree-content {
        padding: 20px;
        margin: 10px;
    }
    
    .rscc-question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .rscc-question-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .rscc-decision-actions {
        flex-direction: column;
    }
    
    .rscc-confidence-circle {
        width: 100px;
        height: 100px;
    }
    
    .rscc-confidence-circle::before {
        width: 75px;
        height: 75px;
    }
}
