/* Simple LMS Frontend Styles */

.slms-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

/* Course Grid */
.slms-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 20px 0;
}

.slms-course-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.slms-course-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.slms-course-card.slms-featured {
    border-color: #dba617;
}

.slms-card-thumbnail img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.slms-card-body {
    padding: 16px;
}

.slms-card-title {
    margin: 0 0 8px;
    font-size: 18px;
}

.slms-card-title a {
    text-decoration: none;
    color: #1e1e1e;
}

.slms-card-title a:hover {
    color: #2271b1;
}

.slms-card-excerpt {
    color: #666;
    font-size: 14px;
    margin: 0 0 12px;
}

.slms-featured-badge {
    display: inline-block;
    background: #dba617;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 3px;
    margin-top: 8px;
}

/* Progress Bar */
.slms-progress-bar-wrap {
    margin: 15px 0;
}

.slms-progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 5px;
}

.slms-progress-fill {
    background: #4caf50;
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s;
}

.slms-progress-text {
    font-size: 13px;
    color: #666;
}

.slms-card-progress .slms-progress-bar {
    height: 8px;
}

.slms-continue-btn {
    margin-top: 10px;
    background: #4caf50;
}

.slms-continue-btn:hover {
    background: #388e3c;
    color: #fff;
}

.slms-badge-sm {
    font-size: 12px;
    padding: 3px 10px;
    margin-top: 8px;
}

/* Buttons */
.slms-btn {
    display: inline-block;
    padding: 14px 36px;
    background: #d63031;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 22px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background 0.2s, box-shadow 0.2s;
}

.slms-btn:hover {
    background: #b71c1c;
    color: #fff;
    box-shadow: 0 2px 8px rgba(214,48,49,0.3);
}

.slms-btn-secondary {
    background: transparent;
    color: #d63031;
    border: 1px solid #d63031;
}

.slms-btn-secondary:hover {
    background: #d63031;
    color: #fff;
}

.slms-btn-lg {
    padding: 16px 40px;
    font-size: 24px;
}

.slms-btn-sm {
    padding: 10px 24px;
    font-size: 20px;
}

.slms-lesson-actions-center {
    text-align: center;
    padding: 24px 0;
}

.slms-lesson-actions-center > * {
    display: block;
    margin: 8px auto;
}

.slms-lesson-actions-center .slms-lesson-actions {
    margin-top: 16px;
}

.slms-quiz-bar-info {
    display: block;
    font-size: 20px;
    color: #888;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.slms-btn-disabled {
    display: inline-block;
    padding: 14px 36px;
    background: #e0e0e0;
    color: #999;
    border-radius: 6px;
    cursor: not-allowed;
    font-size: 22px;
}

