/* Base CSS Variables */
:root {
    /* Colors */
    --primary: #4361ee;
    --primary-dark: #3949ab;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --accent: #4cc9f0;
    --accent-light: rgba(76, 201, 240, 0.2);
    --accent-dark: #1f7ea0;
    --success: #4CAF50;
    --error: #f72585;
    --text-dark: #2b2d42;
    --text-light: #6c757d;
    --text-muted: #6c757d;
    --background: #f8f9fa;
    --white: #ffffff;
    --header-bg: #4055d6;
    --surface: #ffffff;
    --surface-muted: #f7f8f9;
    --bg-light: var(--surface-muted);
    --border: rgba(55, 196, 255, 0.15);
    --border-color: var(--border);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-heading: 'Poppins', var(--font-primary);
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 8px 20px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 12px 28px rgba(0, 0, 0, 0.08);
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1rem;
    
    /* Transitions */
    --transition-normal: 0.3s ease;

    /* Layout */
    --page-pad: clamp(16px, 2vw, 24px);
    --sidebar-width: clamp(150px, 12vw, 170px);
    --sidebar-gutter: clamp(8px, 1.5vw, 15px);
    --sidebar-total: calc(var(--sidebar-width) + var(--sidebar-gutter));
}

body.dark-mode {
    --surface: #2c2c2c;
    --surface-muted: rgba(255, 255, 255, 0.06);
    --border: rgba(55, 196, 255, 0.2);
    --text-muted: rgba(255, 255, 255, 0.7);
}

/* Accessibility Styles */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-color);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top var(--transition-speed);
}

.skip-link:focus {
    top: 0;
}

/* Performance Optimizations */
@media screen and (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Image Optimization */
img {
    max-width: 100%;
    height: auto;
}

/* Focus Styles */
:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-dark);
    position: relative;
    background-color: var(--background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
}

main {
    flex: 1;
    margin-top: 64px;
    width: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

p {
    margin-bottom: var(--spacing-sm);
}

/* Modern Honeycomb background effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: 
        linear-gradient(120deg, var(--primary-light) 0%, var(--primary) 100%);
    opacity: 0.03;
    mask-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374zM48.97 0l3.657 3.657-1.414 1.414L46.143 0h2.828zM11.03 0L7.372 3.657 8.787 5.07 13.857 0H11.03zm32.284 0L49.8 6.485 48.384 7.9l-7.9-7.9h2.83zM16.686 0L10.2 6.485 11.616 7.9l7.9-7.9h-2.83zM22.343 0L13.8 8.544 15.214 9.96l9.9-9.9h-2.77zM32 0l-9.9 9.9 1.415 1.414L34.828 0H32zM0 0c1.837 4.382 4.298 8.255 7.372 11.33L0 18.7V0zm60 0c-1.837 4.382-4.298 8.255-7.372 11.33L60 18.7V0zM7.372 11.33c6.088 6.088 13.823 9.134 22.628 9.134s16.54-3.046 22.628-9.134L45.214 4.93C40.33 9.815 34.017 12.257 27 12.257s-13.33-2.442-18.214-7.326L7.372 11.33z' fill='%234361ee' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Header & Navigation */
header {
    background-color: var(--header-bg);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    height: 70px;
}

nav {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    position: relative;
}

/* Header navigation links */
nav > a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-sm);
    transition: color var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
}

nav > a:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
}

nav > a.active {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
}

/* Task Lists and Content Lists */
.task-list, .content-list {
    margin: 20px 0;
}

.task-item, .list-item {
    margin-bottom: 12px;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
    transition: all var(--transition-fast);
}

.task-item:hover, .list-item:hover {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transform: translateX(2px);
}

.task-item:last-child, .list-item:last-child {
    margin-bottom: 0;
}


.logo {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0;
}

.logo a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 10px 0;
}

.logo img {
    height: 50px;
    width: 150px;
    object-fit: contain;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    height: 100%;
}

nav ul li {
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

nav ul li a {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: color var(--transition-normal);
    font-size: var(--font-size-base);
    display: inline-block;
    background: none;
    border: none;
}

nav ul li a:hover {
    color: var(--accent);
}

nav ul li a.active {
    color: var(--accent);
}

/* Remove any special styling for contact link */
nav ul li a.contact-link {
    background: none;
    color: var(--white);
    border-radius: 0;
    padding: 0.5rem 1rem;
}

nav ul li a.contact-link:hover {
    color: var(--accent);
    background: none;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1) 0%, rgba(58, 12, 163, 0.1) 100%);
    padding: var(--spacing-xl) var(--spacing-md) var(--spacing-lg);
    text-align: center;
    margin-top: 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374zM48.97 0l3.657 3.657-1.414 1.414L46.143 0h2.828zM11.03 0L7.372 3.657 8.787 5.07 13.857 0H11.03zm32.284 0L49.8 6.485 48.384 7.9l-7.9-7.9h2.83zM16.686 0L10.2 6.485 11.616 7.9l7.9-7.9h-2.83zM22.343 0L13.8 8.544 15.214 9.96l9.9-9.9h-2.77zM32 0l-9.9 9.9 1.415 1.414L34.828 0H32zM0 0c1.837 4.382 4.298 8.255 7.372 11.33L0 18.7V0zm60 0c-1.837 4.382-4.298 8.255-7.372 11.33L60 18.7V0zM7.372 11.33c6.088 6.088 13.823 9.134 22.628 9.134s16.54-3.046 22.628-9.134L45.214 4.93C40.33 9.815 34.017 12.257 27 12.257s-13.33-2.442-18.214-7.326L7.372 11.33z' fill='%234361ee' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 0;
}

.hero h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-md);
    color: var(--primary-dark);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    z-index: 1;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero p {
    font-size: var(--font-size-xl);
    color: var(--text-dark);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    font-weight: 500;
    line-height: 1.6;
    opacity: 0.9;
}

/* Resources Section */
.resources {
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: 1200px;
    margin: 0 auto;
}

.resources h2 {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    color: var(--primary-dark);
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    max-width: 1200px;
    margin: 0 auto;
}

/* Resource Cards */
.resource-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.resource-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: var(--spacing-md);
}

.resource-icon i {
    font-size: 2rem;
    width: 2rem;
    height: 2rem;
}

.resource-card h3 {
    color: var(--primary-dark);
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-sm);
}

.resource-card p {
    color: var(--text-light);
    margin: 0;
}

.les-mer {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    font-weight: 500;
    text-align: center;
    width: 100%;
}

.les-mer:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Footer */
footer {
    background-color: var(--primary);
    color: var(--white);
    text-align: center;
    padding: 0.5rem;
    width: 100%;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 10;
    font-size: var(--font-size-base);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
}

footer p {
    margin: 0;
    padding: 0;
    line-height: 1;
    color: var(--white);
    opacity: 0.95;
}

/* Ytringsfrihet-seksjon */
.ytringsfrihet-section {
    padding: 7rem 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.intro-box {
    background: var(--white);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(67, 97, 238, 0.1);
    transform: translateY(0);
    transition: all 0.3s ease;
}

.intro-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.intro-box h1 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: var(--font-size-4xl);
    position: relative;
    padding-bottom: 1rem;
}

.intro-box h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 2px;
}

.intro-box p {
    font-size: var(--font-size-lg);
    line-height: 1.8;
    color: var(--text-dark);
}

.oppgaver-container {
    display: grid;
    gap: 2rem;
}

.oppgave {
    background: var(--white);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(67, 97, 238, 0.1);
    transition: all 0.3s ease;
}

.oppgave:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.oppgave h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: var(--font-size-3xl);
    position: relative;
    padding-bottom: 1rem;
}

.oppgave h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 2px;
}

.oppgave h3 {
    color: #34495e;
    margin: 1.5rem 0 1rem;
    font-size: var(--font-size-2xl);
}

.oppgave-content {
    margin-left: 1rem;
}

.oppgave-content ul,
.oppgave-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.oppgave-content li {
    margin-bottom: 0.8rem;
    color: var(--text-dark);
    line-height: 1.5;
}

.eksempel {
    background: var(--background);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary);
}

.eksempel h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: var(--font-size-xl);
}

