/* IAula — Custom styles */

/* =============================================
   LAYOUT — Gmail-style
   ============================================= */

body {
    margin: 0;
    background-color: #f0f4f9;        /* page background */
}

/* --- Top red banner --- */
.header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: #dc2626;
    z-index: 70;
    display: flex;
    align-items: center;
}

.header-menu-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: background-color 0.2s ease;
}

.header-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* --- Area below the banner --- */
.below-header {
    display: flex;
    padding-top: 56px;                /* height of the banner */
    min-height: calc(100vh - 56px);
    overflow: hidden;                 /* hide sidebar when off-screen */
}

/* --- Sidebar --- */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background-color: #f0f4f9;        /* same as page background */
    overflow-y: auto;
    margin-left: 0;                   /* open by default */
    transition: margin-left 0.3s ease;
}

.sidebar.closed {
    margin-left: -220px;
}



.sidebar-link {
    display: block;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    color: #1f2937;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.sidebar-link:hover {
    background-color: #e2e6eb;
}

.sidebar-link.active {
    background-color: #fecaca;
    color: #b91c1c;
    font-weight: 600;
}

/* --- Collapsible menu categories --- */
.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-category {
    margin-bottom: 2px;
}

.menu-category-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.menu-category-btn:hover {
    background-color: #e2e6eb;
}

.menu-chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.menu-category.open .menu-chevron {
    transform: rotate(180deg);
}

.menu-sub {
    list-style: none;
    padding: 0 0 0 12px;
    margin: 2px 0 4px 0;
}

.menu-sub.hidden {
    display: none;
}

/* --- Page content wrapper --- */
.page-wrapper {
    flex: 1;
    min-width: 0;
    padding: 12px 16px 0 16px;
    transition: flex 0.3s ease;
}

/* --- White rounded content card --- */
.content-card {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 32px;
    min-height: calc(100vh - 56px - 60px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* --- Load more button --- */
.load-more-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 32px;
    padding-top: 24px;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    background-color: #dc2626;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s;
}

.load-more-btn:hover {
    background-color: #b91c1c;
    transform: translateY(-1px);
}

.load-more-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.load-more-status {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Smooth transition for feedback icons */
.feedback-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: scale(0.5);
    flex-shrink: 0;
}

.feedback-icon.visible {
    opacity: 1;
    transform: scale(1);
}

.feedback-icon.correct {
    background-color: #dcfce7;
    color: #16a34a;
}

.feedback-icon.incorrect {
    background-color: #fee2e2;
    color: #dc2626;
}

/* =============================================
   CHECKBOX FILTER TREE
   ============================================= */
.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 5px 14px 5px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.15s;
}

.filter-toggle:hover {
    background-color: #f3f4f6;
}

.filter-chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    transform: rotate(-90deg);
}

.filter-toggle.open .filter-chevron {
    transform: rotate(0deg);
}

.filter-tree {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 8px;
}

.filter-tree.filter-collapsed {
    display: none;
}

.filter-level {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}

.filter-nested {
    padding-left: 24px;
}

.filter-level li {
    min-width: fit-content;
}

.filter-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
    padding: 3px 0;
    user-select: none;
}

.filter-label input[type="checkbox"] {
    accent-color: #dc2626;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.filter-label span {
    line-height: 1;
}

/* Input field states */
.exercise-input {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.exercise-input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.exercise-input.correct {
    border-color: #16a34a;
    background-color: #f0fdf4;
}

.exercise-input.incorrect {
    border-color: #dc2626;
    background-color: #fef2f2;
}

/* Hint button */
.hint-btn {
    transition: background-color 0.2s ease;
}

.hint-btn:hover {
    background-color: #fef3c7;
}

/* =============================================
   AI SPEECH BUBBLE + CHAT
   ============================================= */
.ai-chat {
    margin-top: 10px;
    position: relative;
}

.ai-bubble {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 12px 14px;
    position: relative;
    max-width: 480px;
}

/* Speech bubble arrow */
.ai-bubble::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 18px;
    width: 14px;
    height: 14px;
    background-color: #fffbeb;
    border-left: 1px solid #fde68a;
    border-top: 1px solid #fde68a;
    transform: rotate(45deg);
}

/* Messages area */
.ai-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.ai-msg {
    font-size: 0.85rem;
    line-height: 1.45;
    padding: 6px 10px;
    border-radius: 8px;
    max-width: 90%;
    word-wrap: break-word;
}

.ai-msg-ai {
    background-color: #fef3c7;
    color: #92400e;
    align-self: flex-start;
}