.slms-completed-badge {
    display: inline-block;
    background: #27ae60;
    color: #fff;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Breadcrumb */
.slms-breadcrumb {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.slms-breadcrumb a {
    color: #2271b1;
    text-decoration: none;
}

.slms-heading-prefix {
    /* inherits font-weight, size, and case from the parent heading */
}

.slms-parent-course-title {
    font-size: 22px;
    color: #333;
    margin: 0 0 4px;
    font-weight: 600;
}

.slms-course-thumbnail {
    margin-bottom: 24px;
}

.slms-course-thumbnail img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Course Structure */
.slms-course-structure {
    margin: 30px 0;
}

.slms-unit {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.slms-unit-title {
    background: #f7f7f7;
    padding: 12px 16px;
    margin: 0;
    font-size: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.slms-lesson-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.slms-lesson-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.slms-lesson-item:last-child {
    border-bottom: none;
}

.slms-lesson-item.slms-complete {
    background: #f0faf0;
}

.slms-lesson-item.slms-locked .slms-lesson-locked-title {
    color: #999;
}

.slms-lesson-item .dashicons {
    color: #72777c;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.slms-lesson-item.slms-complete .dashicons {
    color: #4caf50;
}

.slms-lesson-item.slms-invalidated {
    background: #fff8e1;
}

.slms-lesson-item.slms-invalidated .dashicons {
    color: #f39c12;
}

.slms-invalidated-indicator {
    margin-left: 8px;
    background: #f39c12;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
}

.slms-notice-info {
    background: #e8f4fd;
    border-left: 4px solid #2196f3;
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 0 4px 4px 0;
}

.slms-quiz-indicator {
    margin-left: auto;
    background: #dba617;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
}

/* Video */
.slms-video-wrap {
    margin: 20px 0;
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.slms-video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Lesson Navigation */
.slms-lesson-nav {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Lesson Actions */
.slms-lesson-actions {
    margin: 20px 0;
}

.slms-notice-warning {
    background: #fff8e1;
    border-left: 4px solid #f0ad4e;
    color: #7a5d00;
    padding: 10px 14px;
    margin: 0 auto 10px;
    max-width: 540px;
    border-radius: 3px;
    font-size: 14px;
}

.slms-mark-complete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Quiz */
.slms-quiz-form {
    margin: 20px 0;
}

.slms-question {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.slms-question-text {
    margin: 0 0 15px;
    font-size: 1.2rem;
}

.slms-question-number {
    color: #2271b1;
    margin-right: 5px;
}

.slms-question-video {
    margin-bottom: 15px;
    max-width: 640px;
}

.slms-question-video iframe {
    max-width: 100%;
}

.slms-question-points {
    font-size: 1rem;
    color: #999;
    font-weight: normal;
}

.slms-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slms-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: border-color 0.2s, background 0.2s;
}

.slms-option:hover {
    border-color: #2271b1;
    background: #f0f7ff;
}

.slms-option.slms-option-selected,
.slms-option:has(input[type="radio"]:checked) {
    border-color: #2271b1;
    background: #e8f2fc;
}

.slms-option input[type="radio"]:checked + span {
    font-weight: 600;
}

.slms-fill-blank input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 15px;
}

.slms-quiz-submit {
    margin-top: 20px;
}

.slms-quiz-info {
    display: inline-block;
    background: #fff3e0;
    color: #e65100;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

.slms-quiz-nav {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.slms-quiz-nav .slms-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.slms-quiz-progress-indicator {
    margin-bottom: 20px;
}

#slms-quiz-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 1.1rem;
    color: #555;
}

#slms-quiz-progress-pct {
    font-weight: 600;
    color: #4caf50;
}

.slms-quiz-timer {
    background: #fff3cd;
    padding: 10px 16px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
}

.slms-quiz-timer.slms-timer-warning {
    background: #f8d7da;
    color: #721c24;
}

.slms-quiz-history {
    margin-bottom: 25px;
}

/* Tables */
.slms-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 20px;
}

.slms-table th,
.slms-table td {
    padding: 12px 18px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.slms-table th {
    background: #f7f7f7;
    font-weight: 600;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
}

.slms-table td {
    white-space: nowrap;
}

.slms-table tbody tr:hover {
    background: #fafafa;
}

/* Quiz Results */
#slms-quiz-results {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
}

.slms-result-passed {
    color: #4caf50;
    font-size: 24px;
    font-weight: bold;
}

.slms-result-failed {
    color: #e53935;
    font-size: 24px;
    font-weight: bold;
}

/* Dashboard */
.slms-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.slms-stat {
    background: #f7f7f7;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.slms-stat-number {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #2271b1;
}

.slms-stat-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

/* Badges */
.slms-badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin: 10px 0;
}

.slms-badge-item {
    text-align: center;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.slms-badge-icon .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #dba617;
}

.slms-badge-label {
    display: block;
    font-weight: 600;
    margin-top: 8px;
    font-size: 13px;
}

.slms-badge-date {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* Certificates */
.slms-certificates-list {
    margin: 10px 0;
}

.slms-certificate-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
}

.slms-cert-date {
    color: #999;
    font-size: 13px;
    margin-left: auto;
}

/* Lesson Notes */
.slms-lesson-notes {
    margin: 30px 0;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.slms-notes-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-bar .slms-notes-toolbar {
    top: 32px;
}

.slms-toolbar-group {
    display: flex;
    gap: 2px;
    margin-right: 20px;
}

.slms-toolbar-group:last-child {
    margin-right: 0;
}

.slms-toolbar-btn {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    padding: 0 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 2.15;
    min-height: 30px;
    min-width: 30px;
    text-align: center;
    color: #2c3338;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.slms-toolbar-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: inherit;
}

.slms-toolbar-btn:hover {
    background: #f0f0f1;
    border-color: #8c8f94;
    color: #1d2327;
}

.slms-toolbar-btn:active {
    background: #f0f0f1;
    border-color: #8c8f94;
    box-shadow: inset 0 2px 5px -3px rgba(0,0,0,0.5);
}

.slms-note-editor {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 4px 4px;
    font-size: 18px;
    font-family: inherit;
    outline: none;
    overflow-y: auto;
    box-sizing: border-box;
}

.slms-note-editor:focus {
    border-color: #2271b1;
}

.slms-note-editor:empty::before {
    content: attr(data-placeholder);
    color: #aaa;
    pointer-events: none;
}

.slms-note-status {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

/* Attachments */
.slms-lesson-attachments {
    margin: 20px 0;
}

.slms-attachment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.slms-attachment-item {
    padding: 8px 12px;
    background: #f7f7f7;
    border-radius: 4px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.slms-attachment-item a {
    color: #2271b1;
    text-decoration: none;
}

.slms-file-size {
    color: #999;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .slms-course-grid {
        grid-template-columns: 1fr;
    }

    .slms-lesson-nav {
        flex-direction: column;
        gap: 10px;
    }

    .slms-dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .slms-certificate-card {
        flex-direction: column;
        text-align: center;
    }

    .slms-cert-date {
        margin-left: 0;
    }
}

/* Auth Box */
.slms-auth-box {
    max-width: 420px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin: 10px auto;
}

.slms-auth-box > p {
    margin: 0 0 16px;
    font-size: 15px;
    color: #555;
}

.slms-auth-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.slms-auth-tab {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.slms-auth-tab:hover {
    color: #333;
}

.slms-auth-tab-active {
    color: #d63031;
    border-bottom-color: #d63031;
}

.slms-auth-panel {
    display: none;
}

.slms-auth-panel-active {
    display: block;
}

.slms-form-field {
    margin-bottom: 14px;
}

.slms-form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.slms-form-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.slms-form-field input:focus {
    border-color: #2271b1;
    outline: none;
}

.slms-auth-form .slms-btn {
    width: 100%;
    text-align: center;
    margin-top: 4px;
}

.slms-auth-notice {
    display: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 10px;
}

.slms-auth-error {
    display: block;
    background: #fef0f0;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.slms-auth-success {
    display: block;
    background: #f0faf0;
    color: #27ae60;
    border: 1px solid #c3e6cb;
}

.slms-auth-links {
    text-align: center;
    margin: 12px 0 0;
    font-size: 13px;
}

.slms-auth-links a {
    color: #2271b1;
    text-decoration: none;
}

/* Pagination */
.slms-pagination {
    margin: 30px 0;
    text-align: center;
}

/* Language Filter */
.slms-language-filter {
    display: flex;
    gap: 8px;
    margin: 16px 0 24px;
    flex-wrap: wrap;
}

.slms-lang-btn {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.slms-lang-btn:hover {
    border-color: #2271b1;
    color: #2271b1;
}

.slms-lang-btn.slms-lang-active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

/* Language Badge */
.slms-lang-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.slms-lang-badge.slms-lang-en_AU {
    background: #e8f0fe;
    color: #1a56db;
}

.slms-lang-badge.slms-lang-ja {
    background: #fef3e8;
    color: #c2410c;
}
