/* --- IMPORTS --- */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600&family=Nunito:wght@400;700&display=swap');

/* --- GLOBAL STIL (Gäller alla sidor) --- */
body {
    font-family: 'Nunito', sans-serif;
    background-color: #fdfbf7;
    color: #333;
    margin: 0;
    padding: 40px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

h1 {
    font-family: 'Fredoka', sans-serif;
    text-align: center;
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0px #ffd700;
}

.subtitle {
    text-align: center;
    font-size: 1.1em;
    margin-bottom: 40px;
    color: #7f8c8d;
    font-family: 'Fredoka', sans-serif;
}

a { text-decoration: none; }

/* --- 1. PORTAL-SPECIFIK STIL (Index-sidan) --- */

.portal-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 60vh;
}

.hub-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.course-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.course-card:hover { transform: translateY(-3px); }

/* Dropdown-mekanik */
details { width: 100%; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }

.course-btn {
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.4em;
    font-weight: 600;
    user-select: none;
}

.arrow { transition: transform 0.3s ease; font-size: 0.8em; }
details[open] .arrow { transform: rotate(180deg); }

.dropdown-content {
    background-color: #fff;
    border-top: 2px dashed rgba(0,0,0,0.05);
    padding: 10px 20px 20px 20px;
    animation: slideDown 0.3s ease-out;
}

