/**
 * Tutor UI Shim
 *
 * Provides all Tutor LMS CSS classes used by dashboard templates when the
 * Tutor LMS plugin is not active. Covers: modals, dropdowns, icon buttons,
 * Tutor icon pseudo-elements, and utility classes.
 */

/* ── Modal system ─────────────────────────────────────────────────────────── */

.tutor-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.tutor-modal.tutor-is-active {
    display: flex;
}

body.tutor-modal-open {
    overflow: hidden;
}

.tutor-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.tutor-modal-window {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 540px;
    margin: auto;
    padding: 0 16px;
    pointer-events: none;
}

.tutor-modal-content {
    pointer-events: auto;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.tutor-modal-content-white {
    background: #fff;
}

.tutor-modal-body {
    padding: 32px 40px;
}

.tutor-modal-close-o {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #d0d0d0;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.tutor-modal-close-o:hover {
    background: #f0f0f0;
}

/* ── Dropdown system ──────────────────────────────────────────────────────── */

.tutor-dropdown-parent {
    position: relative;
}

/* Hide the dropdown panel by default */
.tutor-dropdown-parent .lenxel-togg-dropdown,
.tutor-dropdown-parent .lenxel-dropdown {
    display: none;
    min-width: 160px;
}

/* Show when parent has .is-open */
.tutor-dropdown-parent.is-open .lenxel-togg-dropdown,
.tutor-dropdown-parent.is-open .lenxel-dropdown {
    display: block;
}

.tutor-dropdown-dark {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.14);
    padding: 6px 0;
    z-index: 1000;
}

.tutor-dropdown-item {
    display: block;
    padding: 5px 18px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.12s;
}

.tutor-dropdown-item:hover,
.tutor-dropdown-item:focus {
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
}

/* ── Icon button ──────────────────────────────────────────────────────────── */

.tutor-iconic-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    line-height: 1;
}

/* ── Tutor icon font fallback (FontAwesome 5 Free) ───────────────────────── */

.tutor-icon-kebab-menu::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    content: "\f142"; /* fa-ellipsis-v */
    font-size: 18px;
    color: #444;
}

.tutor-icon-times::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    content: "\f00d"; /* fa-times */
    font-size: 16px;
    color: #555;
}

/* ── Button utilities ─────────────────────────────────────────────────────── */

.tutor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    width: 100%;
}

.tutor-btn-primary {
    background: #1a7440;
    border-color: #1a7440;
    color: #fff;
}

.tutor-btn-primary:hover,
.tutor-btn-primary:focus {
    background: #145730;
    border-color: #145730;
    color: #fff;
}

.tutor-btn-outline-primary {
    background: transparent;
    border-color: #1a7440;
    color: #1a7440;
}

.tutor-btn-outline-primary:hover,
.tutor-btn-outline-primary:focus {
    background: #1a7440;
    color: #fff;
}

/* ── Utility classes (subset used by dashboard modals) ───────────────────── */

.tutor-d-flex          { display: flex !important; }
.tutor-d-inline-block  { display: inline-block !important; }
.tutor-d-block         { display: block !important; }

.tutor-text-center     { text-align: center !important; }
.tutor-text-left       { text-align: left !important; }

.tutor-justify-center  { justify-content: center !important; }

.flex-column           { flex-direction: column !important; }

.tutor-fw-medium       { font-weight: 500 !important; }
.tutor-fw-bold         { font-weight: 700 !important; }

.tutor-fs-3            { font-size: 1.5rem !important; }
.tutor-fs-6            { font-size: 0.875rem !important; }

.tutor-color-black     { color: #0f0f0f !important; }
.tutor-color-muted,
.tutor-color-secondary { color: #6c757d !important; }

.tutor-mt-48           { margin-top: 48px !important; }
.tutor-mb-12           { margin-bottom: 12px !important; }
.tutor-mb-16           { margin-bottom: 16px !important; }
.tutor-mb-32           { margin-bottom: 32px !important; }
.tutor-my-48           { margin-top: 48px !important; margin-bottom: 48px !important; }
.tutor-p-32            { padding: 32px !important; }

/* ── Course card border & body padding ──────────────────────────────────── */

.tutor-card.tutor-course-card {
    border: 1px solid #cdcfd5;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    -webkit-box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.06);
    box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.06);
}

.tutor-card.tutor-course-card .tutor-card-body {
    padding: 20px;
}

/* ── Course card image ratio ─────────────────────────────────────────────── */

.tutor-ratio {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.tutor-ratio-16x9 {
    padding-bottom: 56.25%;
    height: 0;
}

.tutor-ratio-16x9 > * {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Nav tabs ────────────────────────────────────────────────────────────── */

.tutor-nav {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin: 0;
    list-style: none;
}

.tutor-nav-link {
    display: block;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    transition: color 0.15s;
}

.tutor-nav-link.is-active,
.tutor-nav-link:hover {
    color: #fff;
    text-decoration: none;
}

/* ── Sidebar nav icon layout ─────────────────────────────────────────────── */

.tutor-dashboard-permalinks a::before {
    display: none;
}

.tutor-dashboard-permalinks li a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tutor-dashboard-permalinks li a svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.tutor-empty-state {
    height: 100%;
    align-content: center;
}

.tutor-empty-state img {
    max-width: 280px;
    display: block;
    margin: 0 auto 16px;
}
