/* ============================================================
   Masteriyo + BuddyBoss — Profile Styles
   Layout inspirado no Tutor LMS BuddyBoss Integration
   ============================================================ */

/* ── Stats no cabeçalho ──────────────────────────────────── */
.mst-bb-header-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.mst-bb-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f5f7fb;
    border: 1px solid #dde3ed;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    color: #444;
    line-height: 1.4;
}

.mst-bb-stat-icon { font-size: 14px; }

/* ── Contador numérico na aba de navegação ───────────────── */
.mst-bb-nav-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: var(--bb-primary-color, #3b82f6);
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 4px;
    line-height: 1;
}

/* ── Wrapper geral ───────────────────────────────────────── */
.mst-bb-courses-wrap {
    padding: 4px 0 20px;
}

/* ── Grade de cards (3 colunas → 2 → 1) ─────────────────── */
.mst-bb-course-grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
    gap: 20px;
}

/* ── Card individual ─────────────────────────────────────── */
.mst-bb-course-card {
    background: #fff;
    border: 1px solid #e4e8f0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .15s, box-shadow .15s;
}

.mst-bb-course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

.mst-bb-course-card.is-completed {
    border-color: #c8e6c9;
}

/* ── Thumbnail ───────────────────────────────────────────── */
.mst-bb-card-thumb-wrap {
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f2f5;
    text-decoration: none;
    flex-shrink: 0;
}

.mst-bb-card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.mst-bb-course-card:hover .mst-bb-card-thumb-wrap img {
    transform: scale(1.04);
}

.mst-bb-card-no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 48px;
    color: #ccc;
}

/* Badge "Concluído" sobre o thumbnail */
.mst-bb-card-done-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(46,125,50,.9);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    backdrop-filter: blur(2px);
}

/* ── Corpo do card ───────────────────────────────────────── */
.mst-bb-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.mst-bb-card-cat {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--bb-primary-color, #3b82f6);
}

.mst-bb-card-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 600;
}

.mst-bb-card-title a {
    color: #1d2327;
    text-decoration: none;
}

.mst-bb-card-title a:hover {
    color: var(--bb-primary-color, #3b82f6);
}

.mst-bb-card-meta {
    margin: 0;
    font-size: 12px;
    color: #888;
}

/* ── Barra de progresso ──────────────────────────────────── */
.mst-bb-card-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.mst-bb-card-progress-bar {
    flex: 1;
    height: 7px;
    background: #eef0f5;
    border-radius: 4px;
    overflow: hidden;
}

.mst-bb-card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 4px;
    transition: width .6s ease;
}

.mst-bb-card-progress-fill.done {
    background: linear-gradient(90deg, #43a047, #66bb6a);
}

.mst-bb-card-pct {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    min-width: 34px;
    text-align: right;
}

/* ── Botões ──────────────────────────────────────────────── */
.mst-bb-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    margin-top: auto;
    transition: opacity .15s, background .15s;
    cursor: pointer;
}

