/**
 * EunoiaLMS — Frontend Styles
 * All class names use the elms- prefix.
 *
 * Colour palette:
 *   Primary green : #2e7d32
 *   Light green   : #a5d6a7
 *   Accent gold   : #f59f00
 *   Dark text     : #1a1a1a
 *   Muted text    : #757575
 *   Border        : #e0e0e0
 *   Background    : #f9f9f9
 */

/* ── Reset / base ─────────────────────────────────────────────────────────── */
.elms-course-single,
.elms-lesson-single,
.elms-dashboard {
    box-sizing: border-box;
}

.elms-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease, opacity 0.2s ease;
    line-height: 1.4;
}

.elms-btn-primary {
    background: #2e7d32;
    color: #fff;
}

.elms-btn-primary:hover {
    background: #1b5e20;
    color: #fff;
}

.elms-btn-secondary {
    background: #f5f5f5;
    color: #1a1a1a;
    border: 1px solid #e0e0e0;
}

.elms-btn-secondary:hover {
    background: #eeeeee;
    color: #1a1a1a;
}

.elms-btn-ghost {
    background: transparent;
    color: #2e7d32;
    border: 1px solid #2e7d32;
}

.elms-btn-ghost:hover {
    background: #f1f8f1;
}

.elms-btn-done {
    background: #bdbdbd;
    color: #fff;
    cursor: default;
    opacity: 0.8;
}

/* ── Video ────────────────────────────────────────────────────────────────── */
.elms-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    margin-bottom: 28px;
    border-radius: 6px;
    background: #000;
}

.elms-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.elms-video-error {
    background: #fff3e0;
    border: 1px solid #ffb74d;
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 24px;
    color: #e65100;
}

/* ── Progress Bar ─────────────────────────────────────────────────────────── */
.elms-progress-wrap {
    width: 100%;
    background: #e0e0e0;
    border-radius: 100px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}

.elms-progress-bar {
    height: 100%;
    background: #2e7d32;
    border-radius: 100px;
    transition: width 0.4s ease;
    min-width: 0;
}

.elms-progress-text {
    font-size: 13px;
    color: #757575;
    margin: 0 0 16px;
}

.elms-course-progress {
    margin: 20px 0 24px;
}

/* ── Course Single ────────────────────────────────────────────────────────── */
.elms-course-single {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px;
}

.elms-course-header h1 {
    margin-top: 20px;
    font-size: 28px;
    color: #1a1a1a;
}

.elms-course-hero img {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 8px;
}

.elms-course-excerpt {
    color: #555;
    font-size: 16px;
    margin-bottom: 8px;
}

.elms-course-description {
    margin: 24px 0 32px;
    font-size: 15px;
    line-height: 1.7;
}

/* ── Curriculum ───────────────────────────────────────────────────────────── */
.elms-curriculum {
    margin-top: 32px;
}

.elms-curriculum h2 {
    font-size: 22px;
    color: #1a1a1a;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 24px;
}

