/* Pages IA professeur : Ressources IA et Analyse de documents */

#prof-ia-module.pia-module-page { max-width: 1420px; margin: 18px auto 32px; padding: 0 16px; box-sizing: border-box; }
#prof-ia-module .pia-module-header {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px;
}
#prof-ia-module .pia-module-title { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2.1rem); color: var(--pia-title, #0f4c81); }
#prof-ia-module .pia-module-header .pia-subtitle { margin: 6px 0 0; max-width: 70ch; }
#prof-ia-module .pia-module-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#prof-ia-module .pia-upgrade-link { text-decoration: none; background: #fff4d6; color: #8a5a00; border-color: #f5d48a; font-weight: 700; }

#prof-ia-module .pia-module-nav {
    display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; padding: 5px;
    background: #eef4fb; border-radius: 14px; width: fit-content; max-width: 100%; box-sizing: border-box;
}
#prof-ia-module .pia-module-nav a {
    text-decoration: none; color: #334155; font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 10px; white-space: nowrap;
}
#prof-ia-module .pia-module-nav a:hover { background: rgba(255, 255, 255, .7); }
#prof-ia-module .pia-module-nav a.active { background: #fff; color: #0f4c81; box-shadow: 0 1px 4px rgba(15, 76, 129, .15); }

#prof-ia-module .pia-module-denied { max-width: 560px; margin: 40px auto; text-align: center; background: #fff; border: 1px solid var(--pia-border, #dbe7f3); border-radius: 20px; padding: 32px 24px; }
#prof-ia-module .pia-module-denied-icon { font-size: 40px; }

/* Les deux colonnes : la colonne de droite prend la hauteur de son contenu */
#prof-ia-module.pia-module-page .pia-stage { padding: 18px; min-height: 460px; overflow: visible; }
#prof-ia-module.pia-module-page .pia-topbar { padding: 14px 18px; border-bottom: 1px solid var(--pia-border, #dbe7f3); }
#prof-ia-module.pia-module-page .pia-topbar-title { font-weight: 800; color: var(--pia-title, #0f4c81); }
#prof-ia-module.pia-module-page .pia-tabs-top { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 12px 0; }
#prof-ia-module.pia-module-page #status { padding: 0 18px 14px; min-height: 1.2em; }

/* Onglets Ressources IA */
#prof-ia-module.pia-module-page .pia-tab-panel { display: none; }
#prof-ia-module.pia-module-page .pia-tab-panel.active { display: block; }
#prof-ia-module[data-active-tab="outils"] .pia-res-shell { display: none; }

/* Formulaires */
#prof-ia-module .pia-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#prof-ia-module .pia-check-row { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 14px; color: #334155; }
#prof-ia-module .pia-check-row label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
#prof-ia-module .pia-choice-group { margin: 14px 0 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
#prof-ia-module .pia-choices-compact { margin: 0 0 6px; gap: 6px; }
#prof-ia-module .pia-choices-compact .pia-outil-card { padding: 8px 10px; }
#prof-ia-module .pia-choices-compact .pia-outil-icon { font-size: 18px; }

/* Dépôt de fichier */
#prof-ia-module .pia-dropzone {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
    padding: 18px 12px; border: 2px dashed #b9cde4; border-radius: 16px; background: #f8fbff; cursor: pointer; transition: border-color .15s, background .15s;
}
#prof-ia-module .pia-dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
#prof-ia-module .pia-dropzone:hover, #prof-ia-module .pia-dropzone.is-over { border-color: var(--pia-blue, #1565c0); background: #eef6ff; }
#prof-ia-module .pia-dropzone:focus-within { outline: 2px solid var(--pia-blue, #1565c0); outline-offset: 2px; }
#prof-ia-module .pia-dropzone.has-file { border-style: solid; border-color: #86c79a; background: #f2fbf4; }
#prof-ia-module .pia-dropzone-icon { font-size: 26px; }
#prof-ia-module .pia-dropzone-text { font-size: 14px; word-break: break-word; }
#prof-ia-module .pia-paste { margin: 10px 0 4px; }
#prof-ia-module .pia-paste summary { cursor: pointer; color: var(--pia-blue, #1565c0); font-weight: 600; font-size: 14px; margin-bottom: 8px; }

/* Document généré */
#prof-ia-module.pia-module-page #res-output .pia-doc,
#prof-ia-module.pia-module-page #ana-output .pia-doc { border-radius: 16px; }
#prof-ia-module .pia-refine { margin-top: 16px; padding: 14px; border: 1px solid var(--pia-border, #dbe7f3); border-radius: 16px; background: #fff; }
#prof-ia-module .pia-refine small { font-weight: 400; color: #64748b; }
#prof-ia-module .pia-refine-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
#prof-ia-module .pia-refine-chips button {
    border: 1px solid #c7d7ea; background: #f7fbff; color: #0f4c81; border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; cursor: pointer;
}
#prof-ia-module .pia-refine-chips button:hover { background: #e8f1fb; }
#prof-ia-module .pia-refine-row { display: flex; gap: 8px; align-items: flex-end; }
#prof-ia-module .pia-refine-row .pia-textarea { min-height: 56px; flex: 1; }
#prof-ia-module button:disabled { opacity: .55; cursor: wait; }

