@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

/* --- Global & Structure --- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
    color: #333;
    overflow: hidden;
}

.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    border-top: 3px solid #4dd0e1;
}

/* --- Sidebar --- */
.sidebar {
    width: 300px;
    background-color: #ffffff;
    padding: 25px 20px;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%;
    box-sizing: border-box;
}
.logo-section {
    display: flex;
    align-items: center;
    margin-bottom: 35px;
    flex-shrink: 0;
}

.logo-placeholder {
    width: 50px;
    height: 50px;
    background-color: #e0e0e0;
    border-radius: 8px;
    margin-right: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    color: #666;
    text-align: center;
    flex-shrink: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><polygon points="50,5 95,28 95,72 50,95 5,72 5,28" style="fill:%233498db;stroke:%232980b9;stroke-width:2"/><circle cx="50" cy="50" r="18" fill="%23e74c3c"/><circle cx="30" cy="35" r="10" fill="%23f1c40f"/><circle cx="70" cy="35" r="10" fill="%23f1c40f"/><circle cx="30" cy="65" r="10" fill="%232ecc71"/><circle cx="70" cy="65" r="10" fill="%232ecc71"/></svg>');
    background-size: cover;
    color: transparent;
}

.app-title {
    font-size: 1.2em; /* Font size could also be adjusted if needed */
    font-weight: 700;
    color: #343a40;
    /* Allow title to wrap if still needed */
    /* white-space: normal; */
    line-height: 1.3; /* Adjust line height if wrapping */
}

/* --- Menu --- */
.menu-section {
    margin-bottom: 35px;
    flex-shrink: 0;
}

.menu-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #e74c3c;
    display: flex;
    align-items: center;
}

.menu-title::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #e74c3c;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    font-size: 1em;
    color: #aaaaaa;
    border-left: 4px solid #e0e0e0;
    padding-left: 10px;
    margin-bottom: 5px;
    position: relative;
    cursor: pointer;
    transition: color 0.2s, border-left-color 0.2s;
    user-select: none;
}

.menu-item:hover {
     color: #555;
}

.menu-item.active {
    color: #3498db;
    font-weight: 600;
    border-left: 4px solid #3498db;
}
.menu-item.active:hover {
    color: #2980b9;
}

.menu-item .icon-placeholder {
    width: 20px;
    height: 20px;
    background-color: #d0d0d0;
    margin-right: 12px;
    display: inline-block;
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    flex-shrink: 0;
    transition: background-color 0.2s;
}
 .menu-item.active .icon-placeholder {
     background-color: #3498db;
 }
 .menu-item:hover .icon-placeholder {
    background-color: #b0b0b0;
 }
 .menu-item.active:hover .icon-placeholder {
    background-color: #2980b9;
 }

/* --- Leaderboard --- */
.leaderboard-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #343a40;
    display: flex;
    align-items: center;
    margin-bottom: 15px; /* Space above iframe */
    flex-shrink: 0;
    margin-top: auto; /* Push title and iframe towards bottom */
}

.leaderboard-title .icon-placeholder {
    /* ... icon styles remain same ... */
    width: 16px;
    height: 16px;
    background-color: #343a40;
    margin-right: 8px;
    display: inline-block;
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M10.4 2.28a.75.75 0 0 0-1.03.22l-7 9a.75.75 0 0 0 .59 1.25h5.29l-2.5 7a.75.75 0 0 0 1.03.78l11-13a.75.75 0 0 0-.57-1.28H11.7L14 2.5a.75.75 0 0 0-.6-.22Z"/></svg>');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M10.4 2.28a.75.75 0 0 0-1.03.22l-7 9a.75.75 0 0 0 .59 1.25h5.29l-2.5 7a.75.75 0 0 0 1.03.78l11-13a.75.75 0 0 0-.57-1.28H11.7L14 2.5a.75.75 0 0 0-.6-.22Z"/></svg>');
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    flex-shrink: 0;
}

