/*
 * My LMS — Frontend Styles
 * Minimal, clean styles that work alongside any WordPress theme.
 * All classes are prefixed with .my-lms- to avoid conflicts.
 */

/* ── WRAPPER ──────────────────────────────────────────────────────────────── */
.my-lms-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px;
}

/* ── BUTTONS ──────────────────────────────────────────────────────────────── */
.my-lms-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background 0.15s, color 0.15s;
}
.my-lms-btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.my-lms-btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.my-lms-btn-outline {
    background: transparent;
    color: #2563eb;
    border-color: #2563eb;
}
.my-lms-btn-outline:hover { background: #eff6ff; }

/* ── NOTICES ──────────────────────────────────────────────────────────────── */
.my-lms-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 16px;
    font-size: 14px;
}
.my-lms-notice-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ── COURSE HERO ──────────────────────────────────────────────────────────── */
.my-lms-course-hero {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 40px;
}
.my-lms-course-thumbnail { flex: 0 0 340px; }
.my-lms-course-thumbnail img { width: 100%; border-radius: 10px; }
.my-lms-course-header { flex: 1; }
.my-lms-course-title { font-size: 28px; margin: 0 0 12px; }
.my-lms-course-excerpt { color: #555; margin-bottom: 16px; }
.my-lms-course-meta { display: flex; gap: 16px; margin-bottom: 20px; color: #666; font-size: 14px; }
.my-lms-course-meta span::before { margin-right: 4px; }

/* ── CURRICULUM ───────────────────────────────────────────────────────────── */
.my-lms-curriculum h2 { font-size: 22px; margin-bottom: 16px; }
.my-lms-section { border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.my-lms-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.my-lms-section-header h3 { margin: 0; font-size: 15px; }
.my-lms-section-count { font-size: 13px; color: #9ca3af; }
.my-lms-lesson-list { list-style: none; margin: 0; padding: 0; }
.my-lms-lesson-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}
.my-lms-lesson-item:last-child { border-bottom: none; }
.my-lms-lesson-item.locked { color: #9ca3af; }
.my-lms-lesson-item a { text-decoration: none; color: #1e40af; }
.my-lms-lesson-item a:hover { text-decoration: underline; }
.my-lms-lesson-title { flex: 1; }
.my-lms-lesson-duration { font-size: 12px; color: #9ca3af; }
.my-lms-lock { font-size: 12px; }

/* ── COURSE GRID (archive) ────────────────────────────────────────────────── */
.my-lms-archive-title { font-size: 28px; margin-bottom: 28px; }
.my-lms-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.my-lms-course-card { border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.my-lms-card-thumbnail img { width: 100%; display: block; }
.my-lms-card-body { padding: 16px; }
.my-lms-card-title { font-size: 17px; margin: 0 0 8px; }
.my-lms-card-title a { text-decoration: none; color: inherit; }
.my-lms-card-excerpt { font-size: 14px; color: #555; margin-bottom: 12px; }
.my-lms-card-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; font-size: 13px; color: #666; }
.my-lms-badge { padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.my-lms-badge-enrolled { background: #dcfce7; color: #166534; }

/* ── LESSON PAGE ──────────────────────────────────────────────────────────── */
.my-lms-lesson-wrap { display: flex; gap: 32px; align-items: flex-start; }
.my-lms-lesson-sidebar {
    flex: 0 0 260px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    position: sticky;
    top: 24px;
    max-height: 80vh;
    overflow-y: auto;
}
.my-lms-sidebar-header {
    padding: 12px 16px;
    background: #1e40af;
    font-weight: 600;
}
.my-lms-sidebar-header a { color: #fff; text-decoration: none; font-size: 14px; }
.my-lms-sidebar-section { border-bottom: 1px solid #f3f4f6; }
.my-lms-sidebar-section-title { margin: 0; padding: 10px 16px 4px; font-size: 12px; font-weight: 700; color: #9ca3af; text-transform: uppercase; }
.my-lms-sidebar-section ul { list-style: none; margin: 0; padding: 0 0 8px; }
.my-lms-sidebar-section li a { display: block; padding: 6px 16px; font-size: 13px; text-decoration: none; color: #374151; }
.my-lms-sidebar-section li a:hover { background: #f3f4f6; }
.my-lms-sidebar-section li.active a { background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.my-lms-lesson-main { flex: 1; min-width: 0; }
.my-lms-lesson-title { font-size: 26px; margin-bottom: 6px; }
.my-lms-lesson-meta { color: #9ca3af; font-size: 14px; margin-bottom: 20px; }

/* ── VIDEO ────────────────────────────────────────────────────────────────── */
.my-lms-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    margin-bottom: 28px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}
.my-lms-video-wrapper iframe,
.my-lms-video-wrapper video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* ── DOWNLOAD BOX ─────────────────────────────────────────────────────────── */
.my-lms-download-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 24px 0;
}

/* ── LESSON NAV ───────────────────────────────────────────────────────────── */
.my-lms-lesson-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .my-lms-course-hero { flex-direction: column; }
    .my-lms-course-thumbnail { flex: unset; width: 100%; }
    .my-lms-lesson-wrap { flex-direction: column; }
    .my-lms-lesson-sidebar { position: static; max-height: none; width: 100%; flex: unset; }
}

/* ── TEST PAGE ────────────────────────────────────────────────────────────── */
.my-lms-test-header { margin-bottom: 28px; }
.my-lms-back-link { font-size: 14px; color: #2563eb; text-decoration: none; display: inline-block; margin-bottom: 10px; }
.my-lms-back-link:hover { text-decoration: underline; }
.my-lms-test-meta { display: flex; gap: 20px; font-size: 14px; color: #666; margin-top: 8px; }

/* Timer */
.my-lms-timer {
    background: #1e40af;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

/* Questions */
.my-lms-questions { display: flex; flex-direction: column; gap: 24px; margin-bottom: 32px; }
.my-lms-question-block { border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px 20px; background: #fafafa; }
.my-lms-question-text { font-size: 16px; font-weight: 500; margin: 0 0 14px; }
.my-lms-answer-choices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.my-lms-answer-choices li label { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 8px 12px; border-radius: 6px; border: 1px solid #e5e7eb; background: #fff; transition: background 0.1s; }
.my-lms-answer-choices li label:hover { background: #eff6ff; border-color: #bfdbfe; }

/* Result */
.my-lms-test-result { border-radius: 12px; padding: 24px 28px; margin-bottom: 32px; display: flex; align-items: center; gap: 24px; }
.result-passed { background: #f0fdf4; border: 2px solid #86efac; }
.result-failed  { background: #fff7ed; border: 2px solid #fed7aa; }
.my-lms-score-circle { text-align: center; }
.my-lms-score-number { display: block; font-size: 42px; font-weight: 800; line-height: 1; }
.my-lms-score-label  { font-size: 15px; font-weight: 600; }
.result-passed .my-lms-score-number { color: #16a34a; }
.result-failed  .my-lms-score-number { color: #ea580c; }

/* Review */
.my-lms-test-review h2 { font-size: 20px; margin-bottom: 16px; }
.my-lms-review-item { border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px 18px; margin-bottom: 12px; }
.review-correct { border-color: #86efac; background: #f0fdf4; }
.review-wrong   { border-color: #fca5a5; background: #fff5f5; }
.my-lms-review-question { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; margin: 0 0 10px; }
.my-lms-review-badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.review-correct .my-lms-review-badge { background: #dcfce7; color: #166534; }
.review-wrong   .my-lms-review-badge { background: #fee2e2; color: #991b1b; }
.my-lms-review-choices { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.my-lms-review-choices li { padding: 5px 10px; border-radius: 5px; }
.choice-correct { background: #dcfce7; color: #166534; font-weight: 600; }
.choice-selected-wrong { background: #fee2e2; color: #991b1b; }
.my-lms-review-explanation { font-size: 13px; color: #555; background: #fffbeb; border-left: 3px solid #fbbf24; padding: 6px 10px; border-radius: 0 4px 4px 0; margin-top: 8px; }
.my-lms-test-submit { padding-top: 8px; }

/* ── CURRICULUM BADGES (quiz/test in lesson list) ─────────────────────────── */
.my-lms-item-type-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
}
.badge-quiz { background: #fef9c3; color: #854d0e; }
.badge-test { background: #fce7f3; color: #9d174d; }
.my-lms-test-row { border-top: 1px dashed #e5e7eb; margin-top: 4px; padding-top: 8px; }

/* ══ NOTES PANEL (frontend) ══════════════════════════════════════════════════ */

.my-lms-notes-panel {
    margin-top: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.my-lms-notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.my-lms-notes-header h3 { margin: 0; font-size: 16px; }

.my-lms-new-note-form { padding: 14px 18px; border-bottom: 1px solid #e5e7eb; background: #fffbeb; }
.my-lms-note-textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}
.my-lms-note-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
    gap: 8px;
}
.my-lms-visibility-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    color: #374151;
}

/* Notes list */
.my-lms-notes-list { padding: 12px 18px; }
.my-lms-notes-loading { color: #9ca3af; font-size: 13px; font-style: italic; }

.my-lms-note-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fff;
}
.my-lms-note-item.note-shared { border-left: 3px solid #7c3aed; background: #faf5ff; }
.my-lms-note-item.note-private { border-left: 3px solid #6b7280; }

.my-lms-note-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 12px;
    color: #9ca3af;
}
.my-lms-note-visibility-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
}
.badge-private { background: #f3f4f6; color: #374151; }
.badge-shared  { background: #ede9fe; color: #5b21b6; }

.my-lms-note-content { font-size: 14px; color: #1f2937; line-height: 1.6; white-space: pre-wrap; }
.my-lms-note-actions { margin-top: 8px; display: flex; gap: 8px; }
.my-lms-note-delete-btn {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}
.my-lms-note-delete-btn:hover { text-decoration: underline; }

.my-lms-shared-notes-section { border-top: 1px solid #e5e7eb; padding: 12px 18px; }
.my-lms-shared-notes-heading { font-size: 13px; font-weight: 600; color: #7c3aed; margin: 0 0 10px; }

/* ── UNENROLL ─────────────────────────────────────────────────────────────── */
.my-lms-enrolled-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.my-lms-unenroll-form { display: inline; }
.my-lms-btn-unenroll {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.my-lms-btn-unenroll:hover {
    color: #dc2626;
    border-color: #fca5a5;
    background: #fff5f5;
}
.my-lms-notice-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    padding: 10px 16px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 14px;
}

/* ══ FEEDBACK WIDGET ═════════════════════════════════════════════════════════ */

/* Floating trigger */
.lms-feedback-trigger {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px 10px 14px;
    background: #1e293b;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    transition: background .15s, transform .15s, box-shadow .15s;
}
.lms-feedback-trigger:hover {
    background: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(0,0,0,.3);
}

/* Overlay — centered on screen */
.lms-feedback-overlay {
    position: fixed;
    inset: 0;
    z-index: 9100;
    background: rgba(15,23,42,.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Modal */
.lms-feedback-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,.3);
    animation: lms-modal-in .2s ease;
    box-sizing: border-box;
}
@keyframes lms-modal-in {
    from { opacity:0; transform:translateY(16px) scale(.97); }
    to   { opacity:1; transform:translateY(0) scale(1); }
}

/* All inner content uses consistent 20px side padding */
.lms-feedback-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f1f5f9;
}
.lms-feedback-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}
.lms-feedback-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.lms-feedback-close:hover { color: #0f172a; }

.lms-feedback-context-label {
    padding: 8px 20px;
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

/* Type buttons — vertical list */
.lms-feedback-types {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 20px 0;
}
.lms-feedback-type-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}
.lms-feedback-type-btn:hover { border-color: #94a3b8; background: #fff; }
.lms-feedback-type-btn.active { border-color: #2563eb; background: #eff6ff; }
.lms-fb-icon  { font-size: 22px; flex-shrink: 0; }
.lms-fb-text  { display: flex; flex-direction: column; gap: 2px; }
.lms-fb-label { font-size: 13px; font-weight: 700; color: #0f172a; }
.lms-fb-desc  { font-size: 12px; color: #64748b; line-height: 1.4; }

/* Question select — always shown */
.lms-feedback-question-wrap { padding: 14px 20px 0; }
.lms-feedback-question-select {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
    box-sizing: border-box;
    cursor: pointer;
}
.lms-feedback-question-select:focus { border-color: #2563eb; outline: none; }

/* Field label */
.lms-feedback-field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin: 14px 20px 6px;
}

/* Textarea — full width within padding */
.lms-feedback-textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin: 0;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #0f172a;
    resize: vertical;
    min-height: 90px;
    transition: border-color .15s;
    box-sizing: border-box;
}
.lms-feedback-textarea:focus { border-color: #2563eb; outline: none; }

/* Wrap the textarea so padding is applied by the parent */
.lms-feedback-textarea-wrap {
    padding: 0 20px;
}

/* Footer */
.lms-feedback-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px 18px;
    margin-top: 10px;
}
.lms-feedback-status {
    font-size: 13px;
    color: #16a34a;
    font-weight: 500;
    flex: 1;
}
.lms-feedback-submit { white-space: nowrap; flex-shrink: 0; }