.eksempel p {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

/* Case-container */
.case-container {
    display: grid;
    gap: 1.5rem;
}

.case {
    background: var(--background);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.case.expanded {
    background: white;
    box-shadow: var(--shadow-md);
}

/* Quiz-stiler */
.quiz-container {
    display: grid;
    gap: 2rem;
}

.quiz-item {
    margin-bottom: 1rem;
}

.fyll-inn-svar {
    padding: 0.5rem;
    margin: 0 0.5rem;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
}

.fyll-inn-svar.korrekt {
    border-color: var(--success);
    background-color: var(--success);
}

.fyll-inn-svar.feil {
    border-color: var(--error);
    background-color: var(--error);
}

.matching-quiz {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.matching-item {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: move;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.matching-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.matching-target {
    padding: 1rem 1.5rem;
    background: var(--background);
    border: 2px dashed var(--primary-light);
    border-radius: var(--radius-lg);
    min-height: 60px;
    transition: all 0.3s ease;
}

.matching-target:hover {
    background: rgba(67, 97, 238, 0.05);
}

/* Knapper */
.svar-button,
.diskusjon-button,
.case-button,
.sjekk-svar {
    background-color: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.svar-button:hover,
.diskusjon-button:hover,
.case-button:hover,
.sjekk-svar:hover {
    background-color: var(--primary-dark);
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.75rem;
        --font-size-2xl: 1.5rem;
    }

    nav {
        flex-direction: column;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm) 0;
    }

    nav ul {
        margin-left: 0;
        flex-direction: column;
        width: 100%;
        text-align: center;
        gap: var(--spacing-xs);
    }

    nav ul li a {
        display: block;
        padding: var(--spacing-sm);
        font-size: var(--font-size-base);
    }

    .logo {
        height: 50px;
    }

    .logo img {
        height: 50px;
    }

    .hero {
        margin-top: 120px;
    }

    .ytringsfrihet-section {
        padding: 6rem 1rem 2rem;
    }

    .intro-box,
    .oppgave {
        padding: 1.5rem;
    }

    .oppgave h2 {
        font-size: var(--font-size-2xl);
    }

    .eksempel {
        padding: 1rem;
    }

    .case-container {
        grid-template-columns: 1fr;
    }

    .matching-quiz {
        grid-template-columns: 1fr;
    }

    .quiz-options {
        padding: 0;
    }

    .option {
        padding: 0.8rem;
    }

    .fyll-inn-text input {
        width: 100%;
        margin: 0.5rem 0;
    }

    .resource-grid {
        grid-template-columns: 1fr;
    }

    header {
        height: auto;
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .hero h1 {
        font-size: var(--font-size-3xl);
        padding: 0 var(--spacing-sm);
    }

    .hero p {
        font-size: var(--font-size-lg);
        padding: 0 var(--spacing-sm);
    }
}

/* Quiz Styles */
.quiz-question {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(67, 97, 238, 0.1);
}

.quiz-question p {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: var(--radius-lg);
    background: var(--background);
    transition: all 0.3s ease;
    cursor: pointer;
}

.option:hover {
    background: rgba(67, 97, 238, 0.05);
    transform: translateX(5px);
}

/* Feedback Messages */
.feedback-message {
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.feedback-message.success {
    background: linear-gradient(135deg, var(--success) 0%, #81c784 100%);
    color: var(--white);
}

.feedback-message.error {
    background: linear-gradient(135deg, var(--error) 0%, #ff4081 100%);
    color: var(--white);
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Correct/Incorrect States */
.correct {
    border-color: var(--success) !important;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(129, 199, 132, 0.1) 100%) !important;
}

.incorrect {
    border-color: var(--error) !important;
    background: linear-gradient(135deg, rgba(247, 37, 133, 0.1) 0%, rgba(255, 64, 129, 0.1) 100%) !important;
}

/* Button Styles */
.sjekk-svar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-md);
}

.sjekk-svar:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.sjekk-svar:active {
    transform: translateY(0);
}

/* Error Messages */
.error-message {
    background-color: var(--accent-color);
    color: var(--white);
    padding: var(--spacing-sm);
    border-radius: var(--radius-lg);
    margin: var(--spacing-sm) 0;
    text-align: center;
}

/* Loading States */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid var(--background);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Base Layout */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
    color: var(--text-dark);
    background-color: var(--background);
    line-height: 1.6;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
    margin-top: 70px;
    width: 100%;
    padding: 0 var(--page-pad) var(--spacing-xl);
    padding-left: calc(var(--page-pad) + var(--sidebar-total));
    display: flex;
    justify-content: center;
}

/* Add padding to the last section to prevent content from being hidden behind the fixed footer */
.resources, .ytringsfrihet-section {
    padding-bottom: 50px; /* Increased to match new footer height */
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background: var(--white);
    width: 90%;
    max-width: 650px;
    margin: 4vh auto;
    border-radius: var(--radius-lg);
    position: relative;
    transform: translateY(20px);
    opacity: 0;
    transition: all var(--transition-normal);
}

.modal.active {
    display: block;
}

.modal.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.5rem;
    transition: color var(--transition-normal);
    z-index: 1;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-dark);
    font-size: var(--font-size-2xl);
}

.modal-body {
    padding: 1.25rem;
}

.modal-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 1rem;
}

/* Icon base styles */
.fas, .far, .fal, .fab {
    display: inline-block !important;
    width: 1em;
    height: 1em;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    font-size: inherit;
    color: transparent;
}

/* Modal option styles */
.modal-option {
    background: var(--white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--spacing-sm);
    box-shadow: var(--shadow-sm);
}

.modal-option i {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    display: inline-block;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--accent);
}

.modal-option:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.modal-option:hover h3,
.modal-option:hover p {
    color: var(--white);
}

.modal-option:hover i {
    color: var(--white);
}

/* Remove any other specific icon color overrides */
.modal-option.terms-option i,
.modal-option.tasks-option i,
.modal-option.facts-option i {
    color: var(--accent);
}

/* Resource icon styles */
.resource-icon i {
    font-size: 2rem;
    width: 2rem;
    height: 2rem;
}

/* Navigation icon styles */
nav i {
    width: 1em;
    height: 1em;
}

/* Terminology list icons */
.term i {
    margin-right: var(--spacing-sm);
    width: 1em;
    height: 1em;
}

.term:hover i {
    color: var(--white) !important;
}

/* Terminology Page Styles */
.terminology-list {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.term {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.term:hover {
    transform: translateY(-2px);
}

.term h3 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
    font-weight: 500;
}

.term p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-light);
    font-size: 1.1rem;
}

.page-title {
    text-align: center;
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

/* Remove any other specific icon color overrides */
.modal-option.terms-option i.material-icons,
.modal-option.tasks-option i.material-icons,
.modal-option.facts-option i.material-icons {
    color: var(--accent) !important;
}

.modal-option i.material-icons {
    color: var(--accent) !important;
}

/* Contact Page Styles */
.contact-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-content {
    padding: 0;
}

.contact-content > p {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin: 0;
}

.contact-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    text-decoration: none;
    display: block;
    cursor: pointer;
    border: 2px solid transparent;
    height: 100%;
}

