/**
 * GrammarAnalysisModule Styles
 * Component-scoped styles for grammar correction exercises
 */

.grammar-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, #9b59b6 0%, #8e44ad 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(155, 89, 182, 0.3);
}

/* Sentence Display Section */
.sentence-display {
    background: #fff5f5;
    border: 2px solid #ffebee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
}

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

.original-sentence {
    background: white;
    border: 2px solid #e74c3c;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 12px;
}

.sentence-text {
    font-size: 18px;
    line-height: 1.5;
    color: #2c3e50;
    font-weight: 500;
}

.error-info {
    background: #ffeaa7;
    border: 1px solid #fdcb6e;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    color: #8b4513;
}

.error-type {
    font-weight: 500;
}

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

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

.correction-container {
    position: relative;
    margin-bottom: 16px;
}

#correctionArea {
    width: 100%;
    min-height: 80px;
    padding: 16px;
    border: 2px solid #27ae60;
    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: #f8fff8;
}

#correctionArea:focus {
    outline: none;
    border-color: #2ecc71;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
    background: white;
}

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

.correction-tips {
    margin-top: 8px;
    padding: 8px 12px;
    background: #e8f5e8;
    border-radius: 4px;
    font-size: 14px;
    color: #27ae60;
}

/* Submit Button */
.submit-correction {
    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-correction: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-correction:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Feedback Section */
.feedback-section {
    background: #ffffff;
    border: 2px solid #e8f8f5;
    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: 18px;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 20px;
    border: 2px solid;
}

.score-value.correct {
    color: #27ae60;
    background: #e8f5e8;
    border-color: #27ae60;
}

.score-value.needs-work {
    color: #e67e22;
    background: #fef7e8;
    border-color: #e67e22;
}

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

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

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

/* Grammar Rules Section */
.grammar-rules {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

.grammar-rule {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 12px;
    color: #1976d2;
}

.detailed-explanation {
    background: #f3e5f5;
    border: 1px solid #e1bee7;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 12px;
    color: #7b1fa2;
}

.suggestions {
    background: #e8f5e8;
    border: 1px solid #c8e6c9;
    border-radius: 4px;
    padding: 12px;
}

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

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

.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) {
    .grammar-analysis-module {
        padding: 16px;
        margin: 10px;
    }

    .sentence-display, .correction-section, .feedback-section {
        padding: 16px;
    }

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

    #correctionArea {
        min-height: 70px;
        font-size: 14px;
    }

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

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

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

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

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

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

/* Focus indicators for accessibility */
.retry-button:focus, .next-button:focus, .finish-button:focus {
    outline: 3px solid #4a90e2;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .grammar-analysis-module {
        box-shadow: none;
        border: 1px solid #000;
    }

    .action-buttons {
        display: none;
    }
}