/* ============================================
   GROEPJESMAKER - Stylesheet
   ============================================ */

.groepjesmaker-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 20px 0;
}

/* ---------- Empty State ---------- */
.groepjesmaker-empty {
    text-align: center;
    padding: 40px 20px;
}

.groepjesmaker-empty .empty-icon {
    font-size: 56px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}

.groepjesmaker-empty p {
    color: var(--text-medium);
    font-size: 16px;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* ---------- Shuffle Button ---------- */
/* Base styles inherited from .tool-action-btn in style.css */

/* ---------- Groups Result Grid ---------- */
.groepjes-result {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    width: 100%;
}

.groepje-card {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    animation: cardFadeIn 0.4s ease forwards;
    opacity: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

@keyframes cardFadeIn {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.groepje-header {
    padding: 12px 16px;
    font-weight: 700;
    font-size: 15px;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.groepje-header .groepje-count {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.85;
    margin-left: auto;
}

.groepje-body {
    padding: 8px 16px;
}

.groepje-body .student-name {
    padding: 8px 0;
    font-size: 15px;
    color: var(--text-dark);
    border-bottom: 1px solid #E8E8F0;
}

.groepje-body .student-name:last-child {
    border-bottom: none;
}

/* Colors for group headers - rotating through accent colors */
.groepje-card:nth-child(8n+1) .groepje-header { background: var(--primary); }
.groepje-card:nth-child(8n+2) .groepje-header { background: var(--accent-green); }
.groepje-card:nth-child(8n+3) .groepje-header { background: var(--accent-orange); }
.groepje-card:nth-child(8n+4) .groepje-header { background: var(--accent-cyan); }
.groepje-card:nth-child(8n+5) .groepje-header { background: var(--accent-pink); }
.groepje-card:nth-child(8n+6) .groepje-header { background: var(--accent-blue); }
.groepje-card:nth-child(8n+7) .groepje-header { background: var(--primary-dark); }
.groepje-card:nth-child(8n+8) .groepje-header { background: var(--accent-yellow); color: var(--text-dark); }

/* ---------- Settings Specific ---------- */
.settings-divider {
    border: none;
    border-top: 1px solid #F0F0F5;
    margin: 16px 0;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
}

.radio-option input[type="radio"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .groepjes-result {
        grid-template-columns: 1fr;
    }

    .groepjesmaker-container {
        gap: 20px;
    }
}

/* ---------- Sociogram-integratie ---------- */
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    user-select: none;
    font-weight: 600;
}

.checkbox-option input[type="checkbox"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.form-hint {
    font-size: 12px;
    color: var(--text-medium);
    margin: 8px 0 0 28px;
    line-height: 1.5;
}

.form-warning {
    font-size: 12px;
    color: #6D4C41;
    margin: 8px 0 0 28px;
    line-height: 1.5;
    padding: 8px 12px;
    background: #FFF8E1;
    border: 1px solid #FFD54F;
    border-radius: 6px;
}

.sociogram-mode {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0 0 28px;
    padding-top: 12px;
    border-top: 1px dashed #E6E8F0;
}
.sociogram-mode .radio-option {
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.4;
}

.form-warning a {
    color: var(--primary);
    font-weight: 600;
}

/* Subtiel info-icoon (rechtsboven) dat aangeeft dat sociogram is toegepast */
.groepjes-info-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
    width: 100%;
    grid-column: 1 / -1; /* span over hele grid breedte */
}

.groepjes-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    cursor: help;
    position: relative;
    opacity: 0.7;
    transition: opacity 0.15s;
    user-select: none;
}

.groepjes-info-icon:hover,
.groepjes-info-icon:focus {
    opacity: 1;
    outline: none;
}

/* Tooltip via pseudo-elementen */
.groepjes-info-icon::before,
.groepjes-info-icon::after {
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.groepjes-info-icon::before {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    right: calc(100% + 12px);
    transform: translateY(-50%);
    background: #2D3436;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-style: normal;
    line-height: 1.6;
    white-space: pre-line;
    width: max-content;
    max-width: 280px;
    text-align: left;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.groepjes-info-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    right: calc(100% + 6px);
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #2D3436;
    z-index: 100;
}

.groepjes-info-icon:hover::before,
.groepjes-info-icon:focus::before,
.groepjes-info-icon:hover::after,
.groepjes-info-icon:focus::after {
    opacity: 1;
}

/* Mobile: tooltip onder het icoon ipv ernaast */
@media (max-width: 600px) {
    .groepjes-info-icon::before {
        top: calc(100% + 12px);
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        max-width: 240px;
    }
    .groepjes-info-icon::after {
        top: calc(100% + 6px);
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        border-left-color: transparent;
        border-bottom-color: #2D3436;
    }
}
