/* French Writing Assessment Plugin Styles v1.2.1 */

#fwa-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.fwa-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.fwa-header h2 {
    color: #2c3e50;
    font-size: 32px;
    margin-bottom: 10px;
}

.fwa-subtitle {
    color: #7f8c8d;
    font-size: 16px;
}

/* Level Guidance Section */
.fwa-level-guidance {
    margin-bottom: 30px;
    border: 2px solid #e8f4f8;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fcff;
}

.fwa-guidance-toggle {
    width: 100%;
    padding: 18px 20px;
    background: #e8f4f8;
    border: none;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    color: #2c3e50;
    transition: background 0.3s ease;
}

.fwa-guidance-toggle:hover {
    background: #d4e9f3;
}

.toggle-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.fwa-level-guidance.open .toggle-icon {
    transform: rotate(90deg);
}

.fwa-guidance-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.fwa-level-guidance.open .fwa-guidance-content {
    max-height: 1000px;
    padding: 25px;
}

.fwa-levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.fwa-level-card {
    padding: 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fwa-level-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.fwa-level-card.recommended {
    border-color: #3498db;
    background: #f0f8ff;
}

.level-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    color: white;
}

.level-badge.level-a1 { background: #27ae60; }
.level-badge.level-a2 { background: #2ecc71; }
.level-badge.level-b1 { background: #f39c12; }
.level-badge.level-b2 { background: #e67e22; }
.level-badge.level-c1 { background: #e74c3c; }
.level-badge.level-c2 { background: #c0392b; }

.start-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #3498db;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.fwa-level-card h4 {
    font-size: 15px;
    margin: 8px 0 6px 0;
    color: #2c3e50;
}

.fwa-level-card p {
    font-size: 12px;
    color: #7f8c8d;
    margin: 0;
    line-height: 1.4;
}

.fwa-guidance-cta {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 2px dashed #3498db;
}

.fwa-guidance-cta p {
    margin: 0;
    font-size: 15px;
    color: #2c3e50;
}

.fwa-guidance-cta a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    transition: border-color 0.3s ease;
}

.fwa-guidance-cta a:hover {
    border-color: #2980b9;
}

/* Form Section */
.fwa-form-section {
    margin-bottom: 35px;
}

.fwa-form-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
}

.fwa-level-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.fwa-level-btn {
    padding: 18px 10px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 600;
    color: #34495e;
}

.fwa-level-btn:hover {
    border-color: #3498db;
    background: #f0f8ff;
    transform: translateY(-2px);
}

.fwa-level-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.fwa-level-btn small {
    display: block;
    font-size: 12px;
    font-weight: normal;
    margin-top: 4px;
    opacity: 0.8;
}

#fwa-exercise-content {
    margin: 25px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

#fwa-exercise-content h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 20px;
}

.fwa-prompt {
    background: white;
    padding: 20px;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 4px solid #f39c12;
    white-space: pre-line;
}

#fwa-writing-area {
    margin-top: 25px;
}

/* French Accent Toolbar */
.fwa-accent-toolbar {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.fwa-accent-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    color: #2c3e50;
}

.fwa-accent-label span {
    font-weight: 600;
    font-size: 14px;
}

.fwa-accent-label small {
    color: #7f8c8d;
    font-style: italic;
    font-size: 12px;
}

.fwa-accent-buttons, .fwa-accent-capitals {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.fwa-accent-capitals {
    margin-bottom: 0;
}

.fwa-accent-btn {
    background: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
    user-select: none;
}

.fwa-accent-btn:hover {
    background: #e9ecef;
    border-color: #3498db;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.fwa-accent-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.fwa-accent-btn.fwa-capital {
    background: #e8f4f8;
    border-color: #3498db;
    color: #2980b9;
}

.fwa-accent-btn.fwa-capital:hover {
    background: #d4e9f3;
    border-color: #2980b9;
}

/* Responsive accent buttons */
@media (max-width: 600px) {
    .fwa-accent-buttons, .fwa-accent-capitals {
        gap: 3px;
    }
    
    .fwa-accent-btn {
        padding: 6px 8px;
        font-size: 14px;
        min-width: 32px;
    }
    
    .fwa-accent-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

#fwa-user-text {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#fwa-user-text:focus {
    outline: none;
    border-color: #3498db;
}

.fwa-word-count {
    display: flex;
    justify-content: space-between;
    margin: 10px 0 20px 0;
    font-size: 14px;
    color: #7f8c8d;
}

.fwa-requirement {
    color: #e74c3c;
    font-weight: 600;
}

.fwa-user-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.fwa-name-section, .fwa-email-section {
    display: flex;
    flex-direction: column;
}

.fwa-name-section label, .fwa-email-section label {
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
}

.fwa-name-section input, .fwa-email-section input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.fwa-name-section input:focus, .fwa-email-section input:focus {
    outline: none;
    border-color: #3498db;
}

.fwa-submit-btn {
    width: 100%;
    padding: 18px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fwa-submit-btn:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.fwa-submit-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.fwa-submit-btn.fwa-btn-warning {
    background: #f39c12;
    animation: pulse-warning 2s infinite;
}

.fwa-submit-btn.fwa-btn-warning:hover {
    background: #e67e22;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* Results Section */
#fwa-results-section {
    margin-top: 30px;
}

.fwa-overall-score {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 25px;
}

.fwa-overall-score h4 {
    font-size: 18px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.fwa-overall-score .score {
    font-size: 48px;
    font-weight: bold;
    margin: 10px 0;
}

.fwa-overall-score .level {
    font-size: 20px;
    opacity: 0.95;
}

.fwa-scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.fwa-score-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #ecf0f1;
    text-align: center;
}

.fwa-score-card h5 {
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 10px;
}

.fwa-score-card .score {
    font-size: 32px;
    font-weight: bold;
    color: #3498db;
}

.fwa-feedback-section {
    margin: 25px 0;
    padding: 25px;
    background: white;
    border-radius: 8px;
    border: 2px solid #ecf0f1;
}

.fwa-feedback-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fwa-feedback-section ul {
    list-style: none;
    padding: 0;
}

.fwa-feedback-section li {
    padding: 12px;
    margin: 8px 0;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.fwa-feedback-section.errors {
    border-color: #e74c3c;
    background: #fdf2f2;
}

.fwa-feedback-section.errors li {
    border-left-color: #e74c3c;
    background: white;
}

.fwa-feedback-section.corrections {
    border-color: #f39c12;
    background: #fefbf3;
}

.fwa-feedback-section.improvements {
    border-color: #27ae60;
    background: #f2f8f4;
}

.fwa-feedback-section.improvements li {
    border-left-color: #27ae60;
}

.fwa-error-category h5 {
    color: #e74c3c;
    font-size: 14px;
    margin: 15px 0 10px 0;
    text-transform: capitalize;
}

.fwa-corrections-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.fwa-correction-item {
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.fwa-correction-error {
    color: #e74c3c;
    font-weight: 600;
    margin-bottom: 5px;
}

.fwa-correction-fix {
    color: #27ae60;
    font-weight: 600;
    margin-bottom: 8px;
}

.fwa-correction-explanation {
    color: #7f8c8d;
    font-style: italic;
    font-size: 14px;
}

.fwa-detailed-analysis {
    margin: 25px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
}

.fwa-detailed-analysis h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 18px;
}

.fwa-analysis-item {
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 6px;
}

.fwa-analysis-item h5 {
    color: #3498db;
    font-size: 15px;
    margin-bottom: 8px;
}

.fwa-analysis-item p {
    color: #34495e;
    line-height: 1.6;
    margin: 0;
}

.fwa-scoring-detail {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px;
    white-space: pre-line;
    line-height: 1.6;
    margin: 0;
    color: #1a1a1a;
}

.fwa-highlight-word {
    color: #2c3e50;
    font-weight: 600;
    background: rgba(52, 152, 219, 0.1);
    padding: 0 4px;
    border-radius: 3px;
}

.fwa-scoring-detail strong {
    color: #2c3e50;
    font-weight: 700;
}

.fwa-restart-btn {
    width: 100%;
    padding: 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.3s ease;
}

.fwa-restart-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Loading Spinner */
#fwa-loading {
    text-align: center;
    padding: 40px;
}

.fwa-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Responsive */
@media (max-width: 768px) {
    #fwa-container {
        padding: 20px;
    }
    
    .fwa-level-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .fwa-scores-grid {
        grid-template-columns: 1fr;
    }
    
    .fwa-levels-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .fwa-user-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}