.contact-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.contact-card i {
    font-size: 1.75rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.contact-card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.contact-card p {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    color: var(--text-dark);
}

.contact-link {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
}

.additional-info {
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.additional-info h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.additional-info p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

/* Ensure Font Awesome icons display properly */
.fas {
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
    -webkit-font-smoothing: antialiased;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Specific icon styles */
.fa-envelope:before {
    content: "\f0e0";
}

.fa-globe:before {
    content: "\f0ac";
}

@media (max-width: 768px) {
    .contact-section {
        padding: 2rem 1rem;
    }

    .contact-content > p {
        font-size: 0.9rem;
    }

    .contact-card {
        padding: 1.5rem;
    }
}

/* About Us and Contact Modal Styles */
.about-content,
.contact-content {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.about-content h3 {
    color: #2b2d42;
    margin: 1.5rem 0 1rem;
    font-family: 'Poppins', sans-serif;
}

.about-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.about-content li {
    margin-bottom: 0.5rem;
    color: #555;
    line-height: 1.6;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.contact-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.contact-card i {
    font-size: 2rem;
    color: #4cc9f0;
    margin-bottom: 1rem;
}

.contact-card h3 {
    color: #2b2d42;
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.contact-card p {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.contact-card a {
    color: #4cc9f0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-card a:hover {
    color: #3ab7dc;
}

@media (max-width: 768px) {
    .about-content,
    .contact-content {
        padding: 1rem;
    }

    .contact-info {
        grid-template-columns: 1fr;
    }
}

/* About Us Modal Styles */
.about-content {
    padding: 0 1rem;
}

.about-content p {
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.about-content h3 {
    color: var(--primary);
    margin: 2rem 0 1rem;
    font-size: var(--font-size-xl);
}

.about-content ul {
    list-style-type: none;
    padding: 0;
    margin: 1rem 0 2rem;
}

.about-content ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-dark);
    line-height: 1.6;
}

.about-content ul li::before {
    content: "•";
    color: var(--accent);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Contact Modal Styles */
.contact-content > p {
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 2rem;
    text-align: center;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.contact-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal);
}

.contact-card:hover {
    transform: translateY(-5px);
}

.contact-card i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.contact-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: var(--font-size-xl);
}

.contact-card p {
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.contact-card a {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-normal);
}

.contact-card a:hover {
    color: var(--primary);
}

.response-time {
    font-size: var(--font-size-sm);
    color: var(--text-light) !important;
    margin-top: 0.5rem;
}

.additional-info {
    background: var(--background);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-top: 2rem;
}

.additional-info h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: var(--font-size-lg);
}

.additional-info p {
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 768px) {
    .contact-info {
        grid-template-columns: 1fr;
    }
    
    .contact-card {
        padding: 1.5rem;
    }
    
    .additional-info {
        padding: 1.5rem;
    }
}

/* Loading and error states */
.loading,
.error {
    text-align: center;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 600px;
}

.loading {
    color: var(--accent);
}

.error {
    color: #dc3545;
}

/* Content Sections */
.content-section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.content-section:not(:target) {
    display: none;
}

.content-section:target {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subsection Navigation */
.subsection-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.subsection-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-dark);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.subsection-link i {
    color: var(--accent);
    font-size: 1.2rem;
}

.subsection-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.subsection-link.active {
    background: var(--accent);
    color: var(--white);
}

.subsection-link.active i {
    color: var(--white);
}

.subsection-content {
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-normal);
}

.subsection-content.active {
    opacity: 1;
    transform: translateY(0);
}

/* Additional content styling for new subtopics */
.democracy-principles,
.expression-rights,
.gender-equality,
.work-rights,
.climate-causes,
.climate-solutions {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.democracy-principles li,
.expression-rights li,
.gender-equality li,
.work-rights li,
.climate-causes li,
.climate-solutions li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    transition: all var(--transition-normal);
}

.democracy-principles li:hover,
.expression-rights li:hover,
.gender-equality li:hover,
.work-rights li:hover,
.climate-causes li:hover,
.climate-solutions li:hover {
    background: var(--bg-light);
    padding-left: 8px;
    border-radius: var(--radius-sm);
}

.democracy-principles i,
.expression-rights i,
.gender-equality i,
.work-rights i,
.climate-causes i,
.climate-solutions i {
    color: var(--accent);
    font-size: 1.1em;
    margin-top: 2px;
    flex-shrink: 0;
}

.democracy-principles strong,
.expression-rights strong,
.gender-equality strong,
.work-rights strong,
.climate-causes strong,
.climate-solutions strong {
    color: var(--text-dark);
    font-weight: 600;
}

.courts-list,
.roles-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.courts-list li,
.roles-list li {
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border-left: 4px solid var(--accent);
    transition: all var(--transition-normal);
}

.courts-list li:hover,
.roles-list li:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.rights-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.rights-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.rights-list i {
    color: var(--success);
    font-size: 1.1em;
}

/* Info boxes styling */
.info-box {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    color: var(--white);
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
}

.info-box h3 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box h3 i {
    font-size: 1.2em;
}

.info-box p {
    margin: 0;
    line-height: 1.6;
}

/* Responsive adjustments for new content */
@media (max-width: 768px) {
    .democracy-principles li,
    .expression-rights li,
    .gender-equality li,
    .work-rights li,
    .climate-causes li,
    .climate-solutions li {
        flex-direction: column;
        gap: 8px;
        padding: 16px 0;
    }
    
    .democracy-principles i,
    .expression-rights i,
    .gender-equality i,
    .work-rights i,
    .climate-causes i,
    .climate-solutions i {
        align-self: flex-start;
    }
    
    .info-box {
        padding: 16px;
        margin: 16px 0;
    }
}

/* Search functionality styling */
.search-modal-content {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--surface);
    color: var(--text-dark);
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-result-item {
    padding: 16px;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-result-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.search-result-item h3 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.1em;
    font-weight: 600;
}

.search-result-item p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-type {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent);
    color: var(--white);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8em;
    font-weight: 500;
}

.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.search-no-results i {
    font-size: 3em;
    color: var(--accent);
    margin-bottom: 16px;
    opacity: 0.5;
}

.search-no-results h3 {
    margin: 0 0 8px 0;
    color: var(--text-dark);
}

.search-no-results p {
    margin: 0;
    line-height: 1.5;
}

/* Search highlighting */
mark {
    background: var(--accent-light);
    color: var(--text-dark);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

body.dark-mode mark {
    background: rgba(55, 196, 255, 0.25);
    color: #ffffff;
}

/* Modal header styling for search */
.search-modal-content .modal-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.search-modal-content .modal-header h2 {
    margin: 0 0 4px 0;
    color: var(--text-dark);
}

body.dark-mode .search-modal-content {
    background: var(--surface);
}

body.dark-mode .search-result-item {
    background: var(--surface);
    border-color: var(--border);
}

body.dark-mode .search-result-item h3,
body.dark-mode .search-result-item p,
body.dark-mode .search-modal-content .modal-header h2,
body.dark-mode .search-modal-content .modal-header p,
body.dark-mode .search-no-results h3,
body.dark-mode .search-no-results p {
    color: rgba(255, 255, 255, 0.88);
}

body.dark-mode .search-result-type {
    color: var(--white);
}

.search-modal-content .modal-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9em;
}        /* Main content styles */
        .main-content {
            background: #ffffff;
            position: relative;
            min-height: 100vh;
            padding: clamp(40px, 3vw, 60px) clamp(15px, 1.5vw, 25px) clamp(35px, 3vw, 50px) clamp(100px, 10vw, 140px);
            transition: padding-left 0.3s ease;
            -ms-overflow-style: none;
            scrollbar-width: none;
            overflow-y: visible;
        }

        .main-content::-webkit-scrollbar {
            display: none;
        }

        /* Content section styles */
        .content-section {
            height: 100%;
            width: 100%;
            overflow: hidden;
        }

        /* Content container styles */
        .content-container {
            height: 100%;
            width: 100%;
            overflow: hidden;
        }

        /* Content styles */
        .content {
            height: 100%;
            width: 100%;
            overflow: hidden;
        }

        /* Header styles */
        header {
            position: fixed;
            top: clamp(8px, 1.5vw, 15px);
            left: calc(50% + (var(--sidebar-total) / 2));
            transform: translateX(-50%);
            z-index: 99;
            display: flex;
            justify-content: center;
            align-items: center;
            background: var(--surface);
            border-radius: clamp(10px, 1.2vw, 14px);
            box-shadow: var(--shadow-card);
            padding: 0;
            height: clamp(32px, 3.6vw, 36px);
            width: fit-content;
            border: 1px solid var(--border);
        }

        header nav {
            display: flex;
            height: 100%;
            align-items: center;
            justify-content: center;
            padding: 0 clamp(8px, 1vw, 12px);
            gap: 10px;
            width: 100%;
        }

        header .nav-link {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
            padding: 0 10px;
        }

        header .search-container {
            position: relative;
            height: 28px;
            margin: 0 4px;
            width: 190px;
            flex-shrink: 0;
        }

        header .search-input {
            width: 160px;
            height: 28px;
            padding: 0 30px 0 12px;
            border: 1px solid var(--border);
            border-radius: 14px;
            background: var(--surface-muted);
            font-size: 0.8em;
            color: #2c3e50;
            transition: all 0.2s ease;
        }

        header .search-input:focus {
            outline: none;
            border-color: rgba(55, 196, 255, 0.4);
            box-shadow: 0 0 0 1px rgba(55, 196, 255, 0.1);
            width: 190px;
        }

        header .search-icon {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            color: rgba(55, 196, 255, 0.6);
            font-size: 0.8em;
        }

        .dark-mode header .search-input {
            background: var(--surface-muted);
            border-color: var(--border);
            color: #ffffff;
        }

        .dark-mode header .search-input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        .dark-mode header .search-icon {
            color: rgba(55, 196, 255, 0.7);
        }

        header nav a, 
        header nav a:visited,
        header nav a:link,
        header nav a:active {
            color: #2c3e50;
            text-decoration: none;
            font-size: clamp(0.85em, 0.95vw, 0.95em);
            font-weight: 500;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 0 8px;
            height: 100%;
            background: transparent;
            border-radius: 10px;
        }

        header nav a i {
            color: #37c4ff;
            font-size: 1.1em;
        }

        header nav a:hover {
            color: #37c4ff;
            background: rgba(55, 196, 255, 0.14);
        }

        header nav a:hover i {
            color: #2c3e50;
        }

        header nav a:focus-visible,
        header nav a.active {
            background: rgba(55, 196, 255, 0.2);
        }

        /* Header theme toggle */
        .header-theme-toggle {
            width: 26px;
            height: 26px;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            background-color: var(--surface);
            border-radius: 50%;
            margin-left: 0;
            border: 2px solid rgba(55, 196, 255, 0.6);
            transition: all 0.2s ease;
            padding: 0;
            position: relative;
            top: 4px;
            transform: none;
        }

        .header-theme-toggle:hover {
            background-color: var(--surface-muted);
            border-color: rgba(55, 196, 255, 0.8);
        }

        .header-theme-toggle i {
            font-size: 14px;
            color: #333;
            transition: color 0.2s ease;
        }

        .dark-mode .header-theme-toggle {
            background-color: var(--surface-muted);
            border-color: rgba(55, 196, 255, 0.8);
        }

        .dark-mode .header-theme-toggle i {
            color: rgba(255, 255, 255, 0.9);
        }

        .dark-mode .header-theme-toggle:hover {
            background-color: rgba(55, 196, 255, 0.12);
            border-color: rgba(55, 196, 255, 0.9);
        }

        /* Footer styles */
        footer {
            position: fixed;
            bottom: clamp(8px, 1.5vw, 15px);
            left: calc(50% + (var(--sidebar-total) / 2));
            transform: translateX(-50%);
            z-index: 999;
            display: flex;
            justify-content: center;
            align-items: center;
            background: #ffffff;
            border-radius: 24px;
            box-shadow: 0 3px 20px rgba(0, 0, 0, 0.04);
            padding: 0 clamp(12px, 2vw, 20px);
            height: clamp(25px, 3vw, 30px);
            width: auto;
            min-width: clamp(160px, 18vw, 180px);
            transition: opacity 0.25s ease;
            opacity: 1;
        }

        footer p {
            color: #2c3e50;
            font-size: clamp(0.75em, 0.8vw, 0.85em);
            text-align: center;
            opacity: 0.8;
            margin: 0;
        }

        /* Dark mode footer */
        .dark-mode footer {
            background: #2c2c2c;
            box-shadow: 0 3px 20px rgba(0, 0, 0, 0.2);
        }

        .dark-mode footer p {
            color: #ffffff;
        }

        /* Sidebar styles */
        .sidebar {
            position: fixed;
            left: var(--sidebar-gutter);
            top: 50%;
            transform: translateY(-50%);
            width: var(--sidebar-width);
            max-height: 600px;
            height: calc(100vh - clamp(100px, 10vw, 130px));
            background: var(--surface);
            border-radius: clamp(14px, 1.5vw, 18px);
            padding: clamp(4px, 0.6vw, 6px);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            box-shadow: var(--shadow-card);
            z-index: 100;
            border: 1px solid var(--border);
        }

        .sidebar-logo {
            display: none;
        }

        .nav-items-container {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            overflow: visible;
            margin: 0;
            padding: 0 2px;
            gap: clamp(6px, 0.8vw, 10px);
        }

        .nav-section-title,
        .achievements-section h3 {
            color: #2c3e50;
            font-size: clamp(0.75em, 0.8vw, 0.85em);
            font-weight: 600;
            margin: 0 0 16px 0;
            text-align: center;
            width: 100%;
            position: relative;
            left: 0;
            transform: none;
            top: 0;
            height: auto;
            display: block;
        }

        /* Remove the first nav-item margin since we're repositioning everything */
        .nav-items-container .nav-item:first-child {
            margin-top: 0;
        }

        /* Nav items */
        .nav-item {
            background: var(--surface-muted);
            border-radius: 12px;
            padding: clamp(4px, 0.6vw, 6px) clamp(6px, 0.7vw, 8px);
            cursor: pointer;
            transition: all 0.2s ease;
            border: 1px solid var(--border);
            width: 92%;
            min-width: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            position: relative;
            box-shadow: var(--shadow-sm);
            height: clamp(50px, 5vw, 58px);
            margin: 0;
        }

        .nav-item:hover {
            background: rgba(55, 196, 255, 0.08);
            box-shadow: var(--shadow-md);
        }

        .nav-item:active {
            background: rgba(55, 196, 255, 0.12);
        }

        .nav-item:focus-visible {
            outline: 3px solid rgba(55, 196, 255, 0.35);
            outline-offset: 2px;
        }

        .nav-item i {
            color: #37c4ff;
            font-size: clamp(0.9em, 1vw, 1.1em);
            margin: 0;
            opacity: 0.9;
            display: flex;
            align-items: center;
            justify-content: center;
            height: 20px;
            width: 20px;
        }

        .nav-item h3 {
            margin: 4px 0 0 0;
            color: #2c3e50;
            font-size: clamp(0.7em, 0.75vw, 0.8em);
            font-weight: 500;
            width: 100%;
            line-height: 1.2;
            letter-spacing: 0.2px;
        }

        /* Collapse button */
        .collapse-btn {
            position: fixed;
            left: calc(var(--sidebar-width) + 10px);
            top: 50%;
            transform: translateY(-50%);
            z-index: 950;
            background: #ffffff;
            width: 24px;
            height: 50px;
            border-radius: 0 8px 8px 0;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            box-shadow: 3px 0 10px rgba(0, 0, 0, 0.1);
            border: none;
        }

        .sidebar.collapsed .collapse-btn {
            left: 63px;
            width: 18px;
            height: 30px;
            border-radius: 0 5px 5px 0;
        }

        .collapse-btn::before {
            content: "\f053";
            font-family: "Font Awesome 6 Free";
            font-weight: 900;
            color: rgba(0, 0, 0, 0.5);
            font-size: clamp(0.9em, 1vw, 1.1em);
            transition: all 0.3s ease;
        }

        .sidebar.collapsed .collapse-btn::before {
            transform: rotate(180deg);
            font-size: 0.75em;
        }

        .collapse-btn:hover {
            background: #f8f9fa;
        }

        .collapse-btn:active {
            transform: translateY(-50%) scale(0.98);
        }

        /* Collapsed state */
        .sidebar.collapsed {
            width: 55px;
            padding: clamp(4px, 0.6vw, 6px);
            height: auto;
            max-height: none;
            transform: translateY(-50%);
        }

        .sidebar.collapsed .nav-items-container {
            margin: 4px 0 4px 0;
            gap: 6px;
            padding: 0;
        }

        .sidebar.collapsed .nav-item {
            width: 38px;
            height: 38px;
            margin: 0 auto;
            padding: 0;
        }

        .sidebar.collapsed .theme-toggle {
            width: 38px;
            height: 38px;
            padding: 0;
            margin: 0 auto 4px auto;
            transition: width 0.3s ease, height 0.3s ease;
        }

        .sidebar.collapsed .theme-toggle::after {
            content: '';
            position: absolute;
            top: 4px;
            left: 4px;
            right: 4px;
            bottom: 4px;
            border: 3px solid #37c4ff;
            border-radius: 50%;
            opacity: 0.3;
            transition: all 0.3s ease;
        }

        .sidebar.collapsed .theme-toggle i {
            font-size: 1.1em;
            transition: font-size 0.3s ease;
        }

        .dark-mode .sidebar.collapsed .theme-toggle::after {
            border-color: rgba(55, 196, 255, 0.7);
        }

        .sidebar.collapsed .theme-toggle:hover::after {
            opacity: 0.5;
        }

        .dark-mode .sidebar.collapsed .theme-toggle:hover::after {
            opacity: 0.9;
        }

        .sidebar.collapsed .nav-item i {
            font-size: 1.1em;
            margin: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            height: auto;
            width: auto;
            padding: 0;
            position: static;
        }

        .sidebar.collapsed .nav-item h3 {
            display: none;
        }

        /* Main content adjustment */
        .sidebar.collapsed ~ .main-content {
            padding-left: clamp(120px, 12vw, 160px);
        }

        @media (max-width: 768px) {
            .sidebar {
                left: 0;
                top: 50%;
                transform: translate(-100%, -50%);
                border-radius: 0;
            }

            .main-content {
                padding: clamp(35px, 4vw, 45px) clamp(12px, 1.5vw, 15px) clamp(30px, 4vw, 40px) clamp(12px, 1.5vw, 15px);
            }

            .sidebar.collapsed ~ .main-content {
                padding-left: clamp(12px, 1.5vw, 15px);
            }

            header nav {
                padding-left: 20px;
                justify-content: space-between;
            }
        }

        /* Remove scrollbar styles */
        ::-webkit-scrollbar {
            display: none;
        }

        * {
            -ms-overflow-style: none;
            scrollbar-width: none;
        }

        /* Mobile menu toggle */
        .menu-toggle {
            display: none;
            position: fixed;
            top: 20px;
            left: 20px;
            z-index: 1000;
            background: #4169E1;
            color: white;
            border: none;
            padding: 10px;
            border-radius: 5px;
            cursor: pointer;
        }

        @media (max-width: 768px) {
            .sidebar {
                left: 0;
                top: 50%;
                transform: translate(-100%, -50%);
                border-radius: 0;
            }

            .main-content {
                padding-top: 65px;
                padding-bottom: 55px;
            }

            .sidebar.collapsed + .main-content {
                padding-left: 20px;
            }

            header nav {
                padding-left: 20px;
                justify-content: space-between;
            }
        }

        body {
            margin: 0;
            background: #ffffff;
            overflow-x: hidden;
            overflow-y: auto;
            min-height: 100vh;
            padding: 0;
            position: relative;
        }

        html {
            overflow-y: auto;
        }

        /* Modal styles */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 2000;
            opacity: 0;
            transition: opacity 0.3s ease;
            align-items: center;
            justify-content: center;
        }

        .modal.show {
            opacity: 1;
            display: flex;
        }

        .modal-content {
            position: relative;
            background: var(--surface);
            border-radius: clamp(16px, 1.5vw, 20px);
            box-shadow: var(--shadow-card);
            width: 90%;
            max-width: min(340px, 80vw);
            padding: 0;
            transform: scale(0.95);
            transition: transform 0.3s ease, opacity 0.3s ease;
            opacity: 0;
            text-align: left;
            border: 1px solid var(--border);
            overflow: hidden;
        }

        .modal.show .modal-content {
            transform: scale(1);
            opacity: 1;
        }

        .modal-close {
            position: absolute;
            top: clamp(10px, 1.2vw, 12px);
            right: clamp(12px, 1.5vw, 15px);
            font-size: clamp(20px, 2vw, 24px);
            color: #2c3e50;
            background: none;
            border: none;
            cursor: pointer;
            padding: 0;
            width: clamp(25px, 2.5vw, 30px);
            height: clamp(25px, 2.5vw, 30px);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            border-radius: clamp(6px, 0.8vw, 8px);
            opacity: 0.7;
        }

        .modal-close:hover {
            opacity: 1;
            background: rgba(0, 0, 0, 0.05);
        }

        .dark-mode .modal-close {
            color: rgba(255, 255, 255, 0.7);
        }

        .dark-mode .modal-close:hover {
            color: rgba(255, 255, 255, 0.9);
            background: rgba(255, 255, 255, 0.1);
        }

        .modal-header {
            padding: clamp(12px, 1.4vw, 16px) clamp(14px, 1.6vw, 18px);
            border-bottom: 1px solid var(--border);
            text-align: left;
        }

        .modal-header h2 {
            color: var(--text-dark);
            font-size: clamp(1em, 1.1vw, 1.2em);
            font-weight: 600;
            margin: 0;
            text-align: left;
        }

        .modal-body {
            color: var(--text-dark);
            text-align: left;
            padding: clamp(12px, 1.4vw, 16px) clamp(14px, 1.6vw, 18px);
            max-height: min(60vh, 520px);
            overflow-y: auto;
        }

        .about-content p {
            margin: 0 0 clamp(6px, 1vw, 10px) 0;
            line-height: 1.5;
            font-size: clamp(0.8em, 0.85vw, 0.9em);
        }

        .about-content h3 {
            font-size: clamp(0.95em, 1vw, 1.1em);
            margin: clamp(8px, 1vw, 10px) 0 clamp(4px, 0.6vw, 6px) 0;
        }

        .about-content ul {
            padding-left: clamp(12px, 1.2vw, 15px);
            margin: clamp(4px, 0.6vw, 6px) 0 clamp(6px, 1vw, 10px) 0;
        }

        .about-content li {
            margin: clamp(3px, 0.5vw, 5px) 0;
            color: #2c3e50;
            line-height: 1.4;
            font-size: clamp(0.8em, 0.85vw, 0.9em);
        }

        .contact-info {
            display: grid;
            gap: clamp(5px, 0.7vw, 7px);
            margin-top: clamp(3px, 0.6vw, 6px);
            width: 100%;
        }

        .contact-card, 
        .about-card {
            background: #f7f8f9;
            border-radius: clamp(10px, 1.2vw, 14px);
            padding: clamp(5px, 0.7vw, 7px);
            text-decoration: none;
            transition: all 0.2s ease;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            text-align: left;
            border: 1px solid transparent;
            margin: 0 auto;
            width: 100%;
            cursor: pointer;
        }

        a.contact-card:hover,
        a.contact-card:active,
        a.contact-card:visited {
            text-decoration: none;
            color: inherit;
        }

        .contact-card:hover, 
        .about-card:hover {
            background: rgba(55, 196, 255, 0.05);
            border-color: rgba(55, 196, 255, 0.3);
            transform: translateY(-2px);
            box-shadow: 0 3px 8px rgba(55, 196, 255, 0.1);
        }

        .dark-mode .contact-card:hover,
        .dark-mode .about-card:hover {
            background: rgba(55, 196, 255, 0.08);
            border-color: rgba(55, 196, 255, 0.3);
        }

        .contact-card h3,
        .about-card h3 {
            margin: 0;
            color: #2c3e50;
            font-size: clamp(0.9em, 1vw, 1em);
            font-weight: 600;
        }

        .contact-card p,
        .about-card p {
            margin: clamp(3px, 0.5vw, 5px) 0;
            color: #2c3e50;
            font-size: clamp(0.75em, 0.8vw, 0.85em);
            line-height: 1.4;
        }

        .contact-card i,
        .about-card i {
            color: #37c4ff;
            font-size: clamp(1.2em, 1.3vw, 1.4em);
            margin-bottom: clamp(3px, 0.5vw, 5px);
        }

        /* Contact Modal and About Us Modal */
        #contactModal .modal-content,
        #aboutModal .modal-content {
            height: auto;
            max-height: none;
            overflow: visible;
            width: 90%;
            max-width: min(340px, 80vw);
        }

        /* Dark mode styles for cards */
        .dark-mode .contact-card,
        .dark-mode .about-card {
            background: rgba(255, 255, 255, 0.05);
        }

        .dark-mode .contact-card h3,
        .dark-mode .about-card h3,
        .dark-mode .contact-card p,
        .dark-mode .about-card p {
            color: #ffffff;
        }

        /* Welcome section styles */
        .welcome-section {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 0;
            max-width: min(500px, 70vw);
            margin: 0 auto;
            text-align: center;
            position: absolute;
            top: 45%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

        .welcome-header {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: clamp(4px, 0.8vw, 6px);
            margin-bottom: clamp(8px, 1.2vw, 10px);
            width: 100%;
        }

        .welcome-logo {
            width: clamp(120px, 12vw, 130px);
            height: clamp(120px, 12vw, 130px);
            background: rgba(247, 248, 249, 0.95);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 0 0 1px rgba(55, 196, 255, 0.05),
                       0 2px 4px rgba(55, 196, 255, 0.03);
            overflow: hidden;
            margin-bottom: clamp(2px, 0.4vw, 3px);
            border: 1px solid rgba(55, 196, 255, 0.2);
        }

        .welcome-logo img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            padding: 8px;
            background: rgba(247, 248, 249, 0.95);
            border-radius: 10px;
        }

        .welcome-text-container {
            background: #f7f8f9;
            border-radius: 14px;
            padding: clamp(12px, 1.5vw, 15px);
            width: 100%;
            box-shadow: 0 0 0 1px rgba(55, 196, 255, 0.05),
                       0 2px 4px rgba(55, 196, 255, 0.03);
        }

        .welcome-title {
            color: #2c3e50;
            font-size: clamp(1.8em, 2vw, 2.2em);
            font-weight: 600;
            margin: 0;
            line-height: 1.2;
            position: relative;
            padding-bottom: clamp(8px, 1vw, 10px);
        }

        .welcome-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 2px;
            background: linear-gradient(90deg, #37c4ff, rgba(55, 196, 255, 0.3));
            border-radius: 1px;
        }

        .welcome-subtitle {
            color: #2c3e50;
            font-size: clamp(1em, 1.1vw, 1.2em);
            font-weight: 400;
            margin: clamp(12px, 1.5vw, 15px) 0 0 0;
            line-height: 1.4;
            opacity: 0.9;
        }

        .welcome-content {
            display: grid;
            gap: clamp(15px, 2vw, 20px);
            width: 100%;
            max-width: min(500px, 70vw);
            margin: clamp(25px, 3vw, 30px) auto 0;
        }

        .info-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: clamp(12px, 1.5vw, 15px);
            width: 100%;
        }

        .info-card {
            background: #f7f8f9;
            border-radius: 14px;
            padding: clamp(12px, 1.5vw, 15px);
            transition: all 0.2s ease;
            box-shadow: 0 0 0 1px rgba(55, 196, 255, 0.05),
                       0 2px 4px rgba(55, 196, 255, 0.03);
            text-align: left;
            min-height: 120px;
        }

        .info-card h2 {
            color: #2c3e50;
            font-size: clamp(1em, 1.1vw, 1.2em);
            font-weight: 600;
            margin: 0 0 clamp(10px, 1.2vw, 12px) 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .info-card p {
            color: #2c3e50;
            line-height: 1.5;
            margin: 0;
            font-size: clamp(0.9em, 0.95vw, 1em);
        }







        /* Theme toggle button */
        .theme-toggle {
            position: relative;
            width: clamp(46px, 4.6vw, 54px);
            height: clamp(46px, 4.6vw, 54px);
            padding: 0;
            margin: 0 0 clamp(6px, 0.8vw, 10px) 0;
            box-shadow: none !important;
            background: transparent !important;
            border: none !important;
            outline: none !important;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: width 0.3s ease, height 0.3s ease;
        }

        .theme-toggle i {
            color: #37c4ff;
            font-size: clamp(1.2em, 1.3vw, 1.4em);
            transition: font-size 0.3s ease;
            position: relative;
            z-index: 2;
        }

        /* Collapsed state */
        .sidebar.collapsed .theme-toggle {
            width: 38px;
            height: 38px;
            padding: 0;
            margin: 0 auto 4px auto;
            transition: width 0.3s ease, height 0.3s ease;
        }

        .sidebar.collapsed .theme-toggle i {
            font-size: 1.1em;
            transition: font-size 0.3s ease;
        }

        /* Dark mode styles */
        body.dark-mode {
            background: #1a1a1a;
        }

        .dark-mode .main-content {
            background: #1a1a1a;
        }

        .dark-mode header,
        .dark-mode footer,
        .dark-mode .sidebar,
        .dark-mode .right-sidebar,
        .dark-mode .theme-toggle,
        .dark-mode .collapse-btn,
        .dark-mode .right-collapse-btn,
        .dark-mode .modal-content {
            background: var(--surface);
            box-shadow: var(--shadow-card);
        }

        .dark-mode .nav-item,
        .dark-mode .achievement-slot,
        .dark-mode .search-input,
        .dark-mode .welcome-text-container,
        .dark-mode .info-card,
        .dark-mode .contact-card,
        .dark-mode .about-card {
            background: rgba(255, 255, 255, 0.05);
        }

        .dark-mode .nav-item:hover,
        .dark-mode .achievement-slot:hover {
            background: rgba(55, 196, 255, 0.1);
        }

        .dark-mode .nav-item h3,
        .dark-mode header nav a,
        .dark-mode .welcome-title,
        .dark-mode .welcome-subtitle,
        .dark-mode .info-card h2,
        .dark-mode .info-card p,
        .dark-mode .modal-header h2,
        .dark-mode .about-content p,
        .dark-mode .about-content li,
        .dark-mode .contact-card h3,
        .dark-mode .contact-card p,
        .dark-mode .about-card h3,
        .dark-mode .about-card p,
        .dark-mode footer p,
        .dark-mode .achievements-section h3 {
            color: #ffffff;
        }
        
        /* Improved text contrast for dark mode */
        .dark-mode h1, 
        .dark-mode h2, 
        .dark-mode h3, 
        .dark-mode h4, 
        .dark-mode h5, 
        .dark-mode h6 {
            color: rgba(255, 255, 255, 0.95);
        }
        
        .dark-mode p, 
        .dark-mode li, 
        .dark-mode span, 
        .dark-mode div {
            color: rgba(255, 255, 255, 0.85);
        }
        
        /* Fix for specific dark blue text in subtopics/sections */
        .dark-mode .subtopic-body li,
        .dark-mode .subtopic-body p,
        .dark-mode .subtopic-body span,
        .dark-mode .subtopic-body div,
        .dark-mode .subtopic-body strong {
            color: rgba(255, 255, 255, 0.85);
        }
        
        /* Make sure all icons are visible */
        .dark-mode i.fas,
        .dark-mode i.far,
        .dark-mode i.fab {
            color: rgba(55, 196, 255, 0.9);
        }
        
        /* Fix for specific role text items in dark mode */
        .dark-mode [class*="rolle"],
        .dark-mode [class*="domstol"],
        .dark-mode [class*="aktør"],
        .dark-mode [id*="rolle"],
        .dark-mode [id*="domstol"],
        .dark-mode [id*="aktør"] {
            color: rgba(255, 255, 255, 0.9) !important;
        }

        .dark-mode .search-input {
            color: #ffffff;
            border-color: rgba(55, 196, 255, 0.2);
        }

        .dark-mode .search-input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        .dark-mode .welcome-logo {
            background: rgba(255, 255, 255, 0.03);
            border-color: rgba(55, 196, 255, 0.1);
            box-shadow: 0 0 0 1px rgba(55, 196, 255, 0.1);
        }

        .dark-mode .welcome-logo img {
            background: rgba(255, 255, 255, 0.03);
        }

        /* Dark mode styles for collapse buttons */
        .dark-mode .collapse-btn,
        .dark-mode .right-collapse-btn {
            background: #2c2c2c;
        }

        .dark-mode .collapse-btn:hover,
        .dark-mode .right-collapse-btn:hover {
            background: #363636;
        }

        .dark-mode .collapse-btn::before,
        .dark-mode .right-collapse-btn::before {
            color: rgba(255, 255, 255, 0.7);
        }

        .collapse-btn::before,
        .right-collapse-btn::before {
            content: "";
            font-family: "Font Awesome 6 Free";
            font-weight: 900;
            font-size: clamp(0.9em, 1vw, 1.1em);
            color: rgba(0, 0, 0, 0.5);
            transition: all 0.3s ease;
        }

        .collapse-btn::before {
            content: "\f053"; /* chevron-left */
        }

        .right-collapse-btn::before {
            content: "\f054"; /* chevron-right */
        }

        .sidebar.collapsed .collapse-btn::before {
            transform: rotate(180deg);
            font-size: 0.75em;
        }

        .right-sidebar.collapsed .right-collapse-btn::before {
            transform: rotate(180deg);
            font-size: 0.75em;
        }

        .collapse-btn:hover::before,
        .right-collapse-btn:hover::before {
            color: #37c4ff;
        }

        /* Add styles for the nav section title */
        .nav-section-title {
            color: #2c3e50;
            font-size: clamp(0.75em, 0.8vw, 0.85em);
            font-weight: 600;
            margin: 0 0 12px 0;
            text-align: center;
            width: 100%;
        }

        .dark-mode .nav-section-title {
            color: #ffffff;
        }

        .sidebar.collapsed .nav-section-title {
            display: none;
        }

        /* Dark mode icon adjustments */
        .dark-mode .nav-item i,
        .dark-mode .theme-toggle i,
        .dark-mode header nav a i,
        .dark-mode .search-icon,
        .dark-mode .sidebar.collapsed .search-icon,
        .dark-mode footer p i {
            color: rgba(55, 196, 255, 0.7);
        }

        .dark-mode .nav-item:hover i {
            color: rgba(55, 196, 255, 0.9);
        }

        .dark-mode header nav a:hover {
            color: rgba(55, 196, 255, 0.9);
            background: rgba(55, 196, 255, 0.18);
        }

        .dark-mode header nav a:hover i {
            color: rgba(255, 255, 255, 0.9);
        }

        .dark-mode header nav a:focus-visible,
        .dark-mode header nav a.active {
            background: rgba(55, 196, 255, 0.22);
        }

        .dark-mode .achievement-slot::before {
            color: rgba(55, 196, 255, 0.4);
        }

        .dark-mode .achievement-slot:hover::before {
            color: rgba(55, 196, 255, 0.6);
        }

        .dark-mode .achievement-slot.earned i {
            color: rgba(255, 215, 0, 0.8);
        }

        .dark-mode .achievement-slot {
            border-color: rgba(55, 196, 255, 0.2);
        }

        .dark-mode .achievement-slot.earned {
            border-color: rgba(255, 215, 0, 0.3);
        }

        /* Dark mode collapsed state adjustments */
        .dark-mode .sidebar.collapsed .nav-item {
            background: rgba(255, 255, 255, 0.03);
            box-shadow: 0 0 0 1px rgba(55, 196, 255, 0.1);
        }

        .dark-mode .sidebar.collapsed .nav-item:hover {
            background: rgba(55, 196, 255, 0.08);
            box-shadow: 0 0 0 1px rgba(55, 196, 255, 0.1),
                       0 3px 6px rgba(55, 196, 255, 0.08);
            /* Remove any transform effects */
        }

        .dark-mode .right-sidebar.collapsed .achievement-slot {
            background: rgba(255, 255, 255, 0.03);
            border-color: rgba(55, 196, 255, 0.1);
            box-shadow: 0 0 0 1px rgba(55, 196, 255, 0.05);
        }

        .dark-mode .right-sidebar.collapsed .achievement-slot:hover {
            background: rgba(55, 196, 255, 0.08);
            border-color: rgba(55, 196, 255, 0.15);
        }

        .dark-mode .right-sidebar.collapsed .search-input {
            background: rgba(255, 255, 255, 0.03);
            border-color: rgba(55, 196, 255, 0.1);
        }

        .dark-mode .right-sidebar.collapsed .search-input:hover {
            background: rgba(55, 196, 255, 0.08);
            border-color: rgba(55, 196, 255, 0.15);
        }

        .dark-mode .sidebar.collapsed .theme-toggle {
            background: rgba(255, 255, 255, 0.03);
            box-shadow: 0 0 0 1px rgba(55, 196, 255, 0.1);
        }

        .dark-mode .sidebar.collapsed .theme-toggle:hover {
            background: rgba(55, 196, 255, 0.08);
            box-shadow: 0 0 0 1px rgba(55, 196, 255, 0.15);
        }

        .right-sidebar.collapsed .achievements-section h3 {
            display: none;
        }

        .right-sidebar.collapsed .achievements-grid {
            gap: 6px;
            padding: 4px 4px 4px 4px;
            margin-top: 0;
        }

        .right-sidebar.collapsed .achievements-section {
            margin-top: 4px;
        }

        /* Popup search styles */
        .popup-search {
            position: fixed;
            right: clamp(8px, 1.5vw, 15px);
            background: #ffffff;
            border-radius: 14px;
            box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
            width: 250px;
            padding: 10px;
            z-index: 1002;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.2s ease, visibility 0.2s ease;
            border: 1px solid rgba(55, 196, 255, 0.15);
            top: 20px;
        }

        .popup-search.active {
            opacity: 1;
            visibility: visible;
        }

        .popup-search input {
            width: 100%;
            padding: 8px 35px 8px 12px;
            border: 1px solid rgba(55, 196, 255, 0.2);
            border-radius: 10px;
            font-size: 0.9em;
            color: #2c3e50;
            background: rgba(247, 248, 249, 0.95);
        }

        .popup-search input:focus {
            outline: none;
            border-color: rgba(55, 196, 255, 0.4);
            box-shadow: 0 0 0 1px rgba(55, 196, 255, 0.1);
        }

        .popup-search .search-icon {
            position: absolute;
            right: 20px;
            top: 50%;
            transform: translateY(-50%);
            color: rgba(55, 196, 255, 0.6);
            font-size: 0.9em;
        }

        /* Dark mode styles for popup search */
        .dark-mode .popup-search {
            background: #2c2c2c;
            border-color: rgba(55, 196, 255, 0.15);
        }

        .dark-mode .popup-search input {
            background: rgba(255, 255, 255, 0.03);
            border-color: rgba(55, 196, 255, 0.2);
            color: #ffffff;
        }

        .dark-mode .popup-search input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        /* Tooltip styles */
        .nav-item {
            position: relative;
        }

        .sidebar.collapsed .nav-item::after {
            content: attr(data-tooltip);
            position: absolute;
            left: 80px;
            top: 50%;
            transform: translateY(-50%);
            background: #ffffff;
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 0.85em;
            color: #2c3e50;
            white-space: nowrap;
            opacity: 0;
            visibility: hidden;
            transition: all 0.2s ease;
            box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(55, 196, 255, 0.15);
            pointer-events: none;
            z-index: 3000;
        }

        /* Remove special tooltip position for the Bærekraft item */
        .sidebar.collapsed .nav-item:hover::after {
            opacity: 1;
            visibility: visible;
        }

        /* Dark mode tooltip */
        .dark-mode .sidebar.collapsed .nav-item::after {
            background: #2c2c2c;
            color: #ffffff;
            border-color: rgba(55, 196, 255, 0.2);
            box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
        }

        .contact-link {
            color: #37c4ff;
            font-size: clamp(0.8em, 0.85vw, 0.9em);
            font-weight: 500;
            margin-top: clamp(2px, 0.4vw, 3px);
        }

        /* Main content container */
        .main-container {
            width: 100%;
            max-width: 1200px;
            min-height: calc(100vh - 60px);
            margin: 0;
            padding: 0 20px 40px 20px;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
            position: relative;
            top: 60px;
            overflow-y: visible;
            scrollbar-width: none; /* Firefox */
            -ms-overflow-style: none; /* IE and Edge */
            border-top: 1px solid transparent;
            border-bottom: 1px solid transparent;
            border-left: 1px solid transparent;
            border-right: 1px solid transparent;
            z-index: 10;
        }
        
        .main-container::-webkit-scrollbar {
            display: none; /* Chrome, Safari, Opera */
        }

        /* Remove sidebar-dependent positioning */
        .right-sidebar.collapsed ~ main {
            padding-right: var(--page-pad);
        }

        /* Welcome section container */
        .welcome-container {
            width: 100%;
            margin: 20px auto;
            padding-bottom: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
        }

        /* Main logo */
        .main-logo {
            width: 120px;
            height: 120px;
            margin-bottom: 20px;
            margin-top: 10px;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        }

        /* Heading styles */
        .main-heading {
            font-size: clamp(2em, 4vw, 3em);
            font-weight: 700;
            color: #2c3e50;
            margin: 0 0 10px 0;
            text-align: center;
        }

        /* Remove the main-heading-underline since we now have the blue underline in the samfunn-title */
        .main-heading-underline {
            display: none;
        }

        .sub-heading {
            font-size: clamp(1.1em, 2vw, 1.5em);
            color: #505c6e;
            margin: 15px 0 30px 0;
            font-weight: 400;
            text-align: center;
        }

        /* Welcome text container */
        .welcome-text-container {
    background: #ffffff;
    border-radius: clamp(16px, 2vw, 20px);
    padding: clamp(16px, 2vw, 22px);
            margin: 10px 0;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
            width: 100%;
            max-width: 800px;
            box-sizing: border-box;
    border: 1px solid rgba(55, 196, 255, 0.12);
    text-align: left;
        }

        .welcome-title {
            font-size: clamp(1.1em, 1.6vw, 1.5em);
            color: #2c3e50;
            margin: 0 0 10px 0;
            font-weight: 600;
    text-align: left;
        }

        .welcome-text {
            font-size: clamp(0.85em, 1.1vw, 1em);
            color: #505c6e;
            line-height: 1.4;
    margin: 0 0 10px 0;
    text-align: left;
        }

        /* Dark mode styles for main content */
        .dark-mode .main-heading {
            color: #ffffff;
        }

        .dark-mode .sub-heading {
            color: rgba(255, 255, 255, 0.85);
        }

        .dark-mode .welcome-text-container {
            background: rgba(255, 255, 255, 0.05);
        }

        .dark-mode .welcome-title {
            color: #ffffff;
        }

        .dark-mode .welcome-text {
            color: rgba(255, 255, 255, 0.85);
        }

        .dark-mode .nav-item,
        .dark-mode .achievement-slot,
        .dark-mode .search-input,
        .dark-mode .welcome-text-container,
        .dark-mode .info-card,
        .dark-mode .contact-card,
        .dark-mode .about-card {
            background: rgba(255, 255, 255, 0.05);
        }

        .dark-mode .nav-item h3,
        .dark-mode header nav a,
        .dark-mode .welcome-title,
        .dark-mode .sub-heading,
        .dark-mode .main-heading,
        .dark-mode .welcome-text,
        .dark-mode .info-card h2,
        .dark-mode .info-card p,
        .dark-mode .modal-header h2,
        .dark-mode .about-content p,
        .dark-mode .about-content li,
        .dark-mode .contact-card h3,
        .dark-mode .contact-card p,
        .dark-mode .about-card h3,
        .dark-mode .about-card p,
        .dark-mode footer p,
        .dark-mode .achievements-section h3 {
            color: #ffffff;
        }

        /* Topic content styles */
        .topic-content {
            width: 100%;
            padding: 10px 15px 30px 15px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .topic-title {
            font-size: clamp(1.8em, 3vw, 2.5em);
            font-weight: 700;
            color: #2c3e50;
            margin: 0 0 10px 0;
            text-align: center;
        }

        .topic-underline {
            width: 60%;
            height: 3px;
            background: linear-gradient(90deg, #37c4ff 0%, #4e7fff 100%);
            margin: 10px auto 30px;
            border-radius: 3px;
        }

        .topic-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            width: 100%;
            max-width: 1000px;
            align-items: stretch;
        }

        .topic-card {
            background: #ffffff;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            transition: all 0.3s ease;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 12px;
            border: 1px solid rgba(55, 196, 255, 0.1);
            cursor: pointer;
            min-height: 210px;
        }

        .topic-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(55, 196, 255, 0.1);
            border-color: rgba(55, 196, 255, 0.3);
        }

        .topic-card:focus-visible {
            outline: 3px solid rgba(55, 196, 255, 0.45);
            outline-offset: 2px;
        }

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(55, 196, 255, 0.12);
}

