/* Kursus Dashboard Styles */
.course-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h2 {
    margin-bottom: 20px;
    font-size: 28px;
    color: #333;
    border-bottom: 2px solid #e5e5e5;
    padding-bottom: 10px;
}

/* Dashboard stats */
.dashboard-stats {
    display: flex;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item {
    flex: 1;
    min-width: 150px;
    background: #fff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-right: 15px;
    margin-bottom: 10px;
    text-align: center;
    border-top: 3px solid #0073aa;
}

.stat-item:last-child {
    margin-right: 0;
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 5px;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 14px;
}

/* Dashboard filters - Accordion Style */
.dashboard-filters {
    background: #f5f9ff;
    margin-bottom: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 0;
    overflow: hidden;
}

.dashboard-filters h3 {
    margin: 0;
    padding: 15px 20px;
    font-size: 18px;
    color: #0073aa;
    background: #e5f0fa;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    border-bottom: 1px solid #d0e4f3;
}

.dashboard-filters h3:after {
    content: "▼";
    font-size: 12px;
    transition: transform 0.3s;
}

.dashboard-filters.collapsed h3:after {
    transform: rotate(-90deg);
}

.dashboard-filters .filter-row {
    padding: 20px;
    max-height: 500px;
    transition: max-height 0.3s ease, padding 0.3s ease;
    overflow: hidden;
}

.dashboard-filters.collapsed .filter-row {
    max-height: 0;
    padding: 0 20px;
    visibility: hidden;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.filter-field {
    margin-right: 20px;
    margin-bottom: 10px;
}

.filter-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.filter-field select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
}

.filter-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    margin-top: 20px;
    margin-right: 10px;
    transition: background 0.2s;
}

.filter-button:hover {
    background: #005a87;
}

.filter-button.reset {
    background: #f1f1f1;
    color: #555;
}

.filter-button.reset:hover {
    background: #e0e0e0;
}

/* Tabs navigation */
.dashboard-tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 1px solid #ddd;
}

.dashboard-tabs .tab {
    padding: 10px 20px;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    margin-right: 5px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    background: #f5f5f5;
}

.dashboard-tabs .tab.active {
    background: #fff;
    color: #0073aa;
    border-color: #ddd;
    border-bottom-color: #fff;
    margin-bottom: -1px;
}

.dashboard-tabs .tab:hover {
    background: #e9e9e9;
    color: #0073aa;
}

.no-items {
    background: #f9f9f9;
    padding: 30px;
    text-align: center;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

/* Course Styles */
.course-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

.course-item {
    display: flex;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.2s;
    border: 1px solid #e0e0e0;
}

.course-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.course-thumbnail {
    flex: 0 0 200px;
    margin-right: 20px;
}

.course-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
}

.course-info {
    flex: 1;
}

.course-info h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
    line-height: 1.3;
    color: #0073aa;
}

.course-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
}

.course-meta span {
    margin-right: 15px;
}

.document-count {
    display: inline-block;
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 13px;
}

.course-description {
    margin-bottom: 15px;
    color: #555;
}

.course-documents {
    background: #f5f9ff;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
}

.course-documents h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #0073aa;
}

.course-documents ul {
    margin: 0;
    padding: 0 0 0 20px;
}

.course-documents li {
    margin-bottom: 8px;
    padding: 6px;
    border-radius: 4px;
    position: relative;
}

/* New class for document read status */
.document-read {
    background-color: rgba(238, 238, 238, 0.4);
}

.document-unread {
    background-color: rgba(255, 255, 237, 0.7);
    border-left: 3px solid #f2cc8f;
}

.document-new {
    position: relative;
}

