/**
 * TranslationModule Styles
 * Component-scoped styles for AI-validated translation exercises
 */

.translation-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, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

/* Language Information */
.language-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    font-size: 18px;
    font-weight: 600;
}

.language-from {
    color: #e74c3c;
    background: #ffebee;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #e74c3c;
}

.arrow {
    color: #3498db;
    font-size: 24px;
    font-weight: bold;
}

.language-to {
    color: #27ae60;
    background: #e8f5e8;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #27ae60;
}

/* Source Section */
.source-section {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
}

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

.source-text {
    background: white;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 12px;
}

.source-content {
    font-size: 20px;
    line-height: 1.6;
    color: #2c3e50;
    font-weight: 500;
    text-align: center;
    font-style: italic;
}

.context-panel {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    padding: 12px;
    color: #1976d2;
    font-size: 14px;
}

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

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

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

#translationArea {
    width: 100%;
    min-height: 100px;
    padding: 16px;
    border: 2px solid #27ae60;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #f8fff8;
}

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

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

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

/* Submit Button */
.submit-translation {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 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(52, 152, 219, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
}

.submit-translation:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9 0%, #1abc9c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.4);
}

.submit-translation: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;
}

/* Scores Panel */
.translation-scores {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

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

.score-value {
    font-size: 24px;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid;
    min-width: 80px;
    text-align: center;
}

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

.score-value.good {
    color: #f39c12;
    background: #fef9e7;
    border-color: #f39c12;
}

.score-value.fair {
    color: #e67e22;
    background: #fef2e6;
    border-color: #e67e22;
}

.score-value.needs-work {
    color: #e74c3c;
    background: #ffebee;
    border-color: #e74c3c;
}

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

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

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

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

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

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

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

/* Cultural Notes */
.cultural-info, .cultural-context {
    background: #f3e5f5;
    border: 1px solid #e1bee7;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    color: #7b1fa2;
}

.cultural-info strong, .cultural-context strong {
    color: #6a1b9a;
}

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

    .language-info {
        flex-direction: column;
        gap: 8px;
    }

    .arrow {
        transform: rotate(90deg);
    }

    .source-section, .translation-section, .feedback-section {
        padding: 16px;
    }

    .source-content {
        font-size: 18px;
    }

    #translationArea {
        min-height: 80px;
        font-size: 14px;
    }

    .translation-scores {
        flex-direction: column;
        gap: 12px;
    }

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

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

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

    .language-info, .source-section, .translation-section {
        background: #34495e;
        border-color: #4a6741;
    }

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

    .context-panel {
        background: #34495e;
        border-color: #4a6741;
        color: #ecf0f1;
    }

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

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

    .translation-scores {
        background: #34495e;
    }
}

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

    .source-section, .translation-section, .feedback-section {
        border: 2px solid #000;
    }

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

    .submit-translation, .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;
}

/* Language-specific text direction support */
.translation-module[dir="rtl"] {
    direction: rtl;
}

.translation-module[dir="rtl"] .arrow {
    transform: scaleX(-1);
}

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

    .action-buttons {
        display: none;
    }

    .progress-indicator {
        background: #000;
        color: white;
    }
}