.mst-bb-btn-primary {
    background: var(--bb-primary-color, #3b82f6);
    color: #fff !important;
}

.mst-bb-btn-primary:hover {
    opacity: .88;
    color: #fff !important;
}

.mst-bb-btn-outline {
    background: transparent;
    color: var(--bb-primary-color, #3b82f6) !important;
    border: 1.5px solid var(--bb-primary-color, #3b82f6);
}

.mst-bb-btn-outline:hover {
    background: var(--bb-primary-color, #3b82f6);
    color: #fff !important;
}

/* ── Grade de Certificados ───────────────────────────────── */
.mst-bb-cert-grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
    gap: 16px;
}

.mst-bb-cert-card {
    background: #fff;
    border: 1px solid #ffe082;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mst-bb-cert-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: #fff8e1;
    overflow: hidden;
}

.mst-bb-cert-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mst-bb-cert-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 52px;
}

.mst-bb-cert-ribbon {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(230,162,0,.92);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    padding: 4px;
}

.mst-bb-cert-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mst-bb-cert-body h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.mst-bb-cert-body h4 a {
    color: #1d2327;
    text-decoration: none;
}

.mst-bb-cert-body h4 a:hover { color: var(--bb-primary-color, #3b82f6); }

.mst-bb-cert-date {
    font-size: 12px;
    color: #888;
}

/* ── Estado vazio ────────────────────────────────────────── */
.mst-bb-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    text-align: center;
    color: #aaa;
}

.mst-bb-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.mst-bb-empty-state p {
    margin: 0;
    font-size: 15px;
}

/* ── Responsivo ──────────────────────────────────────────── */
@media ( max-width: 640px ) {
    .mst-bb-course-grid,
    .mst-bb-cert-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   Widget Lateral — "Meus Cursos" na sidebar do BuddyBoss
   ============================================================ */

.mst-bb-widget-courses {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mst-bb-widget-section {
    margin-bottom: 12px;
}

.mst-bb-widget-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #999;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
}

.mst-bb-widget-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    text-decoration: none;
    border-bottom: 1px solid rgba(0,0,0,.05);
    transition: opacity .15s;
}

.mst-bb-widget-item:hover { opacity: .8; }
.mst-bb-widget-item:last-child { border-bottom: none; }

.mst-bb-widget-thumb {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mst-bb-widget-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mst-bb-widget-thumb-fallback { font-size: 20px; }

.mst-bb-widget-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mst-bb-widget-title {
    font-size: 13px;
    font-weight: 500;
    color: #1d2327;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* força cor em temas escuros do BuddyBoss */
.bb-theme-wrap .mst-bb-widget-title,
body.bb-dark-skin .mst-bb-widget-title {
    color: inherit;
}

.mst-bb-widget-done {
    font-size: 11px;
    color: #2e7d32;
}

.mst-bb-widget-bar {
    height: 4px;
    background: #e8ecf0;
    border-radius: 2px;
    overflow: hidden;
}

.mst-bb-widget-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 2px;
    transition: width .4s ease;
}

.mst-bb-widget-pct {
    font-size: 11px;
    color: #888;
}

.mst-bb-widget-all-link {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--bb-primary-color, #3b82f6);
    text-decoration: none;
    padding: 8px 0 2px;
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
    transition: opacity .15s;
}

.mst-bb-widget-all-link:hover { opacity: .8; }

/* ── Sidebar "Meus Cursos" ───────────────────────────────── */
.mst-bb-sidebar-courses {
    background: var(--bb-card-bg, #1e1e1e);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.mst-bb-sidebar-courses .widget-title h2 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0 0 14px;
    color: var(--bb-text-color, #ccc);
}

.mst-bb-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mst-bb-sidebar-item { margin: 0; padding: 0; }

.mst-bb-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.mst-bb-sidebar-link:hover .mst-bb-sidebar-title {
    color: var(--bb-primary-color, #3b82f6);
}

.mst-bb-sidebar-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.mst-bb-sidebar-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    border-radius: 6px;
    font-size: 20px;
    flex-shrink: 0;
}

.mst-bb-sidebar-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mst-bb-sidebar-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--bb-text-color, #e0e0e0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    transition: color .15s;
}

.mst-bb-sidebar-bar {
    height: 4px;
    background: rgba(255,255,255,.1);
    border-radius: 2px;
    overflow: hidden;
}

.mst-bb-sidebar-fill {
    height: 100%;
    background: var(--bb-primary-color, #3b82f6);
    border-radius: 2px;
    transition: width .4s ease;
}

.mst-bb-sidebar-pct {
    font-size: 11px;
    color: #888;
}

.mst-bb-sidebar-more {
    display: block;
    margin-top: 12px;
    font-size: 12px;
    color: var(--bb-primary-color, #3b82f6);
    text-decoration: none;
    text-align: center;
}

.mst-bb-sidebar-more:hover { text-decoration: underline; }
