:root {
    /* Standard (fallback) – grønt tema */
    --primary-color: #2c5e1a;
    --secondary-color: #4b8b3b;
    --accent-color: #6aab58;
    --light-color: #e8f5e9;
    --dark-color: #1a3c0f;
}

/* =========================
   Temaer pr. fag (vælg via body[data-fag="..."])
   ========================= */

/* Matematik – blå nuance */
body[data-fag="matematik"] {
    --primary-color: #1e40af; /* header, badges */
    --secondary-color: #3b82f6; /* nav-baggrund, kortkanter */
    --accent-color: #60a5fa; /* hover/markering */
    --light-color: #eef2ff;   /* side-baggrund */
    --dark-color: #0f172a;    /* brødtekst */
}

/* Biologi – grøn nuance (som din nuværende) */
body[data-fag="biologi"] {
    --primary-color: #2c5e1a;
    --secondary-color: #4b8b3b;
    --accent-color: #6aab58;
    --light-color: #e8f5e9;
    --dark-color: #1a3c0f;
}

/* Geografi – jord/amber nuance */
body[data-fag="geografi"] {
    --primary-color: #92400e;
    --secondary-color: #b45309;
    --accent-color: #fbbf24;
    --light-color: #fff7ed;
    --dark-color: #1a120a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

/* Link Styles */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover { color: var(--accent-color); }

/* Header Styles */
.banner {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Navigation Styles */
nav { background-color: var(--secondary-color); }

.topmenu, .submenu {
    list-style-type: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.topmenu li { position: relative; }

.topmenu > li > a {
    display: block;
    color: white;
    padding: 1rem 1.5rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.topmenu > li > a:hover {
    background-color: var(--accent-color);
    color: white;
}

.submenu {
    display: none;
    position: absolute;
    background-color: var(--accent-color);
    width: 200px;
    flex-direction: column;
    z-index: 100;
}
.topmenu li:hover .submenu { display: flex; }

.submenu a {
    color: white !important;
    padding: 0.8rem 1.5rem;
    transition: background-color 0.3s ease;
}
.submenu a:hover {
    background-color: var(--primary-color);
    color: white !important;
}

/* Main Content Styles */
.main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

/* Icon Grid Styles */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    text-align: center;
}
.icon-link { text-decoration: none; color: inherit; display: block; height: 100%; }

.icon-item {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}
.icon-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.icon-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Content Section Styles */
.content-section {
    margin: 3rem 0;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.content-section a {
    color: var(--secondary-color);
    font-weight: 500;
    border-bottom: 1px solid var(--accent-color);
}
.content-section a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Footer Styles */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

/* Anchor Styles */
.section-anchor {
    display: block;
    position: relative;
    top: -100px;
    visibility: hidden;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .topmenu { flex-direction: column; }
    .submenu { position: static; width: 100%; }
    .banner { font-size: 1.5rem; }
    .topmenu > li > a { padding: 0.8rem 1rem; }
    .submenu a { padding: 0.6rem 1rem; }
}

/* Sidebar Styles */
.page-container {
    display: flex;
    min-height: calc(100vh - 200px);
}

.sidebar {
    width: 280px;
    background-color: white;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 1.5rem 1rem;
    border-bottom: 1px solid var(--light-color);
    margin-bottom: 1rem;
}
.sidebar-header h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.sidebar-menu { list-style: none; padding: 0; }
.sidebar-menu li { margin: 0; }
.sidebar-menu a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--dark-color);
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}
.sidebar-menu a:hover {
    background-color: var(--light-color);
    border-left: 3px solid var(--accent-color);
    color: var(--primary-color);
}
.sidebar-menu a i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}
.sidebar-menu .divider {
    padding: 1rem 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 1rem;
    border-top: 1px solid var(--light-color);
}

.sidebar-footer {
    padding: 1.5rem;
    margin-top: 1rem;
    border-top: 1px solid var(--light-color);
}
.sidebar-footer a {
    color: var(--secondary-color) !important;
    font-size: 0.9rem;
}

/* Main Content Adjustments */
.main-content {
    flex: 1;
    padding: 2rem 3rem;
    max-width: calc(100% - 280px);
}

/* Content Enhancements */
.content-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.content-list { padding-left: 1.5rem; margin: 1rem 0; }
.content-list li { margin-bottom: 0.5rem; }

.info-box {
    background-color: var(--light-color);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    margin: 1rem 0;
}

.grid-2-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.card {
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-top: 3px solid var(--secondary-color);
}

.quiz-questions { padding-left: 1.5rem; margin: 1.5rem 0; }
.quiz-questions li { margin-bottom: 1rem; }

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.btn:hover { background-color: var(--dark-color); }

/* Opgavesektioner */
.assignment {
    border-left: 4px solid var(--secondary-color); /* var i filen: #5c8a55 */
    background-color: #f8f8f8;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .page-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .main-content { max-width: 100%; }
    .grid-2-col { grid-template-columns: 1fr; }
}

/* Topic Grid Styles */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.main-topic {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.main-topic:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.topic-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.topic-header i { font-size: 1.5rem; }
.topic-header h3 { margin: 0; font-size: 1.1rem; }

.sub-topics { list-style: none; padding: 0.5rem 0; margin: 0; }
.sub-topics li { border-bottom: 1px solid var(--light-color); }
.sub-topics li:last-child { border-bottom: none; }
.sub-topics a {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    color: var(--dark-color);
    transition: all 0.2s ease;
    gap: 0.7rem;
}
.sub-topics a:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
    padding-left: 1.2rem;
}
.sub-topics a i { width: 20px; text-align: center; color: var(--secondary-color); }

.section-intro {
    margin-bottom: 2rem;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--dark-color);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .topic-grid { grid-template-columns: 1fr; }
    .main-topic { margin-bottom: 1rem; }
}

/* Stil for nummererede lister i opgave-sektioner */
.assignment ol {
    counter-reset: item;
    list-style: none;
    padding-left: 0;
    margin-top: 1em;
}
.assignment ol li {
    counter-increment: item;
    margin-bottom: 1em;
    position: relative;
    padding-left: 3em;
    line-height: 1.6;
    background-color: var(--light-color); /* var i filen: #f9f9f9 */
    border-left: 4px solid var(--secondary-color); /* var i filen: #5c8a55 */
    border-radius: 4px;
    padding-top: 1em;
    padding-bottom: 1em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.assignment ol li::before {
    content: counter(item) ".";
    position: absolute;
    left: 1em;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: var(--secondary-color); /* var i filen: #5c8a55 */
    font-size: 1.1em;
}

/* Forbedret udseende og større indrykning på ul-lister */
.content-section ul {
    padding-left: 2.5em;
    margin-top: 1em;
    margin-bottom: 1em;
    list-style-type: disc;
}
.content-section ul li {
    margin-bottom: 0.5em;
    line-height: 1.6;
}
