/* Custom CSS: Show activities one at a time with "Next Activity" navigation */
/* ONLY applies on section pages where body has data-single-activity-nav="1" */

/* OVERRIDE the old rule that shows first child - ONLY on section pages with feature enabled */
body[data-single-activity-nav="1"] .single-section .section-list .activity:not(:first-child) {
    display: none !important;
    visibility: hidden !important;
}

/* NOW also hide the first child explicitly - ONLY on section pages with feature enabled */
body[data-single-activity-nav="1"] .single-section .section-list .activity:first-child {
    display: none !important;
    visibility: hidden !important;
}

/* Hide ALL activities by default - ULTRA specific selectors to override everything */
/* ONLY applies when feature is enabled for the course */
body[data-single-activity-nav="1"] .single-section .section-list li.activity,
body[data-single-activity-nav="1"] .single-section ul.section-list > li.activity,
body[data-single-activity-nav="1"] ul.topics.section-list li.activity,
body[data-single-activity-nav="1"] .section .activity:first-child,
body[data-single-activity-nav="1"] .single-section .section-list li.activity.label,
body[data-single-activity-nav="1"] .single-section .section-list li.activity:first-child,
body[data-single-activity-nav="1"] .single-section .section-list .activity {
    display: none !important;
    visibility: hidden !important;
}

/* Show ONLY the activity with "visible" class - override EVERYTHING */
/* ONLY applies when feature is enabled for the course */
body[data-single-activity-nav="1"] .single-section .section-list li.activity.activity-visible,
body[data-single-activity-nav="1"] .single-section ul.section-list > li.activity.activity-visible,
body[data-single-activity-nav="1"] ul.topics.section-list li.activity.activity-visible,
body[data-single-activity-nav="1"] .section .activity.activity-visible:first-child,
body[data-single-activity-nav="1"] .single-section .section-list li.activity.label.activity-visible,
body[data-single-activity-nav="1"] .single-section .section-list li.activity.activity-visible:first-child {
    display: block !important;
    visibility: visible !important;
    margin-bottom: 30px;
}

/* Make videos larger - expand video containers to full width */
.mediaplugin_videojs {
    max-width: 100% !important;
    width: 100% !important;
}

.mediaplugin_videojs > div {
    max-width: 100% !important;
}

/* Video player to take more screen space */
.activity-altcontent .mediaplugin_videojs .video-js {
    height: 600px !important;
}

/* Add "Next Activity" button styling */
.activity-navigation-buttons {
    margin: 30px 0;
    display: flex;
    gap: 15px;
    justify-content: space-between;
}

.btn-next-activity,
.btn-prev-activity {
    padding: 12px 30px;
    background-color: #0f6cbf;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-next-activity:hover,
.btn-prev-activity:hover {
    background-color: #094d8a;
    color: white;
}

.btn-prev-activity:disabled,
.btn-next-activity:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Complete button styling */
.btn-complete-activity {
    padding: 12px 30px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
}

.btn-complete-activity:hover {
    background-color: #218838;
    color: white;
}

/* Progress indicator - match sidebar styling */
.activity-progress-indicator {
    background: transparent;
    padding: 0 15px;
    margin-bottom: 20px;
    margin-top: 20px;
    border: none;
    order: 999;
}

.activity-progress-indicator h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.activity-progress-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-progress-list li {
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.05);
}

.activity-progress-list li:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.activity-progress-list li.completed {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.2);
    border-left: 3px solid #28a745;
}

.activity-progress-list li.completed::before {
    content: "✓ ";
    margin-right: 8px;
    font-weight: bold;
    font-size: 16px;
}

.activity-progress-list li.current {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: 600;
    border-left: 3px solid #ffc107;
}

.activity-progress-list li.current::before {
    content: "→ ";
    margin-right: 8px;
    font-size: 16px;
    color: #ffc107;
}

.activity-progress-list li.locked {
    color: rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.03);
    cursor: not-allowed;
}

.activity-progress-list li.locked::before {
    content: "🔒 ";
    margin-right: 8px;
}

/* Clean up section layout */
.single-section .content {
    padding: 20px 0;
}

/* Hide completion dropdowns in simplified view */
.activity-visible .completion-dropdown {
    display: inline-block;
}

/* Ensure sidebar/drawer is visible for progress indicator */
body.drawer-open-left [data-region="blocks-column"],
body.drawer-open-left .drawer-left {
    display: block;
}

/* Style progress indicator in sidebar context */
[data-region="blocks-column"] .activity-progress-indicator,
.drawer-left .activity-progress-indicator {
    position: relative; /* Not sticky, so it stays at bottom */
    margin-top: 20px;
}

/* Put progress indicator AFTER existing blocks */
[data-region="blocks-column"] {
    display: flex;
    flex-direction: column;
}

[data-region="blocks-column"] .activity-progress-indicator {
    order: 999; /* Last item in flex container */
}
