@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fira+Code&display=swap');

.out-phase-container { margin-top: 1em; }
                            .out-phase-list { display: flex; flex-direction: column; gap: 8px; }
                            .out-phase-item { display: flex; align-items: center; gap: 12px; }
                            .out-phase-label { min-width: 80px; }
                            .out-phase-bar { flex: 1; height: 12px; background: #eee; border-radius: 6px; overflow: hidden; }
                            .out-phase-fill { height: 100%; background: #4caf50; transition: width 0.3s; }
                            .out-phase-percent { min-width: 50px; text-align: right; font-size: 0.95em; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    background-color: #f9fafb;
    color: #1a202c;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    background-color: transparent;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    box-sizing: border-box;
    overflow: hidden;
}

.panel {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    height: 100vh;
    overflow-y: auto;
}

.panel h2 {
    margin: 0;
}

h1, h2, h3 {
    color: #1a202c;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-top: 0;
}

.title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    box-sizing: border-box;
    padding: 0 16px;
}

h1 {
    font-size: 1.1rem;
    color: #374151;
    margin: 0;
    padding: 10px 0;
    flex-grow: 1;
}

.save-button {
    margin: 0;
    padding: 6px 12px;
    font-size: 0.8rem;
}

h2 {
    font-size: 1.1rem;
    padding: 10px 0;
    margin: 0;
    color: #374151;
    background-color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 5;
}

.config-area, .evaluation-area {
    margin-bottom: 16px;
    padding: 16px;
    background: #ffffff;
}

.chat-area {
    margin-bottom: 0;
    padding: 16px;
    flex: 1 1 auto;
    background: #f3f4f6;
}

.chat-controls {
    margin: 0 16px 16px 16px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
}

.config-item {
    margin-bottom: 16px;
}

.config-item label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    color: #4b5563;
}

input[type="text"],
textarea,
select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #ffffff;
    font-size: 0.95rem;
    color: #111827;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

textarea {
    resize: vertical;
    min-height: 300px;
    font-family: 'Fira Code', monospace;
    line-height: 1.5;
}

button {
    background-color: #6366f1;
    color: white;
    padding: 8px 16px;
    border: 1px solid #6366f1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 8px;
    margin-right: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    background-color: #4f46e5;
    border-color: #4f46e5;
}

button:active {
    background-color: #4338ca;
    border-color: #4338ca;
}

button:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    box-shadow: none;
}

