/* IT Fjernundervisning - Main Stylesheet */

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
}

/* Header */
#masthead {
    background: #2c3e50;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title a {
    color: white;
    text-decoration: none;
    font-size: 1.4em;
    font-weight: bold;
}

#topnav a {
    color: #ccc;
    text-decoration: none;
    margin-left: 20px;
    font-size: 0.95em;
}

#topnav a:hover, #topnav a.active {
    color: white;
}

/* Main content */
#content {
    max-width: 1000px;
    margin: 30px auto;
    padding: 30px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Footer */
#footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9em;
}

#footer a { color: #3498db; }

/* Headings */
h1 { color: #2c3e50; border-bottom: 3px solid #3498db; padding-bottom: 10px; margin-top: 0; }
h2 { color: #34495e; margin-top: 30px; }
h3 { color: #34495e; }

/* Breadcrumb */
.breadcrumb {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px;
}
.breadcrumb a { color: #3498db; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Course liste */
.lesson-list { margin-top: 20px; }

.lesson-item {
    padding: 14px 18px;
    margin: 8px 0;
    background: #fafafa;
    border: 1px solid #e1e4e8;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: box-shadow 0.15s;
}
.lesson-item:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.08); background: white; }
.lesson-item a { text-decoration: none; color: #0366d6; font-weight: 500; }
.lesson-item a:hover { text-decoration: underline; }

.topic-group { margin: 20px 0; }
.topic-group > h3 { border-left: 3px solid #3498db; padding-left: 10px; }

/* Lesson type badges */
.lesson-type {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.8em;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.type-1 { background: #e3f2fd; color: #1565c0; }  /* Beskrivelse - blå */
.type-2 { background: #fff3e0; color: #e65100; }  /* Øvelse - orange */
.type-3 { background: #e8f5e9; color: #2e7d32; }  /* Løsning - grøn */

/* Lesson content */
.lesson-content img {
    max-width: 100%;
    height: auto;
    border: 1px solid #e1e4e8;
    border-radius: 3px;
    margin: 10px 0;
    display: block;
}

/* Lesson sections (Beskrivelse, Øvelse, Løsning) */
.lesson-section {
    margin: 30px 0;
}

.lesson-section-title {
    color: #2c3e50;
    border-left: 4px solid #3498db;
    padding-left: 12px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.lesson-section-beskrivelse .lesson-section-title {
    border-left-color: #3498db; /* Blue */
}

.lesson-section-øvelse .lesson-section-title {
    border-left-color: #f39c12; /* Orange */
}

.lesson-section-løsning .lesson-section-title {
    border-left-color: #27ae60; /* Green */
}

hr.lesson-separator {
    border: none;
    border-top: 2px solid #e1e4e8;
    margin: 40px 0;
}

.lesson-content pre,
.pre-code-box pre {
    background: #282c34;
    color: #abb2bf;
    padding: 16px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

.lesson-content code {
    background: #f0f0f0;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.pre-code-box pre code { background: transparent; color: inherit; padding: 0; }

.lesson-content table { border-collapse: collapse; width: 100%; margin: 15px 0; }
.lesson-content th, .lesson-content td { border: 1px solid #e1e4e8; padding: 8px 12px; }
.lesson-content th { background: #f6f8fa; text-align: left; }
.lesson-content a { color: #0366d6; }

/* Navigation buttons */
.lesson-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e1e4e8;
    gap: 10px;
}

.nav-btn {
    padding: 10px 18px;
    background: #f6f8fa;
    border: 1px solid #d1d5da;
    border-radius: 5px;
    text-decoration: none;
    color: #24292e;
    font-size: 0.9em;
    transition: background 0.15s;
}
.nav-btn:hover { background: #e1e4e8; }
.nav-btn.disabled { opacity: 0.4; pointer-events: none; }

/* Back link */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    padding: 7px 14px;
    background: #f6f8fa;
    border: 1px solid #d1d5da;
    border-radius: 5px;
    text-decoration: none;
    color: #24292e;
    font-size: 0.9em;
}
.back-link:hover { background: #e1e4e8; }

/* Course description */
.course-description {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px 20px;
    border-radius: 0 5px 5px 0;
    margin: 20px 0;
}

/* Lesson type badge (stor) */
.lesson-type-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 3px;
    font-size: 0.95em;
    font-weight: 500;
    margin-bottom: 20px;
}

/* CTA box */
.cta {
    background: #2c3e50;
    color: white;
    padding: 25px;
    border-radius: 5px;
    margin: 40px 0 0 0;
    text-align: center;
}
.cta h3 { margin-top: 0; color: white; font-size: 1.2em; }
.cta p { margin-bottom: 10px; }
.cta a {
    display: inline-block;
    background: #3498db;
    color: white;
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: bold;
    margin-top: 8px;
}
.cta a:hover { background: #2980b9; }

/* Responsive */
@media (max-width: 768px) {
    #masthead { flex-direction: column; gap: 10px; text-align: center; }
    #topnav a { margin: 0 8px; }
    #content { margin: 15px; padding: 20px; }
    .lesson-nav { flex-direction: column; }
}

/* Course Overview Page */
.course-category {
    margin: 50px 0;
}

.course-category h2 {
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 8px;
}

.category-intro {
    color: #666;
    font-size: 1.05em;
    margin-bottom: 25px;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.course-card {
    background: white;
    border: 2px solid #e1e4e8;
    border-radius: 8px;
    padding: 24px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.course-card h3 {
    margin: 0 0 12px 0;
    font-size: 1.3em;
}

.course-card h3 a {
    text-decoration: none;
    color: #2c3e50;
}

.course-card h3 a:hover {
    color: #3498db;
}

.course-desc {
    color: #666;
    font-size: 0.95em;
    line-height: 1.5;
    flex: 1;
    margin: 0 0 20px 0;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e1e4e8;
}

.lesson-count {
    font-size: 0.85em;
    color: #666;
}

.course-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
}

.course-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .course-grid {
        grid-template-columns: 1fr;
    }
}
/* Lesson Layout with Sidebar */
.lesson-layout {
    display: flex;
    gap: 30px;
    max-width: 1400px !important;
    margin: 0 auto;
    padding: 0 !important;
}

/* Sidebar */
.lesson-sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e1e4e8;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    background: #2c3e50;
    color: white;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.course-title-link {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    display: block;
}

.course-title-link:hover {
    color: #3498db;
}

/* Lesson Navigation List */
.lesson-nav-list {
    padding: 10px 0;
}

/* Lesson Groups */
.lesson-group {
    margin: 15px 0;
}

.lesson-group-title {
    font-weight: bold;
    font-size: 0.85em;
    text-transform: uppercase;
    color: #666;
    padding: 8px 20px;
    background: #e8eaed;
    border-left: 3px solid #3498db;
}

.lesson-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}

.lesson-nav-item:hover {
    background: #e8eaed;
    border-left-color: #3498db;
}

.lesson-nav-item.active {
    background: #e3f2fd;
    border-left-color: #2196f3;
    color: #1976d2;
    font-weight: 500;
}

.lesson-nav-item .checkmark {
    margin-right: 8px;
    color: #27ae60;
    font-weight: bold;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid #e1e4e8;
    position: sticky;
    bottom: 0;
    background: #f8f9fa;
}

.back-to-course {
    display: block;
    padding: 8px 12px;
    background: white;
    border: 1px solid #d1d5da;
    border-radius: 4px;
    text-decoration: none;
    color: #24292e;
    text-align: center;
    font-size: 0.9em;
}

.back-to-course:hover {
    background: #f6f8fa;
}

/* Main Lesson Content */
.lesson-main {
    flex: 1;
    min-width: 0;
    padding: 30px;
    background: white;
}

/* Lesson Pagination (Bottom navigation) */
.lesson-pagination {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 50px 0 30px 0;
    padding-top: 30px;
    border-top: 2px solid #e1e4e8;
}

.nav-btn {
    flex: 1;
    max-width: 280px;
    padding: 16px 20px;
    background: white;
    border: 2px solid #e1e4e8;
    border-radius: 8px;
    text-decoration: none;
    color: #24292e;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-btn small {
    display: block;
    font-size: 0.75em;
    color: #666;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.nav-btn:hover {
    background: #f6f8fa;
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.prev-btn {
    text-align: left;
}

.prev-btn small::before {
    content: '← ';
}

.next-btn {
    text-align: right;
}

.next-btn small::after {
    content: ' →';
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .lesson-layout {
        flex-direction: column;
        padding: 0 !important;
    }
    
    .lesson-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #e1e4e8;
    }
    
    .sidebar-header {
        position: static;
    }
    
    .lesson-nav-list {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .sidebar-header::after {
        content: ' ▼';
        float: right;
        font-size: 0.8em;
    }
    
    /* Toggle functionality kan tilføjes med JavaScript */
    .lesson-sidebar.open .lesson-nav-list {
        max-height: 1000px;
    }
    
    .lesson-main {
        padding: 20px 15px;
    }
    
    .lesson-pagination {
        flex-direction: column;
    }
    
    .nav-btn {
        width: 100%;
    }
}

/* Print styles */
@media print {
    .lesson-sidebar,
    .breadcrumb,
    .lesson-pagination,
    .cta,
    #masthead,
    #footer {
        display: none !important;
    }
    
    .lesson-main {
        padding: 0;
    }
}
