/*
 * LearnDash Progress Box Stylesheet
 * Version: 5.0.0
 */

/* ==========================================================================
   1. STYLES FOR THE MAIN COURSE PAGE (SHORTCODE VERSION)
   ========================================================================== */

.ldpb-container {
    margin: 40px auto;
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    text-align: center;
    max-width: 450px;
}

.ldpb-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-top: 0;
    margin-bottom: 8px;
}

.ldpb-counter {
    font-size: 15px;
    color: #555;
    margin-top: 0;
    margin-bottom: 20px;
}

.ldpb-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr); 
    gap: 5px; 
    margin: 0 auto;
}

.ldpb-box {
    width: 100%;
    padding-top: 100%; 
    position: relative;
    border: 2px solid #b0b0b0;
    border-radius: 4px;
    box-sizing: border-box;
    cursor: help;
}

.ldpb-box.not-completed { background-color: #ffffff; }
.ldpb-box.completed { background-color: #2ecc71; border-color: #27ae60; }

.ldpb-box[data-tooltip] { position: relative; }
.ldpb-box[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out;
    z-index: 10;
}
.ldpb-box[data-tooltip]:hover::after { opacity: 1; visibility: visible; }

/* ==========================================================================
   2. STYLES FOR THE LESSON SIDEBAR (GENERAL)
   ========================================================================== */

#learndash-lesson-sidebar .ldpb-container {
    max-width: none;
    margin: 0;
    padding: 15px;
    background-color: transparent;
    border: none;
    box-shadow: none;
}
#learndash-lesson-sidebar .ldpb-title { font-size: 16px; }
#learndash-lesson-sidebar .ldpb-counter { font-size: 13px; margin-bottom: 15px; }
#learndash-lesson-sidebar .ldpb-grid { grid-template-columns: repeat(4, 1fr); }

/* ==========================================================================
   3. NEUTRALIZE STYLES FOR THE PLACEHOLDER WRAPPER
   ========================================================================== */

/* Target the list item that contains our progress box */
#learndash-lesson-sidebar .ld-lesson-item:has(.ldpb-container) {
    padding: 15px 0 0 0 !important;
    border: none !important;
    background: none !important;
}

/* Target the link inside and make it non-interactive */
#learndash-lesson-sidebar .ld-lesson-item:has(.ldpb-container) > a {
    text-decoration: none !important;
    pointer-events: none;
    cursor: default;
    padding: 0 !important;
}