.elms-module {
    margin-bottom: 28px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.elms-module h3 {
    margin: 0;
    padding: 14px 18px;
    background: #f5f5f5;
    font-size: 16px;
    color: #1a1a1a;
    border-bottom: 1px solid #e0e0e0;
}

.elms-module ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.elms-module li {
    padding: 12px 18px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.elms-module li:last-child {
    border-bottom: none;
}

.elms-module li.elms-done {
    color: #757575;
}

.elms-module li.elms-done::before {
    content: "✓ ";
    color: #2e7d32;
    font-weight: bold;
}

.elms-module li a {
    color: #2e7d32;
    text-decoration: none;
}

.elms-module li a:hover {
    text-decoration: underline;
}

.elms-locked {
    color: #9e9e9e;
}

.elms-no-lessons {
    padding: 12px 18px;
    font-size: 13px;
    color: #9e9e9e;
    margin: 0;
}

/* ── Purchase Prompt ──────────────────────────────────────────────────────── */
.elms-purchase-prompt {
    background: #f9fbe7;
    border: 1px solid #c5e1a5;
    border-radius: 6px;
    padding: 28px 32px;
    text-align: center;
    margin: 24px 0;
}

.elms-purchase-prompt h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #1a1a1a;
}

.elms-purchase-prompt p {
    color: #555;
    margin-bottom: 20px;
}

/* ── Lesson Single ────────────────────────────────────────────────────────── */
.elms-lesson-single {
    padding: 24px 20px;
}

.elms-lesson-content {
    max-width: 800px;
    margin: 0 auto;
}

.elms-lesson-content h1 {
    font-size: 26px;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.elms-lesson-body {
    font-size: 15px;
    line-height: 1.75;
    color: #333;
    margin-bottom: 28px;
}

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */
.elms-breadcrumb {
    font-size: 13px;
    color: #757575;
    margin-bottom: 20px;
}

.elms-breadcrumb a {
    color: #2e7d32;
    text-decoration: none;
}

.elms-breadcrumb a:hover {
    text-decoration: underline;
}

.elms-breadcrumb-sep {
    margin: 0 4px;
    color: #bdbdbd;
}

.elms-breadcrumb-current {
    color: #424242;
    font-weight: 500;
}

/* ── Complete button ──────────────────────────────────────────────────────── */
.elms-complete-wrap {
    display: flex;
    align-items: center;
    margin: 24px 0 32px;
}

#elms-complete-btn {
    padding: 12px 28px;
    font-size: 15px;
}

#elms-complete-btn:disabled {
    background: #bdbdbd;
    color: #fff;
    cursor: default;
    opacity: 0.7;
}

.elms-error-msg {
    font-size: 13px;
    color: #c62828;
}

/* ── Lesson nav ───────────────────────────────────────────────────────────── */
.elms-lesson-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    gap: 12px;
    flex-wrap: wrap;
}

.elms-nav-prev,
.elms-nav-back,
.elms-nav-next {
    flex: 1;
}

.elms-nav-back {
    text-align: center;
}

.elms-nav-next {
    text-align: right;
}

/* ── Dashboard ────────────────────────────────────────────────────────────── */
.elms-dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px;
}

.elms-dashboard h2 {
    font-size: 24px;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.elms-dashboard h3 {
    font-size: 18px;
    color: #424242;
    margin-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.elms-course-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.elms-course-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    background: #fff;
    transition: box-shadow 0.2s ease;
}

.elms-course-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.10);
}

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

.elms-card-body {
    padding: 16px 18px 20px;
}

.elms-course-card h4 {
    margin: 0 0 12px;
    font-size: 16px;
    line-height: 1.4;
}

.elms-course-card h4 a {
    color: #1a1a1a;
    text-decoration: none;
}

.elms-course-card h4 a:hover {
    color: #2e7d32;
}

.elms-cert-link {
    display: inline-block;
    margin-top: 10px;
    color: #f59f00;
    font-weight: bold;
    text-decoration: none;
    font-size: 14px;
}

.elms-cert-link:hover {
    color: #e67700;
}

.elms-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #757575;
}

.elms-empty-state p {
    font-size: 16px;
    margin-bottom: 16px;
}

.elms-empty-state a {
    color: #2e7d32;
    font-weight: 600;
    text-decoration: none;
}

/* ── Certificate ──────────────────────────────────────────────────────────── */
.elms-certificate {
    max-width: 700px;
    margin: 40px auto;
    border: 2px solid #2e7d32;
    border-radius: 6px;
    padding: 48px 40px;
    background: #fff;
}

.elms-cert-inner {
    text-align: center;
}

.elms-cert-logo {
    font-size: 18px;
    font-weight: bold;
    color: #2e7d32;
    margin-bottom: 32px;
    line-height: 1.5;
}

.elms-cert-logo span {
    font-size: 13px;
    font-weight: normal;
    color: #757575;
}

.elms-certificate h1 {
    font-size: 32px;
    font-family: Georgia, "Times New Roman", serif;
    color: #1a1a1a;
    margin: 0 0 24px;
    letter-spacing: 0.5px;
}