.card-icon i {
    font-size: 1.5em;
    color: #37c4ff;
    margin: 0;
        }

        .topic-card h3 {
            font-size: 1.2em;
            font-weight: 600;
            color: #2c3e50;
            margin: 0;
        }

        .topic-card p {
            font-size: 0.9em;
            color: #505c6e;
            line-height: 1.5;
            margin: 0;
            flex: 1;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

/* Shared surface styling for consistency */
.topic-card,
.resource-card,
.contact-card,
.about-card,
.welcome-text-container,
.info-card,
.term {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.topic-card:hover,
.resource-card:hover,
.contact-card:hover,
.about-card:hover,
.term:hover {
    box-shadow: var(--shadow-card-hover);
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    align-items: center;
}

.card-badge {
    font-size: 0.75em;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--background);
    color: var(--text-dark);
    border: 1px solid rgba(55, 196, 255, 0.2);
}

.badge-type {
    background: rgba(55, 196, 255, 0.12);
    color: #2c3e50;
}

.badge-count {
    background: rgba(67, 97, 238, 0.12);
    color: #2c3e50;
    border-color: rgba(67, 97, 238, 0.2);
}

.badge-difficulty.badge-easy {
    background: rgba(76, 175, 80, 0.15);
    color: #2b7a33;
    border-color: rgba(76, 175, 80, 0.3);
}

.badge-difficulty.badge-medium {
    background: rgba(67, 97, 238, 0.12);
    color: #2c3e50;
    border-color: rgba(67, 97, 238, 0.2);
}

.badge-difficulty.badge-hard {
    background: rgba(247, 37, 133, 0.12);
    color: #8a1f52;
    border-color: rgba(247, 37, 133, 0.3);
        }

        /* Active state for navigation items */
        .nav-item.active {
            background: rgba(55, 196, 255, 0.15);
            box-shadow: 0 0 0 1px rgba(55, 196, 255, 0.3),
                       0 3px 6px rgba(55, 196, 255, 0.1);
            transform: translateY(-1px);
        }

        .sidebar.collapsed .nav-item.active {
            background: rgba(55, 196, 255, 0.15);
            border-color: rgba(55, 196, 255, 0.3);
        }

        /* Dark mode for topic content */
        .dark-mode .topic-title {
            color: #ffffff;
        }

        .dark-mode .topic-card {
            background: rgba(255, 255, 255, 0.05);
            border-color: rgba(55, 196, 255, 0.1);
        }

        .dark-mode .topic-card:hover {
            background: rgba(55, 196, 255, 0.08);
            border-color: rgba(55, 196, 255, 0.3);
        }

        .dark-mode .topic-card h3 {
            color: #ffffff;
        }

        .dark-mode .topic-card p {
            color: rgba(255, 255, 255, 0.85);
        }

.dark-mode .card-badge {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(55, 196, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
}

.dark-mode .badge-type {
    background: rgba(55, 196, 255, 0.18);
}

.dark-mode .badge-count {
    background: rgba(67, 97, 238, 0.18);
}

.dark-mode .badge-difficulty.badge-easy {
    background: rgba(76, 175, 80, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.dark-mode .badge-difficulty.badge-medium {
    background: rgba(67, 97, 238, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.dark-mode .badge-difficulty.badge-hard {
    background: rgba(247, 37, 133, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

        /* Animation for topic cards */
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .topic-card {
            animation: fadeIn 0.4s ease forwards;
            opacity: 0;
        }

        .topic-card:nth-child(1) { animation-delay: 0.1s; }
        .topic-card:nth-child(2) { animation-delay: 0.2s; }
        .topic-card:nth-child(3) { animation-delay: 0.3s; }
        .topic-card:nth-child(4) { animation-delay: 0.4s; }
        .topic-card:nth-child(5) { animation-delay: 0.5s; }
        .topic-card:nth-child(6) { animation-delay: 0.6s; }
        .topic-card:nth-child(7) { animation-delay: 0.7s; }
        .topic-card:nth-child(8) { animation-delay: 0.8s; }

        /* Animation for topic title */
        .topic-title {
            animation: fadeDown 0.5s ease forwards;
            opacity: 0;
            transform: translateY(-20px);
        }

        .topic-underline {
            animation: growWidth 0.8s ease forwards;
            width: 0%;
        }

        @keyframes fadeDown {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes growWidth {
            from {
                width: 0%;
            }
            to {
                width: 60%;
            }
        }

        /* Subtopic content styles */
        .subtopic-content {
            width: 100%;
            min-height: 0;
            max-height: none;
            height: auto;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            overflow: visible;
        }

        .subtopic-header {
            width: 100%;
            display: flex;
            align-items: center;
            margin-bottom: 10px;
            padding: 10px 15px 0 15px;
            position: sticky;
            top: 0;
            background: white;
            z-index: 10;
        }

        .dark-mode .subtopic-header {
            background: #1a1a1a;
        }

        .subtopic-underline {
            width: 100%;
            height: 3px;
            background: linear-gradient(90deg, #37c4ff 0%, #4e7fff 50%, transparent 100%);
            margin: 15px 0 25px;
            border-radius: 3px;
            animation: growWidth 0.8s ease forwards;
            width: 0%;
            padding: 0 15px;
        }

        .subtopic-body {
            width: 100%;
            height: auto;
            overflow-y: visible;
            padding: 0 15px 20px 15px;
            animation: fadeIn 0.6s ease forwards;
            animation-delay: 0.3s;
            opacity: 0;
            box-sizing: border-box;
        }

        .back-button {
            background: rgba(55, 196, 255, 0.1);
            border: none;
            padding: 8px 15px;
            border-radius: 20px;
            display: flex;
            align-items: center;
            color: #37c4ff;
            font-weight: 600;
            font-size: 0.9em;
            cursor: pointer;
            transition: all 0.2s ease;
            margin-right: 15px;
            border: 1px solid rgba(55, 196, 255, 0.2);
        }

        .back-button:hover {
            background: rgba(55, 196, 255, 0.2);
            transform: translateX(-3px);
        }

        .back-button i {
            margin-right: 6px;
        }

        .subtopic-title {
            font-size: clamp(1.5em, 2.5vw, 2.2em);
            font-weight: 700;
            color: #2c3e50;
            margin: 0;
            animation: fadeInRight 0.5s ease forwards;
            opacity: 0;
        }

        @keyframes fadeInRight {
            from {
                opacity: 0;
                transform: translateX(20px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        .subtopic-intro {
            font-size: 1.1em;
            line-height: 1.6;
            color: #2c3e50;
            margin-bottom: 25px;
            border-left: 3px solid #37c4ff;
            padding-left: 15px;
            font-weight: 500;
        }

        .subtopic-body h2 {
            font-size: 1.4em;
            color: #2c3e50;
            margin: 25px 0 15px;
            font-weight: 600;
        }

        .subtopic-body p {
            font-size: 1em;
            line-height: 1.6;
            color: #505c6e;
            margin-bottom: 15px;
        }

        .info-box {
            background: rgba(55, 196, 255, 0.05);
            border: 1px solid rgba(55, 196, 255, 0.2);
            padding: 15px 20px;
            border-radius: 10px;
            margin: 20px 0;
        }

        .info-box h3 {
            font-size: 1.1em;
            color: #37c4ff;
            margin: 0 0 10px 0;
            display: flex;
            align-items: center;
        }

        .info-box h3 i {
            margin-right: 8px;
        }

        .info-box p {
            margin-bottom: 0;
            font-size: 0.95em;
        }

        .rights-list, .courts-list, .roles-list {
            list-style: none;
            padding: 0;
            margin: 15px 0;
        }

        .rights-list li, .roles-list li {
            margin-bottom: 10px;
            display: flex;
            align-items: center;
        }

        .rights-list li i, .roles-list li i {
            margin-right: 10px;
            color: #37c4ff;
        }

        .courts-list li {
            margin-bottom: 10px;
            padding-left: 20px;
            position: relative;
        }

        .courts-list li:before {
            content: "•";
            position: absolute;
            left: 0;
            color: #37c4ff;
        }

        /* Dark mode for subtopic content */
        .dark-mode .subtopic-title,
        .dark-mode .subtopic-body h2 {
            color: #ffffff;
        }

        .dark-mode .subtopic-intro {
            color: rgba(255, 255, 255, 0.9);
        }

        .dark-mode .subtopic-body p,
        .dark-mode .courts-list li {
            color: rgba(255, 255, 255, 0.8);
        }

        .dark-mode .back-button {
            background: rgba(55, 196, 255, 0.15);
            color: #37c4ff;
        }

        .dark-mode .back-button:hover {
            background: rgba(55, 196, 255, 0.25);
        }

        .dark-mode .info-box {
            background: rgba(55, 196, 255, 0.1);
            border-color: rgba(55, 196, 255, 0.2);
        }

        .dark-mode .info-box p {
            color: rgba(255, 255, 255, 0.8);
        }
        
        /* Standardized styles for begreper lists */
        .begreper-list {
            list-style: none;
            padding: 0;
            margin: 0;
            width: 100%;
            max-width: 800px;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            align-items: center;
        }
        
        /* Add styles for begrep-item */
        .begrep-item {
            background: #f7f8f9;
            border-radius: 10px;
            padding: 15px;
            margin-bottom: 15px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
            border: 1px solid rgba(55, 196, 255, 0.1);
        }
        
        .begrep-item h3 {
            color: #2c3e50;
            font-size: 1.1em;
            margin: 0 0 8px 0;
            font-weight: 600;
        }
        
        .begrep-item p {
            color: #505c6e;
            font-size: 0.9em;
            line-height: 1.5;
            margin: 0;
        }
        
        /* Dark mode styles for begrep-item */
        .dark-mode .begrep-item {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(55, 196, 255, 0.15);
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }
        
        .dark-mode .begrep-item h3 {
            color: rgba(255, 255, 255, 0.95);
        }
        
        .dark-mode .begrep-item p {
            color: rgba(255, 255, 255, 0.85);
        }

        .right-sidebar.collapsed .achievement-slot {
            width: 38px;
            height: 38px;
            margin: 0 auto;
            padding: 0;
        }

        .sidebar .search-section {
            width: 100%;
            padding: 0;
            margin-bottom: 8px;
        }

        .sidebar .search-container {
            position: relative;
            width: 100%;
        }

        .sidebar.collapsed .search-input {
            display: none;
        }

        .sidebar.collapsed .search-section {
            display: block;
            margin: 4px 0;
            width: 100%;
        }

        .sidebar.collapsed .search-container {
            width: 38px;
            height: 38px;
            margin: 0 auto;
            position: relative;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(247, 248, 249, 0.95);
            border: 1px solid rgba(55, 196, 255, 0.1);
            border-radius: 12px;
            box-shadow: 0 0 0 1px rgba(55, 196, 255, 0.05),
                       0 2px 4px rgba(55, 196, 255, 0.03);
        }

        .sidebar.collapsed .search-icon {
            display: block;
            position: static;
            transform: none;
            color: rgba(55, 196, 255, 0.6);
            font-size: 0.9em;
            transition: color 0.2s ease;
        }

        .sidebar.collapsed .search-container:hover {
            background: rgba(55, 196, 255, 0.08);
            border-color: rgba(55, 196, 255, 0.15);
        }

        /* Animation for main heading */
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes growWidth {
            from {
                width: 0%;
            }
            to {
                width: 60%;
            }
        }

        .main-heading {
            animation: fadeIn 0.8s ease forwards;
            position: relative;
            padding-bottom: 10px;
            margin-bottom: 15px;
        }

        .main-heading::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 20%;
            width: 0%;
            height: 3px;
            background: linear-gradient(90deg, #37c4ff 0%, #4e7fff 100%);
            border-radius: 3px;
            animation: growWidth 0.8s ease forwards;
            animation-delay: 0.6s;
        }

        .sub-heading {
            animation: fadeIn 0.8s ease forwards;
            animation-delay: 1.2s;
            opacity: 0;
        }

        .main-logo {
            animation: fadeIn 0.8s ease forwards;
            animation-delay: 0.1s;
            opacity: 0;
        }

        /* Dark mode collapsed state adjustments */
        .dark-mode .achievement-slot.earned {
            border-color: rgba(255, 215, 0, 0.3);
        }

        /* Dark mode styles for begrep-item */
        .dark-mode .begrep-item {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(55, 196, 255, 0.15);
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }
        
        .dark-mode .begrep-item h3 {
            color: rgba(255, 255, 255, 0.95);
        }
        
        .dark-mode .begrep-item p {
            color: rgba(255, 255, 255, 0.85);
        }
        
        /* Improve readability of role descriptions in dark mode */
        .dark-mode .subtopic-body a,
        .dark-mode .subtopic-body strong {
            color: rgba(255, 255, 255, 0.95);
        }
        
        /* Fix for dark blue text in Rollefordeling section */
        .dark-mode .subtopic-content .dommere,
        .dark-mode .subtopic-content .advokater,
        .dark-mode .subtopic-content .påtalemyndigheten,
        .dark-mode .subtopic-content .roles-list strong,
        .dark-mode .subtopic-content .courts-list strong {
            color: rgba(255, 255, 255, 0.95) !important;
        }
        
        /* Fix for specific role text items in dark mode */
        .dark-mode [class*="rolle"],
        .dark-mode [class*="domstol"],
        .dark-mode [class*="aktør"],
        .dark-mode [id*="rolle"],
        .dark-mode [id*="domstol"],
        .dark-mode [id*="aktør"] {
            color: rgba(255, 255, 255, 0.9) !important;
        }
        
        /* Fix specifically for the Rettssystemet page roles */
        .dark-mode .rollefordeling h2,
        .dark-mode .rollefordeling p,
        .dark-mode .rollefordeling span,
        .dark-mode .rollefordeling div {
            color: rgba(255, 255, 255, 0.9) !important;
        }
        
        /* Direct fix for the specific dark blue text in the screenshot */
        .dark-mode [class*="dommer"],
        .dark-mode [class*="advokat"],
        .dark-mode [class*="påtalemyndighet"],
        .dark-mode [class*="høyesterett"],
        .dark-mode [class*="tingrett"],
        .dark-mode [class*="lagmannsrett"] {
            color: rgba(255, 255, 255, 0.9) !important;
        }

        /* Hide scroll indicators */
        #scrollDownIndicator, #scrollUpIndicator {
            display: none !important;
        }