#powerbi-leaderboard {
    width: 100%; /* Fill sidebar width */
    height: 200px; /* Set a suitable height */
    border: none; /* Remove iframe border */
    border-radius: 10px; /* Match previous style */
    flex-shrink: 0; /* Prevent shrinking */
    margin-bottom: 5px; /* Small space at the very bottom */
    background-color: #e9ecef; /* Optional: background while loading */
}

/* --- Main Content Area --- */
.main-content {
    flex-grow: 1;
    padding: 30px 40px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* --- Content Section Switching --- */
.content-section {
    display: none;
    flex-grow: 1;
    min-height: 0;
    display: none;
    flex-direction: column; /* Set default flex direction */
}

.content-section.active-content {
    display: flex;
}

/* --- General Content Card Styles --- */
.content-card {
    background-color: #ffffff;
    padding: 18px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.welcome-message {
    font-size: 1.6em;
    font-weight: 700;
    color: #3498db;
}

.welcome-message span {
     color: #343a40;
     font-weight: 700;
}

/* --- Startpagina Specific Styles --- */
#startpagina-content {
    /* Uses flex column from .active-content */
}

.explanation-card {
    /* No specific changes needed */
}

.explanation-card .card-title {
     font-size: 1.1em;
     font-weight: 700;
     margin-bottom: 10px;
     color: #343a40;
}

.explanation-card p {
    font-size: 0.95em;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

.image-card {
    padding: 0;
    overflow: hidden;
    margin-top: auto; /* Push to bottom */
    /* flex-grow: 1; /* Allow card to grow if needed */
    /* max-height: 400px; /* Optional max height */
}

.image-placeholder-large {
    width: 100%;
    /* height: 250px; */ /* Let height be determined by flex */
    flex-grow: 1; /* Allow placeholder to take space */
    min-height: 200px; /* Ensure minimum height */
    background-color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #666;
    font-size: 1.2em;
}

.image-caption {
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
    flex-shrink: 0; /* Prevent caption shrinking */
}

.caption-text {
    font-size: 1em;
    font-weight: 600;
    color: #343a40;
}

.coins-button {
    background-color: #3498db;
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.2s;
}
.coins-button:hover {
    background-color: #2980b9;
}


/* --- Klassenbattle Specific Styles --- */
#klassenbattle-content {
   /* Uses flex from .active-content */
}

.sections-container {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 25px; /* Slightly reduced gap */
    min-height: 0;
}

.section-card {
    background-color: #ffffff;
    padding: 15px; /* Slightly reduced padding */
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-title {
    font-size: 1.4em; /* Slightly smaller */
    font-weight: 700;
    text-align: center;
    margin-bottom: 15px;
    color: #343a40;
    flex-shrink: 0;
}

.task-grid {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px; /* Slightly reduced gap */
    min-height: 0;
}

.task-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.task-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.task-img-placeholder {
     flex-grow: 1;
     min-height: 50px; /* Adjusted min height */
     background-color: #e9ecef;
     display: flex;
     justify-content: center;
     align-items: center;
     color: #6c757d;
     font-size: 0.8em; /* Smaller text */
     text-align: center;
     border-top-left-radius: 8px;
     border-top-right-radius: 8px;
}

.points-badge {
    position: absolute;
    top: 5px;  /* Adjusted position */
    right: 5px; /* Adjusted position */
    background-color: rgba(255, 255, 255, 0.95);
    padding: 3px 8px; /* Adjusted padding */
    border-radius: 10px;
    font-size: 0.8em; /* Adjusted font size */
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    z-index: 1;
}

.points-badge .star {
    color: #ffb74d;
    margin-left: 3px;
    font-size: 1em; /* Adjusted size */
    line-height: 1;
}

.task-caption {
    padding: 6px 8px; /* Adjusted padding */
    text-align: center;
    font-size: 0.75em; /* Adjusted font size */
    font-weight: 600;
    color: white;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    flex-shrink: 0;
}

.caption-kennis { background-color: #3498db; }
.caption-opdrachten { background-color: #3498db; }
.caption-puzzel { background-color: #e74c3c; }
.caption-creatief { background-color: #f39c12; }

/* --- Wat is je mening Specific Styles --- */
#mening-content {
   /* Uses flex from .active-content */
}

#mening-content .explanation-card {
    margin-top: 20px;
}