/*
 Theme Name:   Astra Child
 Template:     astra
*/
/* CSS de base pour les conteneurs d'activités Botmath */
.botmath-activity-content {
    margin: 20px auto;
    padding: 20px;
    max-width: 900px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fdfdfd;
}
/* Style pour le Tableau de Bord Élève */
.botmath-dashboard {
    font-family: sans-serif;
}

.periods-container {
    display: grid;
    gap: 20px;
}

.period-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.period-item h3 {
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.period-item ul {
    list-style-type: none;
    padding-left: 35px;
}

.period-item li {
    margin-bottom: 10px;
    padding: 5px;
    background: #f9f9f9;
    border-radius: 4px;
}

.period-item li a {
    text-decoration: none;
    color: #005a9c;
    font-weight: bold;
}

.score-badge {
    float: right;
    background-color: #e0e0e0;
    color: #333;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.9em;
}

/* Style pour les status */
.period-item.status-locked {
    background-color: #f5f5f5;
    opacity: 0.6;
}

.period-item.status-unlocked {
    border-left: 5px solid #2196F3; /* Bleu */
}

.period-item.status-completed {
    border-left: 5px solid #4CAF50; /* Vert */
}

.period-item.status-completed .score-badge {
    background-color: #4CAF50;
    color: white;
}
/* Style pour le Tableau de Bord Parental */
.botmath-parent-dashboard .students-container,
.botmath-teacher-dashboard .students-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.botmath-parent-dashboard .student-summary-card {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px 20px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.botmath-parent-dashboard .student-summary-card h3 {
    margin-top: 5px;
    color: #005a9c;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.botmath-parent-dashboard .student-summary-card p {
    margin: 10px 0;
    font-size: 1em;
}

.botmath-parent-dashboard .student-summary-card strong {
    color: #333;
}
/* Style pour le lien "Détails" */
.details-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.9em;
    text-decoration: none;
    color: #0073aa;
    font-weight: bold;
}
.details-link:hover {
    text-decoration: underline;
}

/* Style pour la page de rapport détaillé */
.botmath-student-details-page {
    max-width: 800px;
    margin: 20px auto;
}
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.results-table th, .results-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}
.results-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}
.results-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}
/* --- Style pour le Pop-up des Activités --- */
#botmath-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#botmath-popup-container {
    width: 1000px;
    height: 700px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

#botmath-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
}

#botmath-popup-header h3 {
    margin: 0;
    font-size: 1.2em;
}

#botmath-popup-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
}

#botmath-popup-content {
    flex-grow: 1;
    overflow-y: auto; /* La barre de scroll verticale ! */
    padding: 20px;
    position: relative;
}

#botmath-popup-footer {
    padding: 10px 20px;
    border-top: 1px solid #ddd;
    text-align: right;
}

#botmath-popup-footer button {
    padding: 8px 15px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-left: 10px;
}

#botmath-popup-footer button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Style pour le lien dans la liste */
.botmath-open-activity {
    cursor: pointer;
}

/* Loader simple */
.loader {
    border: 8px solid #f3f3f3;
    border-radius: 50%;
    border-top: 8px solid #3498db;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -30px;
    margin-left: -30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* ============================================= */
/* == AMÉLIORATIONS POP-UP & GEOGEBRA == */
/* ============================================= */

/* Rend le conteneur du pop-up plus flexible */
#botmath-popup-container {
    width: 95%;
    max-width: 1000px; /* Largeur maximale */
    height: 90vh;      /* Hauteur maximale (90% de la hauteur de l'écran) */
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

/* Centre le titre et repositionne le bouton "Fermer" */
#botmath-popup-header {
    display: flex;
    justify-content: center; /* Centre le titre horizontalement */
    align-items: center;     /* Centre le titre verticalement */
    position: relative;      /* Contexte pour le positionnement du bouton */
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
}

#botmath-popup-close {
    position: absolute;      /* Sort le bouton du flux normal */
    right: 15px;             /* Le place à droite */
    top: 50%;
    transform: translateY(-50%); /* Alignement vertical parfait */
}

/* Assure que l'iframe GeoGebra remplit l'espace disponible */
.botmath-geogebra-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.botmath-geogebra-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ============================================= */
/* == STYLE POUR LA NAVIGATION DU POP-UP       == */
/* ============================================= */

#botmath-popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#botmath-popup-footer button {
    font-size: 1em;
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

#botmath-popup-footer button:hover {
    background-color: #e0e0e0;
}

/* Le bouton "Suivant" est plus visible */
#botmath-popup-next {
    background-color: #2196F3;
    color: white;
    border-color: #2196F3;
}

#botmath-popup-next:hover {
    background-color: #1976D2;
}

/* Le bouton "Terminer" a un style final */
#botmath-popup-footer button#botmath-popup-close {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

#botmath-popup-footer button#botmath-popup-close:hover {
    background-color: #388E3C;
}
/* ============================================= */
/* == STYLE POUR LE NOUVEAU BOUTON FLOTTANT    == */
/* ============================================= */

.lancer-sequence-evaluations-flottant {
    position: fixed; /* Il flotte par-dessus tout */
    top: 100px;
    right: 30px;
    z-index: 999; /* Juste en dessous du pop-up */
    
    background-color: #054e48; /* Une couleur de votre thème */
    color: #ffffff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    text-decoration: none;
    transition: transform 0.2s ease;
}

.lancer-sequence-evaluations-flottant:hover {
    transform: scale(1.1);
    color: #ffffff;
}

.lancer-sequence-evaluations-flottant .dashicons {
    font-size: 28px;
    width: auto;
    height: auto;
}
/* Correction affichage pop-up Botmath */
#botmath-popup-overlay {
  display: none; /* Sera modifié en display:flex ou block par JS */
  position: fixed;
  z-index: 9999;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.2);
  justify-content: center;
  align-items: center;
}
#botmath-popup-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  max-width: 600px;
  width: 98vw;
  max-height: 90vh;
  overflow: auto;
  padding: 16px;
}
/* Force l'affichage correct du pop-up Botmath sur toutes les pages */
#botmath-popup-overlay {
  display: none; /* affiché/display: flex par JS */
  position: fixed !important;
  z-index: 99999 !important;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.3) !important;
  justify-content: center;
  align-items: center;
  opacity: 1 !important;
  visibility: visible !important;
}
#botmath-popup-overlay[style*="display: flex"] {
  display: flex !important;
}
#botmath-popup-overlay[style*="display: block"] {
  display: flex !important;
}
#botmath-popup-container {
  background: #fff !important;
  color: #222;
  max-width: 600px;
  width: 98vw;
  min-width: 240px;
  min-height: 60px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 100000;
  position: relative;
  margin: auto;
  padding: 18px;
}
.botmath-popup-footer-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
}
.botmath-popup-nav, .botmath-popup-close {
  background: #43b047;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 16px;
  margin: 0;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}
.botmath-popup-nav:hover, .botmath-popup-close:hover {
  background: #38853d;
}
.botmath-popup-footer-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 10px 0 10px;
}
.botmath-popup-nav, .botmath-popup-close {
  background: #43b047;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 7px 18px;
  cursor: pointer;
  font-size: 16px;
  margin-left: 0;
  box-shadow: 0 1px 8px rgba(60,120,60,0.07);
}
.botmath-popup-nav:hover, .botmath-popup-close:hover {
  background: #319234;
}
