/**
 * Styles publics pour le plugin Contes Exercices
 */

/* Bouton principal */
.cf-btn-generate-wrapper {
    margin: 30px 0;
    text-align: center;
}

.cf-btn-open-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.cf-btn-open-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.cf-btn-open-modal .cf-icon {
    margin-right: 8px;
}

/* Modal overlay */
.cf-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 999999;
    animation: cfFadeIn 0.3s ease;
}

.cf-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes cfFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal */
.cf-modal {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 60vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: cfSlideUp 0.3s ease;
}

@keyframes cfSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cf-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.cf-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Modal header */
.cf-modal-header {
    padding: 30px 30px 20px;
    border-bottom: 2px solid #f0f0f0;
}

.cf-modal-header h2 {
    margin: 0 0 10px;
    color: #667eea;
}

.cf-conte-title {
    color: #666;
    font-size: 14px;
}

/* Tabs */
.cf-modal-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    padding: 0 30px;
    background: #f9f9f9;
}

.cf-tab {
    padding: 15px 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.cf-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: bold;
}

.cf-tab:hover {
    color: #667eea;
}

/* Tab content */
.cf-tab-content {
    padding: 30px;
}

.cf-tab-content.hidden {
    display: none;
}

/* Quota indicator */
.cf-quota-indicator {
    background: linear-gradient(135deg, #667eea15, #764ba215);
    border-left: 4px solid #667eea;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 4px;
    font-size: 14px;
}

.cf-quota-indicator .cf-quota-icon {
    margin-right: 8px;
}

.cf-quota-exceeded {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 4px;
    color: #856404;
}

/* Form */
.cf-form-group {
    margin-bottom: 25px;
}

.cf-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.cf-form-group select,
.cf-form-group input[type="range"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.cf-form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Radio group */
.cf-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.cf-radio-group label {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.cf-radio-group label:hover {
    border-color: #667eea;
    background: #667eea15;
}

.cf-radio-group input[type="radio"] {
    margin-right: 8px;
}

.cf-radio-group input[type="radio"]:checked + span {
    font-weight: bold;
    color: #667eea;
}

/* Range slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    cursor: pointer;
    border-radius: 50%;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #667eea;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

/* Buttons */
.cf-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cf-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.cf-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.cf-btn-secondary:hover {
    background: #e0e0e0;
}

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

/* Loading */
.cf-loading {
    text-align: center;
    padding: 40px 20px;
}

.cf-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: cfSpin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes cfSpin {
    to { transform: rotate(360deg); }
}

/* Exercise display */
.cf-exercice-generated {
    margin-top: 20px;
}

.cf-exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

.cf-exercise-header h3 {
    margin: 0;
    color: #667eea;
}

.cf-exercise-meta {
    display: flex;
    gap: 10px;
}

.cf-badge {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

/* Sections */
.cf-section {
    margin-bottom: 30px;
}

.cf-section h4 {
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 18px;
}

.cf-instruction {
    font-style: italic;
    color: #666;
    margin-bottom: 20px;
}

/* Questions */
.cf-question {
    margin-bottom: 25px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.cf-question-text {
    margin-bottom: 10px;
    line-height: 1.6;
}

.cf-choices {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.cf-choices li {
    padding: 8px 0;
    margin-left: 20px;
}

/* Solutions */
.cf-solutions {
    background: #f0f0f0;
    padding: 20px;
    border-radius: 8px;
}

.cf-solutions ol {
    margin: 0;
    padding-left: 25px;
}

.cf-solutions li {
    margin-bottom: 10px;
}

/* Indications */
.cf-indication-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-top: 10px;
    border-radius: 4px;
}

.cf-indication-content ul {
    margin: 10px 0;
    padding-left: 25px;
}

/* Actions */
.cf-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

/* Existing exercises list */
.cf-existing-list {
    display: grid;
    gap: 15px;
}

.cf-exercise-card {
    border: 2px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    transition: all 0.3s;
}

.cf-exercise-card:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.cf-exercise-card-header {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.cf-exercise-date {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.cf-exercise-actions {
    display: flex;
    gap: 10px;
}

.cf-btn-view,
.cf-btn-pdf {
    padding: 8px 15px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .cf-modal {
        width: 95%;
        max-height: 95vh;
    }

    .cf-tab-content {
        padding: 20px 15px;
    }

    .cf-radio-group {
        flex-direction: column;
    }

    .cf-actions {
        flex-direction: column;
    }

    .cf-exercise-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Pour la barre outil utilisateur */

.excercice-barre .cf-btn-generate-wrapper {
    margin: 0;
}

.excercice-barre .cf-btn-open-modal {
    background: transparent;
    box-shadow: none;
    font-size: 8px;
    font-weight: normal;
    display: flex;
    flex-direction: column;
    padding: 15px 0;
}

.excercice-barre .cf-btn-open-modal .cf-icon {
    margin-right: 8px;
    content: url(https://contesdefees.com/wp-content/uploads/2025/10/gramatica.png);
    height: 32px;
    width: 32px;
    text-align: center;
    align-content: center;
}