.dropdown-label {
    margin: 0 0 10px 0;
    color: #999;
    font-size: 0.9em;
    font-weight: 600;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.link-item {
    display: block;
    background-color: #f8f9fa;
    padding: 15px;
    margin-top: 10px;
    border-radius: 12px;
    color: #555;
    font-weight: 700;
    transition: all 0.2s;
    border-left: 5px solid #ccc;
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-item:hover { background-color: #f0f3f4; padding-left: 20px; }

/* --- 2. DOKUMENT-SPECIFIK STIL (Begreppslistan) --- */

.doc-container {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 2px solid transparent;
    page-break-inside: avoid;
}

.section h2 {
    font-family: 'Fredoka', sans-serif;
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5em;
    border-bottom: 2px dashed rgba(0,0,0,0.1);
    padding-bottom: 10px;
}

ul { list-style: none; padding: 0; margin: 0; }

li {
    background: rgba(255,255,255,0.6);
    margin-bottom: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 4px solid rgba(0,0,0,0.1);
    font-size: 0.95em;
    line-height: 1.4;
}

strong {
    font-weight: 800;
    color: #2c3e50;
    font-size: 1.05em;
    display: block;
    margin-bottom: 2px;
}

/* --- TEMA-FÄRGER --- */

/* Blå */
.theme-blue.course-card .course-btn { background: linear-gradient(to right, #ebf5fb, #fff); color: #2980b9; border-left: 8px solid #3498db; }
.theme-blue .link-item:hover { border-left-color: #3498db; color: #2980b9; }
.theme-blue.section { border-color: #3498db; background: linear-gradient(to bottom right, #fff, #ebf5fb); }
.theme-blue.section h2 { color: #2980b9; }

/* Grön */
.theme-green.course-card .course-btn { background: linear-gradient(to right, #eafaf1, #fff); color: #27ae60; border-left: 8px solid #2ecc71; }
.theme-green .link-item:hover { border-left-color: #2ecc71; color: #27ae60; }
.theme-green.section { border-color: #2ecc71; background: linear-gradient(to bottom right, #fff, #eafaf1); }
.theme-green.section h2 { color: #27ae60; }

/* Röd */
.theme-red.course-card .course-btn { background: linear-gradient(to right, #fdedec, #fff); color: #c0392b; border-left: 8px solid #e74c3c; }
.theme-red .link-item:hover { border-left-color: #e74c3c; color: #c0392b; }
.theme-red.section { border-color: #e74c3c; background: linear-gradient(to bottom right, #fff, #fdedec); }
.theme-red.section h2 { color: #c0392b; }

/* Lila */
.theme-purple.course-card .course-btn { background: linear-gradient(to right, #f5eef8, #fff); color: #8e44ad; border-left: 8px solid #9b59b6; }
.theme-purple .link-item:hover { border-left-color: #9b59b6; color: #8e44ad; }
.theme-purple.section { border-color: #9b59b6; background: linear-gradient(to bottom right, #fff, #f5eef8); }
.theme-purple.section h2 { color: #8e44ad; }

/* Orange */
.theme-orange.course-card .course-btn { background: linear-gradient(to right, #fbeee6, #fff); color: #d35400; border-left: 8px solid #e67e22; }
.theme-orange .link-item:hover { border-left-color: #e67e22; color: #d35400; }
.theme-orange.section { border-color: #e67e22; background: linear-gradient(to bottom right, #fff, #fbeee6); }
.theme-orange.section h2 { color: #d35400; }

/* Gul */
.theme-yellow.course-card .course-btn { background: linear-gradient(to right, #fef9e7, #fff); color: #d4ac0d; border-left: 8px solid #f1c40f; }
.theme-yellow .link-item:hover { border-left-color: #f1c40f; color: #d4ac0d; }
.theme-yellow.section { border-color: #f1c40f; background: linear-gradient(to bottom right, #fff, #fef9e7); }
.theme-yellow.section h2 { color: #d4ac0d; }

/* Rosa */
.theme-pink.course-card .course-btn { background: linear-gradient(to right, #fce4ec, #fff); color: #c2185b; border-left: 8px solid #ec407a; }
.theme-pink .link-item:hover { border-left-color: #ec407a; color: #c2185b; }
.theme-pink.section { border-color: #ec407a; background: linear-gradient(to bottom right, #fff, #fce4ec); }
.theme-pink.section h2 { color: #c2185b; }

/* Turkos */
.theme-teal.course-card .course-btn { background: linear-gradient(to right, #e0f2f1, #fff); color: #00796b; border-left: 8px solid #26a69a; }
.theme-teal .link-item:hover { border-left-color: #26a69a; color: #00796b; }
.theme-teal.section { border-color: #26a69a; background: linear-gradient(to bottom right, #fff, #e0f2f1); }
.theme-teal.section h2 { color: #00796b; }

/* --- FOOTER & PRINT --- */
.footer {
    text-align: center;
    margin-top: 40px;
    font-size: 0.8em;
    color: #bdc3c7;
    font-family: 'Fredoka', sans-serif;
    width: 100%;
}

@media print {
    body { padding: 0; background: white; }
    .section { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
    .hub-container, .course-btn { display: none; }
    .footer { page-break-before: always; }
}

/* --- MOBILANPASSNING (Responsive Design) --- */
@media (max-width: 700px) {

    body {
        padding: 15px; 
    }

    h1 {
        font-size: 1.8em; 
        line-height: 1.2;
        margin-bottom: 20px;
    }

    .subtitle {
        font-size: 1em;
        margin-bottom: 30px;
    }

    .hub-container, .doc-container {
        width: 100%;
        max-width: 100%;
        gap: 20px;
    }

    .section, .course-card {
        padding: 15px; 
        border-radius: 15px;
    }

    .section h2 {
        font-size: 1.4em;
        margin-bottom: 20px; 
        flex-direction: column;
        align-items: flex-start;
    }

    /* --- FLEXBOX-LÖSNING FÖR LISTAN --- */
    /* Detta tvingar isär boxarna rejält */
    .section ul {
        display: flex;
        flex-direction: column;
        gap: 40px !important; 
    }

    /* Stilen på själva boxarna */
    .section ul li {
        margin: 0 !important; 
        line-height: 1.6; 
        padding: 20px;
        font-size: 1em;
        background-color: rgba(255,255,255,0.8);
        box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    }

    .course-btn {
        padding: 20px 15px; 
        font-size: 1.1em;
    }
}

/* --- SÖKFÄLT --- */
.search-wrapper {
    max-width: 600px;
    margin: 0 auto 30px auto; /* Centrerat med luft under */
    position: relative;
}

#searchInput {
    width: 100%;
    padding: 15px 20px;
    padding-left: 45px; /* Plats för ikonen */
    font-size: 1.1em;
    font-family: 'Nunito', sans-serif;
    border: 2px solid #eee;
    border-radius: 50px; /* Piller-form */
    background-color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    box-sizing: border-box; /* Viktigt så padding inte pajar bredden */
}

#searchInput:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

/* Sök-ikon (emoji) inuti fältet */
.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    pointer-events: none; /* Klick går igenom till input */
    opacity: 0.5;
}