/* ==========================================================================
   Interactive Components
   ========================================================================== */

/* Generic wrapper for interactive blocks */
.interactive-block {
    background-color: var(--white);
    padding: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-radius: var(--border-radius-large);
    border: 1px solid var(--medium-gray);
    box-shadow: var(--shadow);
    position: relative;
}

.interactive-block-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.interactive-block-header .icon {
    width: 32px;
    height: 32px;
    margin-right: 15px;
}

.interactive-block-header h4 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--primary-purple);
}

.interactive-block-content {
    padding-top: 1rem;
    border-top: 1px solid var(--medium-gray);
}


/* Multiple Choice (MC) Questions */
.mc-question {
    margin-bottom: 2rem;
}

.mc-question .interaction-title,
.mc-question h4 {
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
}

.mc-options {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.mc-option {
    padding: 0.8rem 1rem;
    margin: 0.5rem 0;
    background-color: var(--background-light-gray);
    border: 1px solid var(--border-color-medium);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mc-option:hover {
    background-color: var(--background-medium-gray);
    border-color: var(--border-color-dark);
}

.mc-option.selected {
    background-color: var(--info-background);
    border-color: var(--info-border);
}

.mc-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Using combined classes from styles.css for review */
.mc-option.selected.correct,
.mc-option.answered.correct {
    background-color: var(--success-background);
    border-color: var(--success-border);
    color: var(--success-text);
}

.mc-option.selected.incorrect,
.mc-option.answered.incorrect {
    background-color: var(--error-background);
    border-color: var(--error-border);
    color: var(--error-text);
}

.feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
    display: none; /* Hide by default */
}

.feedback.correct {
    display: block; /* Show when correct */
    background-color: var(--success-background);
    color: var(--success-text);
    border: 1px solid var(--success-border-light);
}

.feedback.incorrect {
    display: block; /* Show when incorrect */
    background-color: var(--error-background);
    color: var(--error-text);
    border: 1px solid var(--error-border-light);
}


/* Drag and Drop Exercise */
.interactive-exercise {
    background: var(--background-light-gray);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.drag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.draggable {
    background: var(--info-blue);
    color: var(--white);
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    cursor: move;
    user-select: none;
    transition: background 0.3s ease;
}

.draggable:hover {
    background: var(--info-blue-dark);
}

.drop-targets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.drop-target {
    border: 2px dashed var(--border-color-dashed);
    border-radius: 8px;
    padding: 1rem;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    transition: background 0.3s ease;
}

.drop-target.dragover {
    background: rgba(52, 152, 219, 0.1); /* This is a very light version of info-blue, rgba is tricky for a variable */
    border-color: var(--info-blue);
}

.drop-target h4 {
    margin-bottom: 0.5rem;
}

.drop-target .draggable {
    margin-top: 0.5rem;
    width: 90%;
}

.interactive-block .btn {
    margin-top: 1.5rem;
}

/* Flashcard component */
.flashcard-container {

}
.flashcard-stack { perspective: 1000px; margin: 2rem 0; }
.flashcard {
  width: 100%;
  min-height: 280px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-inner { 
  position: relative; 
  width: 100%; 
  height: 100%; 
  text-align: center; 
  transform-style: preserve-3d; 
  transition: transform 0.6s; 
  display: grid;
}
.flashcard-front,
.flashcard-back {
  grid-row: 1;
  grid-column: 1;
  width: 100%; 
  backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.flashcard-front {
  background: var(--white);
  border: 2px solid var(--primary-purple);
}
.flashcard-back {
  background: var(--accent-purple);
  border: 2px solid var(--secondary-purple);
  transform: rotateY(180deg);
  flex-direction: column;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  justify-content: space-between;
  min-height: 220px;
}
.flashcard p { font-size: 1.2rem; margin: 0; color: var(--dark-gray); }
.flashcard-answer-buttons { margin-top: 1rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.flashcard-controls { display: flex; gap: 1rem; justify-content: center; margin: 1rem 0; }
.flashcard-status { text-align: center; margin: 1rem 0; color: var(--dark-gray); }
.flashcard-feedback { text-align: center; margin: 1rem 0; min-height: 2rem; }
@media (max-width: 768px) {
  .flashcard { min-height: 260px; }
  .flashcard p { font-size: 1rem; }
  .flashcard-answer-buttons { flex-direction: column; }
}
/* extra classes die in back html gebruikt worden */
.flashcard-repeat-label { 
  font-size: 0.95em; 
  color: var(--primary-purple); 
  font-weight: 600; 
  width: 100%;
  text-align: right;
  margin-bottom: 0; 
}
.flashcard-answer-text { font-size: 1.15em; text-align: center; margin-bottom: 2rem; }
.flashcard-answer-buttons .btn { min-width: 120px; font-size: 1em; border-radius: 24px; padding: 0.75em 1.5em; }

/* ==========================================================================
   Form & Input Components
   ========================================================================== */

/* Reflection Blocks */
.reflection-container {
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.reflection-question {
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--dark-purple);
}

.reflection-input {
    width: 100%;
    min-height: 120px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 0.75rem;
    transition: border-color 0.3s;
}

.reflection-input:focus {
    outline: none;
    border-color: var(--primary-purple);
}

.reflection-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.char-counter {
    font-size: 0.8rem;
    color: #6c757d; /* Standaard subtiele kleur */
    text-align: right;
    flex-grow: 1;
}

.char-counter.low {
    color: #dc3545; /* Zelfde kleur als 'incorrect' */
}

.char-counter.warning {
    color: #fd7e14; /* Oranje waarschuwing */
}

.char-counter.error {
    color: #dc3545; /* Rood voor fout (over limiet) */
    font-weight: bold;
}

.btn-save-reflection {
    /* De knop hoeft geen speciale flex-eigenschappen te hebben */
}

.feedback-message {
    margin-top: 10px;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 4px;
    display: none; /* Initially hidden */
}

/* General Form Styling (used in Critical Analysis etc.) */
.analysis-form, .form-container { /* .form-container as a generic alternative */
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-gray);
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background-color: var(--light-gray);
}

.form-control:focus {
    border-color: var(--primary-purple);
    background-color: var(--white);
    box-shadow: 0 0 0 3px var(--accent-purple);
    outline: none;
}

/* General select styling */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%232c3e50' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

/* Name input for PDF generation */
.name-input-container {
    margin: 2rem 0;
}

.name-input {
    width: 100%;
    max-width: 400px;
    padding: 0.8rem;
    margin-top: 0.5rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 1rem;
}

/* Competency Assessment */
.competency-assessment {
    background-color: var(--accent-purple);
    border-radius: var(--border-radius-large);
    padding: 2rem;
    margin-top: 1.5rem;
}

.assessment-scale {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background-color: var(--white);
    border-radius: var(--border-radius-standard);
    font-size: 0.9rem;
}

.assessment-scale span {
    color: var(--dark-gray);
}

.assessment-grid {
    display: grid;
    gap: 1.5rem;
}

.assessment-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
}

.assessment-item label {
    font-weight: 500;
}

.assessment-select {
    padding: 0.5rem;
    border-radius: var(--border-radius-standard);
    border: 1px solid var(--medium-gray);
    min-width: 150px;
}

.assessment-select:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 2px var(--accent-purple);
}

.competency-assessment .btn {
    margin-top: 1.5rem;
    display: block;
    width: fit-content;
}