.chat-controls {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #ffffff;
    margin-top: 12px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-id {
    font-size: 0.8rem;
    color: #6b7280;
    padding: 4px 8px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
}

.start-button {
    display: flex;
    align-items: center;
    gap: 6px;
}

.button-icon {
    font-size: 0.9rem;
}

.chat-controls label {
    display: inline-flex;
    align-items: center;
    font-weight: 400;
    font-size: 0.85rem;
    color: #4b5563;
}

.chat-controls input[type="checkbox"] {
    margin-right: 6px;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    appearance: none;
    border: 1px solid #d1d5db;
    outline: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.chat-controls input[type="checkbox"]:checked {
    background-color: #6366f1;
    border-color: #6366f1;
}

.chat-controls input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 10px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#chat-box {
    height: calc(80vh - 150px);
    padding: 16px;
    overflow-y: auto;
    margin-bottom: 12px;
    background-color: #f3f4f6;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

.message {
    padding: 10px 14px;
    margin-bottom: 10px;
    border-radius: 4px;
    word-wrap: break-word;
    max-width: 85%;
    line-height: 1.5;
    font-size: 0.95rem;
    position: relative;
    animation: fadeIn 0.2s ease-out;
}

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

.user-message {
    background-color: #e0e7ff;
    color: #1e293b;
    text-align: right;
    margin-left: auto;
    border: none;
}

.ai-message {
    background-color: #ffffff;
    color: #1e293b;
    text-align: left;
    margin-right: auto;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.system-message {
    background: rgba(253, 230, 138, 0.2);
    border-left: 3px solid #f59e0b;
    color: #92400e;
    font-style: italic;
    text-align: center;
    max-width: 95%;
    margin: 10px auto;
    border-radius: 8px;
    padding: 12px 16px;
}

.error-message {
    background: rgba(254, 202, 202, 0.2);
    border-left: 3px solid #ef4444;
    color: #b91c1c;
    font-weight: 600;
    text-align: center;
    max-width: 95%;
    margin: 10px auto;
    border-radius: 8px;
    padding: 12px 16px;
}

.input-area {
    display: flex;
    position: relative;
    background-color: #ffffff;
    border-radius: 4px;
    padding: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.input-area input[type="text"] {
    flex-grow: 1;
    margin-right: 8px;
    border: none;
    background-color: transparent;
    font-size: 0.95rem;
    padding: 8px;
    box-shadow: none;
}

.input-area input[type="text"]:focus {
    outline: none;
    box-shadow: none;
}

.input-area button {
    padding: 6px 12px;
    border-radius: 4px;
    margin: 0;
}

#tts-audio {
    display: block;
    margin-top: 12px;
    width: 100%;
    height: 36px;
    border-radius: 4px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

/* Styles for the evaluation progress section */
.evaluation-progress {
    margin-top: 16px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.progress-title {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #4b5563;
    font-weight: 600;
}

.phase-info {
    display: flex;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.phase-label {
    font-weight: 500;
    margin-right: 8px;
    color: #6b7280;
}

.phase-value {
    font-weight: 600;
    color: #4338ca;
}

.objectives-container {
    margin-top: 16px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 16px;
}

.objectives-container h4 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    color: #374151;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

.objective-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pedagogical-objective {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.pedagogical-objective:hover {
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.pedagogical-objective-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.pedagogical-objective-icon {
    font-size: 1.2rem;
    margin-right: 8px;
    color: #6366f1;
}

.pedagogical-objective-title {
    font-weight: 600;
    font-size: 1rem;
    color: #374151;
}

/* Criteria styling */
.criterias {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
}

.criteria-item {
    display: grid;
    grid-template-columns: minmax(120px, 2fr) auto minmax(100px, 1fr);
    gap: 12px;
    padding: 8px 12px;
    margin: 8px 0;
    background-color: rgba(249, 250, 251, 0.7);
    border-radius: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Make criteria items responsive on small screens */
@media (max-width: 600px) {
    .criteria-item {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        text-align: left;
    }
    
    .criteria-feedback {
        text-align: left;
    }
}

.criteria-item:hover {
    background-color: rgba(243, 244, 246, 1);
}

.criteria-name {
    font-weight: 500;
    color: #4b5563;
    font-size: 0.85rem;
}

.criteria-grade {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    text-align: center;
    white-space: nowrap;
}

.criteria-grade {
    background-color: #e0e7ff;
    color: #4338ca;
}

/* Class that Vue can add dynamically */
.criteria-grade.validated {
    background-color: #d1fae5;
    color: #065f46;
}

.criteria-grade.not-validated {
    background-color: #fee2e2;
    color: #b91c1c;
}

.criteria-feedback {
    font-style: italic;
    color: #6b7280;
    font-size: 0.8rem;
    text-align: right;
}

.objective-children {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 8px;
}

.objective-item {
    background: #ffffff;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 3px solid #d1d5db;
    transition: all 0.2s ease;
}

.objective-item.not_evaluated {
    border-left-color: #9ca3af;
}

.objective-item.partial {
    border-left-color: #3b82f6;
}

.objective-item.success {
    border-left-color: #10b981;
}

.objective-item.failed {
    border-left-color: #ef4444;
}

.objective-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.objective-name {
    font-weight: 500;
    font-size: 0.95rem;
    color: #1f2937;
    flex: 1;
    padding-right: 10px;
}

.objective-indicators {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.evaluable-badge {
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    margin-bottom: 4px;
}

.evaluable-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    font-weight: bold;
}

.evaluable-yes {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.evaluable-no {
    background-color: #f9fafb;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

/* Style pour les objectifs évaluables */
.objective-item.evaluable {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-right: 3px solid #10b981;
}

.objective-item.evaluable:hover {
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.15);
    transform: translateY(-2px);
}

/* Style pour les objectifs non évaluables */
.objective-item.non-evaluable {
    opacity: 0.9;
}

.objective-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    text-align: center;
    background: #e5e7eb;
    color: #4b5563;
    white-space: nowrap;
}

.objective-item.not_evaluated .objective-status-badge {
    background: #f3f4f6;
    color: #6b7280;
}

.objective-item.partial .objective-status-badge {
    background: #e0f2fe;
    color: #1e40af;
}

.objective-item.success .objective-status-badge {
    background: #d1fae5;
    color: #065f46;
}

.objective-item.failed .objective-status-badge {
    background: #fee2e2;
    color: #b91c1c;
}

.objective-progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.objective-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.objective-item.not_evaluated .objective-progress-fill {
    width: 5%;
    background-color: #9ca3af;
}

.objective-item.partial .objective-progress-fill {
    width: 50%;
    background-color: #3b82f6;
}

.objective-item.success .objective-progress-fill {
    width: 100%;
    background-color: #10b981;
}

.objective-item.failed .objective-progress-fill {
    width: 100%;
    background-color: #ef4444;
}

.json-editor-error {
    border-color: #ef4444;
    outline-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

.json-error-message {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 6px;
    padding: 4px 8px;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 3px;
}

#app {
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.config-area {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
    padding: 16px;
    margin-top: 0;
}

/* Style spécifique pour l'éditeur JSON */
.jse-main {
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    height: 400px !important;
    margin-bottom: 16px;
    background-color: #ffffff;
}

/* Styles pour l'en-tête de l'éditeur JSON avec bouton plein écran */
.json-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.fullscreen-toggle {
    background: transparent;
    border: 1px solid #a5a6a7;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    color: black;
    background: white;
    font-size: 14px;
    transition: all 0.2s ease;
}

.toggle-fullscreen{
    position: absolute;
    right: 0;
    z-index: 1001;
    top: 0;
}

.fullscreen-toggle:hover {
    background-color: #f3f4f6;
}

/* Styles pour le mode plein écran de l'éditeur JSON */
.json-editor-container {
    max-height: 700px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

.json-editor-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    box-sizing: border-box;
    z-index: 1000;
    max-height: none;
    background-color: white;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

/* Ajustement de la hauteur de l'éditeur en mode plein écran */
.json-editor-container.fullscreen .jse-main {
    height: calc(100vh - 50px) !important;
}

/* Pas besoin de décalage supplémentaire car les panneaux ont maintenant un padding de 0 */
.panel:nth-child(2) {
    padding-top: 0;
    background: #f3f4f6;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    h1 {
        width: 100%;
    }
    
    .panel {
        height: auto;
        min-height: 100vh;
    }
    
    #chat-box {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .panel {
        padding: 12px;
    }
    
    h1 {
        font-size: 1rem;
        padding: 10px;
    }
}