/* Derniers documents */
#prof-ia-module .pia-recent { margin-top: 20px; border-top: 1px solid var(--pia-border, #dbe7f3); padding-top: 12px; }
#prof-ia-module .pia-recent h3 { margin: 0; font-size: 15px; color: var(--pia-title, #0f4c81); }
#prof-ia-module .pia-recent ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
#prof-ia-module .pia-recent li { display: flex; align-items: stretch; gap: 4px; }
#prof-ia-module .pia-recent li > button:first-child {
    flex: 1; min-width: 0; text-align: left; border: 1px solid #e2e8f0; background: #fff; border-radius: 10px; padding: 7px 10px; cursor: pointer;
    display: flex; flex-direction: column;
}
#prof-ia-module .pia-recent li > button:first-child:hover { border-color: #9cc0e6; }
#prof-ia-module .pia-recent strong { font-size: 13.5px; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#prof-ia-module .pia-recent small { font-size: 12px; color: #64748b; }
#prof-ia-module .pia-recent-del { border: 0; background: none; color: #94a3b8; font-size: 18px; cursor: pointer; padding: 0 6px; }
#prof-ia-module .pia-recent-del:hover { color: #b91c1c; }

@media (max-width: 760px) {
    #prof-ia-module .pia-field-row { grid-template-columns: 1fr; }
    #prof-ia-module.pia-module-page .pia-stage { padding: 12px; }
    #prof-ia-module .pia-refine-row { flex-direction: column; align-items: stretch; }
    #prof-ia-module .pia-module-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
}

/* Symboles électrotechniques dans les documents */
#prof-ia-module .pia-ai-symbol {
    margin: 18px auto; padding: 14px 16px; max-width: 320px; text-align: center; background: #fff;
    border: 1px solid #dbe3ee; border-radius: 12px; break-inside: avoid;
}
#prof-ia-module .pia-ai-symbol-img { display: block; width: auto; max-width: 100%; height: auto; max-height: 180px; margin: 0 auto; object-fit: contain; }
#prof-ia-module .pia-ai-symbol figcaption { margin-top: 8px; color: #475569; font-size: .9rem; font-style: italic; }
#prof-ia-module td .pia-ai-symbol { margin: 4px auto; padding: 6px; }
#prof-ia-module td .pia-ai-symbol-img { max-height: 90px; }
#prof-ia-module .pia-visual-placeholder { margin: 16px 0; padding: 12px 14px; background: #f8fafc; border: 2px dashed #94a3b8; border-radius: 10px; color: #334155; }
#prof-ia-module.pia-module-page .pia-outils-toolbar { background: #fff; border-radius: 12px; padding: 8px; box-shadow: 0 4px 12px rgba(15, 76, 129, .08); }

/* Analyse de documents : choix de la source et envoi des vidéos */
#prof-ia-module .pia-source-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 10px; }
#prof-ia-module .pia-source-tabs button {
    border: 1.5px solid var(--pia-border, #dbe7f3); background: #fff; color: #334155; border-radius: 12px;
    padding: 8px 6px; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
#prof-ia-module .pia-source-tabs button:hover { border-color: #9cc0e6; }
#prof-ia-module .pia-source-tabs button.active { border-color: var(--pia-blue, #1565c0); background: #f1f7ff; color: #0f4c81; box-shadow: 0 0 0 3px rgba(21, 101, 192, .12); }
#prof-ia-module .pia-source-pane { margin-bottom: 6px; }
#prof-ia-module .pia-source-pane > .pia-help-text { margin-top: 8px; }
#prof-ia-module .pia-media-progress { margin-top: 10px; }
#prof-ia-module .pia-media-bar { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
#prof-ia-module .pia-media-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #1565c0, #2e7d32); transition: width .3s; }
#prof-ia-module .pia-media-bar span.is-error { background: #dc2626; }
#prof-ia-module #ana-media-state { margin-top: 6px; }

/* Résumé audio / vidéo */
#prof-ia-module .pia-resume-opts { margin: 4px 0 8px; padding: 12px; border-radius: 14px; background: #f1f7ff; border: 1px solid #c7d7ea; }
#prof-ia-module .pia-resume-opts .pia-field { margin-bottom: 8px; }
#prof-ia-module .pia-av-card { background: #fff; border: 1px solid var(--pia-border, #dbe7f3); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
#prof-ia-module .pia-av-head { font-size: 1.05rem; color: var(--pia-title, #0f4c81); margin-bottom: 10px; }
#prof-ia-module .pia-av-card audio { width: 100%; margin: 6px 0 10px; }
#prof-ia-module .pia-av-stage { position: relative; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 18px rgba(15, 76, 129, .15); background: #0f172a; }
#prof-ia-module .pia-av-stage canvas { display: block; width: 100%; height: auto; cursor: pointer; }
#prof-ia-module .pia-av-play {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 78px; height: 78px; border-radius: 50%;
    border: 0; background: rgba(15, 76, 129, .88); color: #fff; font-size: 30px; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
#prof-ia-module .pia-av-play:hover { background: #1565c0; }
#prof-ia-module .pia-av-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#prof-ia-module .pia-av-actions a.po-tb-btn { text-decoration: none; display: inline-flex; align-items: center; }
#prof-ia-module .pia-av-card .pia-media-bar { margin-top: 8px; }

/* Titre et sous-titre lisibles quels que soient les styles du site */
#prof-ia-module.pia-module-page .pia-module-title { font-weight: 800; color: #0f4c81; }
#prof-ia-module.pia-module-page .pia-module-header .pia-subtitle { color: #475569 !important; font-size: 15px; opacity: 1; text-shadow: none; }

/* Statut et crédits sous le bandeau */
#prof-ia-module .pia-module-badges-row { justify-content: flex-end; margin: -6px 0 14px; }