.elms-cert-presents {
    font-size: 15px;
    color: #757575;
    margin-bottom: 12px;
}

.elms-certificate h2 {
    font-size: 28px;
    color: #2e7d32;
    margin: 0 0 16px;
    font-family: Georgia, "Times New Roman", serif;
}

.elms-cert-subtitle {
    font-size: 15px;
    color: #757575;
    margin-bottom: 12px;
}

.elms-certificate h3 {
    font-size: 20px;
    color: #1a1a1a;
    margin: 0 0 24px;
}

.elms-cert-date {
    font-style: italic;
    color: #9e9e9e;
    font-size: 14px;
    margin-bottom: 32px;
}

.elms-cert-footer {
    font-size: 14px;
    color: #555;
    margin-bottom: 28px;
    line-height: 1.6;
}

.elms-print-btn {
    background: #2e7d32;
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.elms-print-btn:hover {
    background: #1b5e20;
}

/* ── Login prompt ─────────────────────────────────────────────────────────── */
.elms-login-prompt,
.elms-no-cert {
    padding: 20px 24px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 15px;
    color: #555;
}

.elms-login-prompt a,
.elms-no-cert a {
    color: #2e7d32;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .elms-course-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .elms-course-grid {
        grid-template-columns: 1fr;
    }

    .elms-lesson-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .elms-nav-prev,
    .elms-nav-back,
    .elms-nav-next {
        text-align: center;
    }

    .elms-certificate {
        padding: 28px 20px;
    }

    .elms-certificate h1 {
        font-size: 24px;
    }

    .elms-certificate h2 {
        font-size: 22px;
    }
}

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
    body > *:not(.elms-certificate) {
        display: none !important;
    }

    .elms-certificate {
        border: 2px solid #2e7d32;
        max-width: 100%;
        margin: 0;
        padding: 32px;
        box-shadow: none;
    }

    .elms-print-btn {
        display: none !important;
    }
}

/* ── Course meta badges (difficulty, duration, certificate) ────────────────── */
.elms-course-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 16px;
}

.elms-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
}

.elms-badge-level {
    background: #e3f2fd;
    color: #1565c0;
}

.elms-badge-duration {
    background: #fff3e0;
    color: #e65100;
}

.elms-badge-cert {
    background: #fff8e1;
    color: #f59f00;
    font-weight: 600;
}

/* ── Course listing page ───────────────────────────────────────────────────── */
.elms-courses-listing {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 0;
}

.elms-card-excerpt {
    font-size: 13px;
    color: #757575;
    margin: 6px 0 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.elms-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #9e9e9e;
    margin: 8px 0 12px;
}

.elms-course-card-placeholder {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Dashboard header row ──────────────────────────────────────────────────── */
.elms-dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.elms-dashboard-header h2 {
    margin-bottom: 0;
}

.elms-dashboard-header h3 {
    margin-top: 4px;
    margin-bottom: 0;
    border: none;
    padding: 0;
}

/* ── Page wrap (courses listing + my-learning templates) ───────────────────── */
.elms-page-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px;
}

/* ── Listing header ────────────────────────────────────────────────────────── */
.elms-listing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

.elms-listing-header h1 {
    margin: 0;
    font-size: 26px;
    color: #1a1a1a;
}

/* ── Enrolled ribbon on course card ────────────────────────────────────────── */
.elms-course-card {
    position: relative;
}

.elms-enrolled-ribbon {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #2e7d32;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 100px;
    z-index: 1;
}

/* ── Gold / certificate button ─────────────────────────────────────────────── */
.elms-btn-gold {
    background: #f59f00;
    color: #fff;
    font-weight: 700;
}

.elms-btn-gold:hover {
    background: #e67700;
    color: #fff;
}

/* ── Course card placeholder icon ──────────────────────────────────────────── */
.elms-course-card-placeholder {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.elms-course-card-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #a5d6a7;
}
