/**
 * Helen Case Studies CSS
 * Styling for interactive case study interface
 */

/* Main Container */
.sfpe-case-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #FFFFE7;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header Section */
.sfpe-case-header {
    display: flex;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.helen-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.helen-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.helen-info h3 {
    margin: 0 0 5px 0;
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.helen-info p {
    margin: 0;
    color: #7f8c8d;
    font-size: 16px;
}

/* Case Selector */
.sfpe-case-selector {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sfpe-case-selector h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 28px;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.case-card {
    position: relative;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.case-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.case-difficulty {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.case-difficulty.intermediate {
    background: #f39c12;
    color: white;
}

.case-difficulty.advanced {
    background: #e74c3c;
    color: white;
}

.case-card h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #2c3e50;
}

.case-card p {
    margin: 0 0 20px 0;
    color: #5a6c7d;
    line-height: 1.5;
}

.case-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.case-stats span {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #7f8c8d;
}

.sfpe-start-case {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sfpe-start-case:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Case Workspace */
.sfpe-case-workspace {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Progress Bar */
.case-progress-bar {
    height: 6px;
    background: #ecf0f1;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.5s ease;
}

/* Helen Dialogue */
.helen-dialogue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
}

.helen-message {
    position: relative;
}

.helen-intro-sequence .greeting {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 500;
}

.helen-intro-sequence .case-intro {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.95;
}

/* Case Content */
.case-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    padding: 30px;
}

/* Company Info Panel */
.case-info-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    height: fit-content;
}

.case-info-panel h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.metric {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.metric label {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.company-description {
    background: white;
    padding: 15px;
    border-radius: 6px;
}

.company-description h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.company-description p {
    margin: 5px 0;
    font-size: 14px;
    color: #5a6c7d;
}

/* Question Panel */
.question-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
}

.question-header h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
    line-height: 1.4;
}

/* Multiple Choice Options */
.multiple-choice-options {
    margin-bottom: 20px;
}

.choice-option {
    display: block;
    background: white;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.choice-option:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.choice-option input {
    margin-right: 12px;
}

.choice-text {
    font-size: 16px;
    line-height: 1.4;
}

/* Answer Section */
.answer-section {
    margin-top: 20px;
}

.sfpe-case-textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.sfpe-case-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.answer-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Helen Feedback */
.helen-feedback {
    background: white;
    padding: 30px;
    border-top: 1px solid #e9ecef;
}

.feedback-content {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 20px;
    align-items: start;
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.score-circle.large {
    width: 120px;
    height: 120px;
}

.score-number {
    font-size: 24px;
    line-height: 1;
}

.score-circle.large .score-number {
    font-size: 36px;
}

.score-max {
    font-size: 14px;
    opacity: 0.8;
}

.score-percent {
    font-size: 18px;
    opacity: 0.8;
}

.helen-response {
    margin-bottom: 20px;
}

.helen-quote {
    background: #f8f9fa;
    padding: 20px;
    border-left: 4px solid #667eea;
    border-radius: 0 8px 8px 0;
    margin-bottom: 15px;
}

.helen-quote p {
    margin: 0;
    font-style: italic;
    font-size: 16px;
    line-height: 1.5;
    color: #2c3e50;
}

.helen-follow-up {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
}

.helen-follow-up strong {
    color: #1976d2;
}

.feedback-summary {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.feedback-summary.excellent {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.feedback-summary.good {
    background: #cce5ff;
    border-left: 4px solid #007bff;
}

.feedback-summary.partial {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.feedback-summary.needs_improvement {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.score-breakdown {
    font-weight: 600;
    margin-top: 10px;
}

/* Hint Panel */
.hint-panel {
    background: #fff9c4;
    border: 1px solid #f9ca24;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.hint-content h4 {
    margin: 0 0 10px 0;
    color: #e67e22;
    display: flex;
    align-items: center;
}

.hint-content h4::before {
    content: "💡";
    margin-right: 8px;
}

.hint-text {
    margin: 0 0 10px 0;
    color: #2c3e50;
    line-height: 1.5;
}

.hint-level {
    font-size: 14px;
    color: #7f8c8d;
}

/* Case Completion */
.case-completion {
    text-align: center;
    padding: 40px;
}

.case-completion h2 {
    margin: 0 0 30px 0;
    color: #2c3e50;
}

.final-score {
    margin-bottom: 30px;
}

.helen-final-message {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #667eea;
}

.helen-final-message p {
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
    color: #2c3e50;
}

.signature {
    font-style: italic;
    margin-top: 15px !important;
    color: #7f8c8d !important;
    font-size: 16px !important;
}

.completion-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Loading States */
.loading-message {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .case-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .feedback-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .case-grid {
        grid-template-columns: 1fr;
    }
    
    .sfpe-case-header {
        flex-direction: column;
        text-align: center;
    }
    
    .helen-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }
}

/* Print Styles */
@media print {
    .sfpe-case-container {
        background: white;
        box-shadow: none;
    }
    
    .answer-controls,
    .hint-panel,
    .case-progress-bar {
        display: none;
    }
}