/**
 * LMS Dashboard Styling
 */
.lms-dashboard-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.lms-chart-container {
    position: relative;
    margin: auto;
    height: 400px;
    width: 100%;
}

.lms-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Teacher Dashboard specific */
.lms-teacher-search-header {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin: 20px 0;
}

.lms-search-container {
    position: relative;
    flex-grow: 1;
    max-width: 500px;
}

.lms-search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-top: none;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
}

.lms-search-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f1;
    cursor: pointer;
}

.lms-search-result-item:hover {
    background: #f0f6fb;
}

.lms-search-result-item:last-child {
    border-bottom: none;
}

.lms-search-no-results {
    padding: 10px 15px;
    color: #646970;
    font-style: italic;
}

.lms-engagement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.lms-stat-card {
    background: #f6f7f7;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #2271b1;
    display: flex;
    flex-direction: column;
}

.lms-stat-label {
    font-size: 12px;
    color: #646970;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.lms-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
}

.lms-risk-card {
    padding: 15px;
    background: #fff8e5;
    border-left: 4px solid #ffb900;
    margin-bottom: 10px;
}

.lms-risk-card.high-risk {
    background: #fcf0f1;
    border-left-color: #d63638;
}

/* Toggle Switch */
.lms-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.lms-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.lms-slider {
    position: relative;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.lms-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .lms-slider {
    background-color: #2271b1;
}

input:checked + .lms-slider:before {
    transform: translateX(20px);
}

.lms-empty-state {
    text-align: center;
    padding: 100px 20px;
    color: #646970;
    font-size: 16px;
    background: #fff;
    border: 1px dashed #ccd0d4;
}

/* Status Color Coding */
.lms-status-green { color: #008a20; font-weight: 600; }
.lms-status-yellow { color: #dba617; font-weight: 600; }
.lms-status-red { color: #d63638; font-weight: 600; }

.lms-hw-backlog-badge {
    padding: 2px 8px;
    background: #f0f0f1;
    border-radius: 10px;
    font-size: 11px;
}

.lms-hw-backlog-badge.has-backlog {
    background: #fcf0f1;
    color: #d63638;
    border: 1px solid #f86368;
}

/* Global Search Integration */
.lms-search-global-header {
    padding: 10px 15px;
    background: #f6f7f7;
    font-weight: 600;
    border-bottom: 1px solid #ccd0d4;
    color: #1d2327;
}

/* Read-Only Global View */
.lms-is-global-view .lms-force-review-btn,
.lms-is-global-view #lms-export-student-csv {
    display: none !important;
}

/* Roster Table */
.lms-progress-bar {
    width: 100%;
    background-color: #f0f0f1;
    border-radius: 3px;
    height: 10px;
    margin-bottom: 2px;
}

.lms-progress-fill {
    height: 100%;
    background-color: #2271b1;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* History Timeline */
.lms-history-session {
    border: 1px solid #ccd0d4;
    background: #fff;
    margin-bottom: 10px;
    border-radius: 4px;
}

.lms-history-session-header {
    padding: 10px 15px;
    background: #f6f7f7;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid transparent;
}

.lms-history-session-header:hover {
    background: #f0f0f1;
}

.lms-history-session-body {
    padding: 15px;
    border-top: 1px solid #ccd0d4;
}

/* AI Briefing Card */
.lms-ai-briefing {
    background: #f0f6fb;
    border-left: 4px solid #72aee6;
    padding: 15px;
    margin-bottom: 20px;
}

.lms-ai-briefing h3 {
    margin-top: 0;
    color: #1d2327;
}

/* Struggling Concepts */
#lms-struggling-concepts-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#lms-struggling-concepts-list li {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 10px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 3px;
}

/* Session Detail Modal */
.lms-session-modal {
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
}

.lms-session-modal-content {
    background-color: #fefefe;
    padding: 30px;
    border: 1px solid #888;
    width: 800px;
    max-width: 90%;
    border-radius: 5px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.lms-session-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #ccd0d4;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.lms-session-modal-close {
    color: #646970;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.lms-session-modal-close:hover {
    color: #1d2327;
}

.lms-session-nav-btns {
    display: flex;
    gap: 10px;
}

.lms-session-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.lms-session-section {
    margin-bottom: 20px;
}

.lms-session-section-title {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 10px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #ccd0d4;
    padding-bottom: 5px;
    display: block;
}

.lms-session-content-box {
    background: #f6f7f7;
    padding: 12px;
    border: 1px solid #ccd0d4;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.lms-session-transcript-area {
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
    background: #1d2327;
    color: #c3c4c7;
    cursor: zoom-in;
    transition: max-height 0.3s ease;
}

.lms-session-transcript-area.expanded {
    max-height: 1000px;
    cursor: zoom-out;
}

.lms-session-chart-container {
    height: 250px;
    margin-top: 10px;
}

.lms-session-homework-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.lms-session-homework-item {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lms-session-copy-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #46b450;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: none;
    z-index: 100001;
}

@media (max-width: 782px) {
    .lms-session-details-grid {
        grid-template-columns: 1fr;
    }
}
