/**
 * TextAnalysisModule Styles
 * Component-scoped styles for open-text comprehension exercises
 */

.text-analysis-module {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Progress Indicator */
.progress-indicator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* Text Display Section */
.text-display {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
}

.text-display h3 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-content {
    line-height: 1.6;
    color: #34495e;
    font-size: 16px;
    background: white;
    padding: 16px;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.text-content p {
    margin-bottom: 12px;
}

.text-content p:last-child {
    margin-bottom: 0;
}

/* Question Section */
.question-section {
    background: #ffffff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.question-section h3 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.question-text {
    font-size: 18px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 20px;
    padding: 16px;
    background: #f1f3f4;
    border-radius: 6px;
    border-left: 4px solid #9b59b6;
}

/* Response Area */
.response-area-container {
    position: relative;
    margin-bottom: 16px;
}

#responseArea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fafafa;
}

#responseArea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background: white;
}

#responseArea::placeholder {
    color: #95a5a6;
    font-style: italic;
}

.input-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 14px;
    color: #7f8c8d;
}

.min-chars {
    color: #95a5a6;
    font-style: italic;
}

/* Submit Button */
.submit-response {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(39, 174, 96, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
}

.submit-response:hover:not(:disabled) {
    background: linear-gradient(135deg, #229954 0%, #27ae60 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(39, 174, 96, 0.4);
}

.submit-response:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Feedback Section */
.feedback-section {
    background: #ffffff;
    border: 2px solid #e8f5e8;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    animation: slideIn 0.5s ease-out;
}

.feedback-section h3 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-score {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.score-label {
    font-weight: 600;
    color: #2c3e50;
}

.score-value {
    font-size: 20px;
    font-weight: bold;
    color: #27ae60;
    background: white;
    padding: 4px 12px;
    border-radius: 20px;
    border: 2px solid #27ae60;
}

.feedback-text {
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    line-height: 1.6;
}

.feedback-text.positive {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.feedback-text.needs-improvement {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.suggestions {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

.suggestions strong {
    color: #1976d2;
    display: block;
    margin-bottom: 8px;
}

.suggestions ul {
    margin: 0;
    padding-left: 20px;
    color: #424242;
}

.suggestions li {
    margin-bottom: 4px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.retry-button, .next-button, .finish-button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.retry-button {
    background: #ff9f43;
    color: white;
    box-shadow: 0 2px 4px rgba(255, 159, 67, 0.3);
}

.retry-button:hover {
    background: #ff8c1a;
    transform: translateY(-1px);
}

.next-button {
    background: #3498db;
    color: white;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.next-button:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.finish-button {
    background: #9b59b6;
    color: white;
    box-shadow: 0 2px 4px rgba(155, 89, 182, 0.3);
}

.finish-button:hover {
    background: #8e44ad;
    transform: translateY(-1px);
}

/* Error Messages */
.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #e74c3c;
}

.error-message h3 {
    margin-bottom: 16px;
    font-size: 1.4em;
}

.error-message button {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 16px;
}

.validation-error {
    animation: shake 0.5s ease-in-out;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .text-analysis-module {
        padding: 16px;
        margin: 10px;
    }

    .text-display, .question-section, .feedback-section {
        padding: 16px;
    }

    .question-text {
        font-size: 16px;
    }

    #responseArea {
        min-height: 100px;
        font-size: 14px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .retry-button, .next-button, .finish-button {
        width: 100%;
        justify-content: center;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .text-analysis-module {
        background: #2c3e50;
        color: #ecf0f1;
    }

    .text-display {
        background: #34495e;
        border-color: #4a6741;
    }

    .text-content {
        background: #2c3e50;
        color: #ecf0f1;
    }

    .question-section {
        background: #34495e;
        border-color: #4a6741;
    }

    .question-text {
        background: #2c3e50;
        color: #ecf0f1;
    }

    #responseArea {
        background: #2c3e50;
        color: #ecf0f1;
        border-color: #4a6741;
    }

    #responseArea:focus {
        background: #34495e;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .text-analysis-module {
        border: 3px solid #000;
    }

    .text-display, .question-section, .feedback-section {
        border: 2px solid #000;
    }

    #responseArea {
        border: 2px solid #000;
    }

    .submit-response, .retry-button, .next-button, .finish-button {
        border: 2px solid #000;
    }
}