.document-link {
    color: #0073aa;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

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

.document-read .document-link {
    color: #666;
}

.document-read .document-link::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><polyline points="9 15 12 18 15 15"></polyline><path d="M12 18v-8"></path></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

.document-unread .document-link::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%230073aa" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

.new-badge {
    display: inline-block;
    background: #e25a5a;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: bold;
}

/* Mindre knapper med samme stil */
.mark-read-button, .mark-unread-button {
    background: #f1f1f1;
    border: 1px solid #ddd;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
    color: #555;
    cursor: pointer;
    margin-left: 6px;
    vertical-align: middle;
    display: inline-block;
    position: static;
    width: auto;
    height: auto;
}

.mark-read-button:hover, .mark-unread-button:hover {
    background: #e9e9e9;
}

.mark-unread-button {
    background: #eaeaea;
    color: #666;
}

.document-expired, .course-expired {
    margin-top: 15px;
    padding: 10px;
    background: #fff5f5;
    border-left: 3px solid #d32f2f;
    color: #d32f2f;
}

.login-required {
    text-align: center;
    padding: 40px 20px;
}

.login-required .button {
    display: inline-block;
    background: #0073aa;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
    margin-top: 15px;
    transition: background 0.2s;
}

.login-required .button:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

/* Loading indicator */
.loading-indicator {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
}

.error-message {
    padding: 15px;
    background: #fff5f5;
    border-left: 3px solid #d32f2f;
    color: #d32f2f;
    margin: 20px 0;
}

/* Responsive styling */
@media (max-width: 768px) {
    .document-list {
        grid-template-columns: 1fr;
    }
    
    .course-item {
        flex-direction: column;
    }
    
    .course-thumbnail {
        flex: none;
        margin-right: 0;
        margin-bottom: 15px;
        max-width: 100%;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-field {
        width: 100%;
        margin-right: 0;
    }
    
    .filter-field select {
        width: 100%;
    }
}

/* Mobile optimizations */
@media (max-width: 767px) {
    /* Skjul knapper og badges på mobil - denne regel skal være allersidst for at være gældende */
    .mark-read-button,
    .mark-unread-button,
    .new-badge {
        display: none !important;
    }
    
    /* Optimized statistics */
	
	   /* Forbedret dokumenter liste */
    .course-documents li {
        margin-bottom: 5px;
        padding: 8px 10px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        position: relative;
        border-radius: 4px;
    }
    
    .document-link {
        display: inline-block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: calc(100% - 40px);
        max-width: calc(100% - 40px);
    }
    
    /* Yderligere forbedringer til collapse/expand */
    .dashboard-filters h3 {
        padding: 10px 15px;
        background: #f0f7ff;
    }
    
    .course-info h3 {
        background: #f5f9ff;
        color: #0073aa;
        font-weight: 500;
    }
    
    .dashboard-stats {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        margin-bottom: 15px;
    }
    
    .stat-item {
        flex: 0 0 calc(33.33% - 6px);
        padding: 8px 5px;
        margin-right: 0;
        margin-bottom: 10px;
        min-width: 0;
    }
    
    .stat-value {
        font-size: 22px;
        margin-bottom: 2px;
    }
    
    .stat-label {
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Accordion courses */
    .course-item {
        flex-direction: column;
        margin-bottom: 15px;
    }
    
    .course-thumbnail {
        display: none; /* Hide thumbnails on mobile */
    }
    
    .course-info h3 {
        font-size: 18px;
        margin: 0;
        padding: 12px 15px;
        background: #f5f9ff;
        border-radius: 5px 5px 0 0;
        cursor: pointer;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .course-info h3:after {
        content: "▼";
        font-size: 12px;
        transition: transform 0.3s;
    }
    
    .course-collapsed h3:after {
        transform: rotate(-90deg);
    }
    
    .course-content {
        padding: 15px;
        border: 1px solid #e5e5e5;
        border-top: none;
        border-radius: 0 0 5px 5px;
        transition: max-height 0.3s, padding 0.3s;
        overflow: hidden;
        max-height: 2000px;
    }
    
    .course-collapsed .course-content {
        max-height: 0;
        padding: 0 15px;
        border: none;
    }
    
    .course-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .course-meta span {
        margin-bottom: 5px;
    }
    
    /* Compact document list */
    .course-documents {
        padding: 0;
        background: transparent;
    }
    
    .course-documents h4 {
        font-size: 16px;
        margin: 15px 0 10px;
    }
    
    .course-documents ul {
        margin: 0;
        padding: 0;
    }
    
    .course-documents li {
        margin-bottom: 5px;
        padding: 8px 10px;
        display: flex;
        align-items: center;
        position: relative;
        border-radius: 4px;
    }
    
    .document-link {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100% - 40px);
        padding-right: 35px;
    }
}

/* VIGTIGT: Tilføj dette JavaScript til din side for at få accordion-funktionaliteten til at virke:

document.addEventListener('DOMContentLoaded', function() {
    var filterHeader = document.querySelector('.dashboard-filters h3');
    var filterContainer = document.querySelector('.dashboard-filters');
    
    // Tilføj collapsed class som standard
    filterContainer.classList.add('collapsed');
    
    // Skift visning ved klik
    if (filterHeader) {
        filterHeader.addEventListener('click', function() {
            filterContainer.classList.toggle('collapsed');
        });
    }
});

*/