/* ============================================
   MEESTERTOOLS - Sfeercijfer
   Volg het groepsklimaat over tijd met één cijfer per dag,
   door de leerkracht en/of via een klassikale ronde.
   ============================================ */

/* ---------- Klasbalk ---------- */
.sf-classbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.sf-classbar-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
}
.sf-classbar-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
}
.sf-classbar-field select {
    padding: 10px 12px;
    border: 1.5px solid #E2E5F0;
    border-radius: var(--radius-md);
    background: var(--bg-white);
    font-size: 15px;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}
.sf-classbar-field select:focus { outline: none; border-color: var(--primary); }

/* ---------- Lege staat ---------- */
.sf-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-medium);
}
.sf-empty-icon { font-size: 48px; margin-bottom: 16px; }
.sf-empty p { font-size: 16px; line-height: 1.6; }

/* ---------- Secties ---------- */
.sf-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

/* ---------- Vandaag ---------- */
.sf-today { margin-bottom: 36px; }
.sf-today-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.sf-today-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    text-transform: capitalize;
}
.sf-today-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.sf-panel {
    background: var(--bg-white);
    border: 1px solid #ECEEF6;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.sf-panel-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 4px;
}
.sf-panel-sub {
    font-size: 13.5px;
    color: var(--text-medium);
    line-height: 1.45;
    margin: 0 0 16px;
}

/* ---------- Cijferschaal ---------- */
.sf-scale {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
}
.sf-scale-btn {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 2px solid #E2E5F0;
    border-radius: var(--radius-md);
    background: var(--bg-white);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-medium);
    cursor: pointer;
    transition: transform .12s ease, border-color .12s ease, background .12s ease, color .12s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sf-scale-btn:hover { transform: translateY(-2px); }
.sf-scale-btn.selected {
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-md);
}
.sf-scale-btn.clicked { animation: sfPop .35s ease; }
@keyframes sfPop {
    0% { transform: scale(1); }
    45% { transform: scale(1.18); }
    100% { transform: scale(1); }
}
/* Tally-badge voor de klassikale ronde */
.sf-scale-btn .sf-tally {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 19px;
    height: 19px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

/* ---------- Notitie ---------- */
.sf-note {
    width: 100%;
    box-sizing: border-box;
    margin-top: 14px;
    min-height: 60px;
    resize: vertical;
    padding: 10px 12px;
    border: 1.5px solid #E2E5F0;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-dark);
    transition: var(--transition);
}
.sf-note:focus { outline: none; border-color: var(--primary); }
.sf-note::placeholder { color: var(--text-light); }

/* ---------- Ronde-resultaat ---------- */
.sf-round-result {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    min-height: 56px;
}
.sf-round-avg {
    font-size: 38px;
    font-weight: 800;
    line-height: 1;
    color: var(--text-dark);
}
.sf-round-avg.empty { color: var(--text-light); font-size: 26px; }
.sf-round-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-medium);
}
.sf-round-bar {
    display: flex;
    height: 8px;
    width: 130px;
    border-radius: 999px;
    overflow: hidden;
    background: #EEF0F6;
}
.sf-round-bar span { display: block; height: 100%; }

.sf-round-actions { margin-top: 14px; }
.sf-link-btn {
    background: none;
    border: none;
    color: var(--text-medium);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 2px;
    transition: var(--transition);
}
.sf-link-btn:hover { color: #E5484D; }

/* ---------- Verloop ---------- */
.sf-trend { margin-bottom: 36px; }
.sf-trend-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}
.sf-period {
    display: inline-flex;
    background: #EEF0F6;
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}
.sf-period button {
    border: none;
    background: none;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    transition: var(--transition);
}
.sf-period button.active {
    background: var(--bg-white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.sf-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 8px;
}
.sf-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-medium);
}
.sf-legend-line {
    width: 22px;
    height: 0;
    border-top: 3px solid var(--primary);
    border-radius: 3px;
}
.sf-legend-class { border-top-style: dashed; border-top-color: #2BA24C; }

.sf-chart-wrap {
    position: relative;
    background: var(--bg-white);
    border: 1px solid #ECEEF6;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 12px;
}
.sf-chart-wrap svg { display: block; width: 100%; height: auto; }

.sf-grid-line { stroke: #EEF0F6; stroke-width: 1; }
.sf-axis-label { fill: var(--text-light); font-size: 12px; }
.sf-line-teacher { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.sf-line-class { fill: none; stroke: #2BA24C; stroke-width: 3; stroke-dasharray: 6 5; stroke-linejoin: round; stroke-linecap: round; }
.sf-dot-teacher { fill: var(--primary); cursor: pointer; }
.sf-dot-class { fill: #2BA24C; cursor: pointer; }
.sf-dot-note { stroke: #E08A00; stroke-width: 2.5; fill: #fff; }

.sf-tooltip {
    position: absolute;
    pointer-events: none;
    background: #2A2A3C;
    color: #fff;
    font-size: 12.5px;
    line-height: 1.5;
    padding: 8px 11px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translate(-50%, -100%);
    transition: opacity .12s ease;
    white-space: nowrap;
    z-index: 5;
    max-width: 240px;
}
.sf-tooltip.visible { opacity: 1; }
.sf-tooltip strong { color: #fff; }
.sf-tooltip .sf-tt-note { display: block; margin-top: 4px; color: #C9C9DD; white-space: normal; font-style: italic; }

.sf-chart-empty {
    text-align: center;
    padding: 40px 24px;
    background: var(--bg-white);
    border: 1px dashed #D7DBEA;
    border-radius: var(--radius-lg);
    color: var(--text-medium);
    font-size: 15px;
    line-height: 1.55;
}

/* ---------- Logboek ---------- */
.sf-log-section { margin-bottom: 12px; }
.sf-log {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}
.sf-log-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-white);
    border: 1px solid #ECEEF6;
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
}
.sf-log-date {
    flex: none;
    width: 96px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    text-transform: capitalize;
}
.sf-log-scores { display: flex; gap: 8px; flex: none; }
.sf-log-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}
.sf-log-chip small { font-weight: 600; font-size: 11px; opacity: .8; }
.sf-log-chip.teacher { background: #EEEDFB; color: var(--primary); }
.sf-log-chip.class { background: #E7F6EB; color: #2BA24C; }
.sf-log-note {
    flex: 1;
    font-size: 13.5px;
    color: var(--text-medium);
    line-height: 1.4;
    min-width: 0;
}
.sf-log-del {
    flex: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.sf-log-del:hover { color: #E5484D; background: #FDECEC; }

.sf-log-empty {
    text-align: center;
    padding: 28px 24px;
    color: var(--text-medium);
    font-size: 15px;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .sf-today-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .sf-classbar-field { min-width: 100%; }
    .sf-scale-btn { font-size: 14px; }
    .sf-log-row { flex-wrap: wrap; }
    .sf-log-note { flex-basis: 100%; order: 3; }
}