.ai-msg-user {
    background-color: #e0e7ff;
    color: #3730a3;
    align-self: flex-end;
}

.ai-msg-error {
    background-color: #fee2e2;
    color: #991b1b;
    align-self: flex-start;
}

.ai-more-btn {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 8px;
}

.ai-more-btn:hover {
    background-color: #fde68a;
}

.home-more-btn {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
}

.home-more-btn:hover {
    background-color: #fde68a;
}

/* Feedback numbered list */
.feedback-list {
    list-style: decimal;
    padding-left: 1.5rem;
    margin: 0;
}

.feedback-list-item {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #92400e;
    padding: 4px 0;
}

/* Category detail buttons */
.feedback-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.feedback-detail-btn {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.feedback-detail-btn:hover {
    background-color: #fde68a;
    transform: translateY(-1px);
}

/* Detail explanation area */
.home-feedback-detail {
    margin-top: 12px;
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 14px 16px;
}

.feedback-detail-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 8px;
}

.feedback-detail-content p {
    font-size: 0.85rem;
    line-height: 1.55;
    color: #78350f;
    margin-bottom: 6px;
}

/* =============================================
   TABS
   ============================================= */
.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 20px;
    padding-bottom: 0;
}

.tab-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
    color: #374151;
}

.tab-btn.active {
    color: #dc2626;
    border-bottom-color: #dc2626;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* =============================================
   UITLEG KADER (inklapbaar)
   ============================================= */
.uitleg-kader {
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    margin-bottom: 8px;
}

.uitleg-toggle {
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0369a1;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.uitleg-toggle::-webkit-details-marker {
    display: none;
}

.uitleg-toggle::after {
    content: "▸";
    margin-left: auto;
    transition: transform 0.2s;
}

details.uitleg-kader[open] .uitleg-toggle::after {
    transform: rotate(90deg);
}

.uitleg-inhoud {
    padding: 0 14px 14px 14px;
    font-size: 0.85rem;
    color: #1e3a5f;
    line-height: 1.6;
}

.uitleg-tabel {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.uitleg-tabel th,
.uitleg-tabel td {
    padding: 4px 10px;
    text-align: left;
    border-bottom: 1px solid #bae6fd;
}

.uitleg-tabel th {
    font-weight: 700;
    color: #0369a1;
    background-color: #e0f2fe;
}

.uitleg-lijst {
    margin: 4px 0 0 18px;
    padding: 0;
    font-size: 0.82rem;
}

.uitleg-lijst li {
    margin-bottom: 2px;
}

/* ---- Oefenfilter (radio buttons) ---- */
.oefenfilter {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 8px;
}

.oefenfilter.filter-collapsed {
    display: none;
}

.oefenfilter-titel {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.oefenfilter-optie {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #4b5563;
    cursor: pointer;
    padding: 4px 0;
}

.oefenfilter-optie input[type="radio"] {
    accent-color: #dc2626;
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

/* =============================================
   SIDEBAR HOME LINK
   ============================================= */
.sidebar-home-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.15s;
}

.sidebar-home-link:hover {
    background-color: #f3f4f6;
}

.sidebar-home-link.active {
    background-color: #fef2f2;
    color: #dc2626;
}

/* =============================================
   HOME PAGE
   ============================================= */
.home-hero {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 0;
}

.home-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.home-textarea {
    width: 100%;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1f2937;
    resize: vertical;
    transition: border-color 0.2s;
    font-family: inherit;
}

.home-textarea:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.home-textarea::placeholder {
    color: #9ca3af;
}

.home-feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 28px;
    background-color: #dc2626;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
}

.home-feedback-btn:hover {
    background-color: #b91c1c;
}

.home-feedback-btn:active {
    transform: scale(0.98);
}

.home-feedback-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.home-feedback-result {
    margin-top: 24px;
    text-align: left;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
}

.home-feedback-text p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 8px;
}

.home-feedback-text p:last-child {
    margin-bottom: 0;
}

/* =============================================
   KLAS POPUP
   ============================================= */
.klas-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.klas-overlay.hidden {
    display: none;
}

.klas-popup {
    background: white;
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.klas-popup-tekst {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 16px;
}

.klas-popup-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 20px;
}

.klas-select {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #1f2937;
    background: white;
    cursor: pointer;
}

.klas-select:focus {
    outline: none;
    border-color: #dc2626;
}

.klas-bevestig-btn {
    padding: 9px 32px;
    background-color: #dc2626;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.klas-bevestig-btn:hover {
    background-color: #b91c1c;
}

.klas-bevestig-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
