/* Root scope: neutralize theme bleed */
.dbpc {
  all: initial;
  font-family: inherit;
  color: inherit;
}
.dbpc *, .dbpc *::before, .dbpc *::after {
  all: unset;
  display: revert;
  box-sizing: border-box;
}
.dbpc ul, .dbpc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.dbpc h1, .dbpc h2, .dbpc h3, .dbpc h4, .dbpc h5, .dbpc h6 {
  margin: 0;
  font-weight: revert;
  font-size: revert;
}
.dbpc p { margin: 0 0 1em; }
.dbpc a { color: inherit; text-decoration: none; }
.dbpc button { all: revert; }

/* Course Grid */
.dbpc .dbpc-grid {
  display: grid;
  gap: 20px;
  margin: 20px 0;
}
.dbpc .dbpc-cols-1 { grid-template-columns: 1fr; }
.dbpc .dbpc-cols-2 { grid-template-columns: repeat(2, 1fr); }
.dbpc .dbpc-cols-3 { grid-template-columns: repeat(3, 1fr); }
.dbpc .dbpc-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Course Cards */
.dbpc .dbpc-card {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  transition: box-shadow 0.15s ease;
  margin-bottom: 10px;
}
.dbpc .dbpc-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.dbpc .dbpc-card-title {
  margin: 12px 0 8px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}
.dbpc .dbpc-card-title a {
  color: #212529;
  text-decoration: none;
}
.dbpc .dbpc-card-title a:hover {
  color: var(--dbpc-primary, #000000);
}
.dbpc .dbpc-card-excerpt {
  color: #6c757d;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.dbpc .dbpc-thumb {
  display: block;
  margin-bottom: 12px;
}
.dbpc .dbpc-thumb img {
  width: 100%;
  height: auto;
  border-radius: 6px;
}

/* Buttons */
.dbpc .dbpc-button {
  display: inline-block;
  background: var(--dbpc-primary, #000000);
  color: var(--dbpc-button-text, #fff);
  padding: 10px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.15s ease;
}
.dbpc .dbpc-button:hover {
  background: var(--dbpc-primary-hover, #484848);
  color: var(--dbpc-button-text, #fff);
  text-decoration: none;
}

/* Course Layout */
.dbpc .dbpc-course {
  margin: 0 auto;
}
.dbpc .dbpc-course-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #dee2e6;
}
.dbpc .dbpc-course-title {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 700;
  color: #212529;
}
.dbpc .dbpc-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  align-items: start;
}

/* Sidebar */
.dbpc .dbpc-sidebar {
  position: sticky;
  top: 20px;
}

/* Accordion (Bootstrap-style) */
.dbpc .dbpc-accordion {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
}
.dbpc .dbpc-accordion-item {
  border-bottom: 1px solid #dee2e6;
}
.dbpc .dbpc-accordion-item:last-child {
  border-bottom: none;
}
.dbpc .dbpc-accordion-header {
  width: 100%;
  padding: 16px 20px;
  margin: 0;
  background: #f8f9fa;
  border: none;
  border-radius: 0;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  color: #212529;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.15s ease;
}
.dbpc .dbpc-accordion-header:hover {
  background: #e9ecef;
}
.dbpc .dbpc-accordion-header:focus {
  outline: 2px solid var(--dbpc-primary, #000000);
  outline-offset: -2px;
}
.dbpc .dbpc-accordion-item:first-child .dbpc-accordion-header {
  border-radius: 7px 7px 0 0;
}
.dbpc .dbpc-accordion-item:last-child .dbpc-accordion-header {
  border-radius: 0 0 7px 7px;
}
.dbpc .dbpc-accordion-item:only-child .dbpc-accordion-header {
  border-radius: 7px;
}
.dbpc .dbpc-accordion-header::after {
  content: '+';
  font-size: 18px;
  font-weight: 400;
  color: #6c757d;
  transition: transform 0.2s ease;
}
.dbpc .dbpc-accordion-header[aria-expanded="true"]::after {
  content: '−';
  transform: rotate(0deg);
}

/* Guard against stray empty paragraphs injected by content filters */
.dbpc .dbpc-accordion-header + p { margin: 0; }
.dbpc .dbpc-accordion-header + p:empty { display: none; }

/* List Group (Bootstrap-style) */
.dbpc .dbpc-accordion-panel {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border-top: 1px solid #dee2e6;
  background: #fff;
}
.dbpc .dbpc-accordion-panel li {
  padding: 12px 20px;
  border-bottom: 1px solid #f8f9fa;
  cursor: pointer;
  color: #495057;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
}
.dbpc .dbpc-accordion-panel li:last-child {
  border-bottom: none;
}
.dbpc .dbpc-accordion-panel li:hover {
  background: #f8f9fa;
  color: #212529;
}
.dbpc .dbpc-accordion-panel li.active {
  background: var(--dbpc-primary, #000000);
  color: var(--dbpc-button-text, #fff);
  font-weight: 500;
}
.dbpc .dbpc-accordion-panel li::before {
  content: '▶';
  font-size: 12px;
  margin-right: 8px;
  opacity: 0.6;
}
.dbpc .dbpc-accordion-panel li.active::before {
  opacity: 1;
}

/* Content Area */
.dbpc .dbpc-content {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 32px;
}
.dbpc .dbpc-content .dbpc-item {
  display: none;
}
.dbpc .dbpc-content .dbpc-item:first-child {
  display: block;
}
.dbpc .dbpc-item-title {
  margin: 0 0 20px;
  font-size: 28px;
  font-weight: 600;
  color: #212529;
  line-height: 1.3;
}
.dbpc .dbpc-item-description {
  font-size: 16px;
  line-height: 1.6;
  color: #495057;
  margin-bottom: 24px;
}
.dbpc .dbpc-item-description p:last-child {
  margin-bottom: 0;
}

/* Video */
.dbpc .dbpc-video {
  margin: 24px 0;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  padding-top: 56.25%;
  height: 0;
}
.dbpc .dbpc-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Downloads */
.dbpc .dbpc-downloads {
  margin: 24px 0;
  padding: 20px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}
.dbpc .dbpc-downloads h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: #212529;
}
.dbpc .dbpc-downloads ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.dbpc .dbpc-downloads li {
  margin-bottom: 8px;
}
.dbpc .dbpc-downloads li:last-child {
  margin-bottom: 0;
}
.dbpc .dbpc-downloads a {
  display: inline-flex;
  align-items: center;
  color: var(--dbpc-primary, #000000);
  text-decoration: none;
  font-weight: 500;
}
.dbpc .dbpc-downloads a:hover {
  text-decoration: underline;
}
.dbpc .dbpc-downloads a::before {
  content: '📁';
  margin-right: 8px;
}

/* Navigation */
.dbpc .dbpc-next-wrap {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #dee2e6;
  text-align: right;
}

/* Locked State */
.dbpc .dbpc-locked {
  padding: 40px;
  text-align: center;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  margin: 20px 0;
}
.dbpc .dbpc-locked p {
  margin: 0 0 16px;
  font-size: 16px;
  color: #856404;
}

/* Responsive Design */
@media (max-width: 992px) {
  .dbpc .dbpc-layout {
    grid-template-columns: 280px 1fr;
    gap: 24px;
  }
  .dbpc .dbpc-content {
    padding: 24px;
  }
}

@media (max-width: 768px) {
  .dbpc .dbpc-course {
    padding: 0 16px;
  }
  .dbpc .dbpc-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .dbpc .dbpc-sidebar {
    position: static;
    order: 2;
  }
  .dbpc .dbpc-content {
    order: 1;
    padding: 20px;
  }
  .dbpc .dbpc-course-title {
    font-size: 24px;
  }
  .dbpc .dbpc-item-title {
    font-size: 22px;
  }
  .dbpc .dbpc-accordion-header {
    padding: 14px 16px;
    font-size: 15px;
  }
  .dbpc .dbpc-accordion-panel li {
    padding: 10px 16px;
    font-size: 14px;
  }
}

@media (max-width: 576px) {
  .dbpc .dbpc-grid {
    grid-template-columns: 1fr;
  }
  .dbpc .dbpc-card {
    padding: 16px;
  }
  .dbpc .dbpc-course {
    padding: 0 12px;
  }
  .dbpc .dbpc-content {
    padding: 16px;
  }
  .dbpc .dbpc-course-title {
    font-size: 20px;
  }
  .dbpc .dbpc-item-title {
    font-size: 18px;
  }
}


/* ===== WORDPRESS NATIVE COURSE BUILDER ===== */

/* Minimal custom styles - using WordPress native styling */

/* Tree structure */
.dbpc-tree ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Course, Module, Item rows */
.dbpc-course, .dbpc-module, .dbpc-item {
  position: relative;
}

.dbpc-course:last-child,
.dbpc-module:last-child,
.dbpc-item:last-child {
  border-bottom: none;
}

.dbpc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  min-height: 48px;
  background: #fff;
  transition: background-color 0.15s ease;
}

.dbpc-row:hover {
  background: #f6f7f7;
}

/* Course styling */
.dbpc-course > .dbpc-row {
  background: #f8f9fa;
  border-left: 4px solid #0073aa;
  font-weight: 600;
}

/* Module styling */
.dbpc-module > .dbpc-row {
  background: #fbfbfc;
  border-left: 3px solid #00a0d2;
  margin-left: 20px;
  font-weight: 500;
}

/* Item styling */
.dbpc-item > .dbpc-row {
  margin-left: 40px;
  padding-left: 12px;
  border-left: 2px solid #ddd;
}

/* Handle */
.dbpc-handle {
  cursor: move;
  color: #8c8f94;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.dbpc-row:hover .dbpc-handle {
  opacity: 1;
}

/* Collapsible button */
.dbpc-collapsible {
  cursor: pointer;
  padding: 2px;
  border: none;
  background: none;
  color: #646970;
  transition: color 0.15s ease;
}

.dbpc-collapsible:hover {
  color: #0073aa;
}

.dbpc-collapsible[aria-expanded="false"] .dashicons {
  transform: rotate(-90deg);
}

/* Title input */
.dbpc-title {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 14px;
  line-height: 1.4;
  padding: 4px 6px;
  transition: all 0.15s ease;
}

.dbpc-title:focus {
  border-color: #0073aa;
  background: #fff;
  box-shadow: 0 0 0 1px #0073aa;
  outline: none;
}

.dbpc-course .dbpc-title {
  font-weight: 600;
  font-size: 15px;
}

.dbpc-module .dbpc-title {
  font-weight: 500;
}

/* Actions */
.dbpc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.dbpc-row:hover .dbpc-actions {
  opacity: 1;
}

.dbpc-actions .button {
  font-size: 12px;
  height: 24px;
  line-height: 22px;
  padding: 0 6px;
}

.dbpc-actions .button-link {
  color: #0073aa;
  text-decoration: none;
  font-size: 12px;
  padding: 2px 4px;
}

.dbpc-actions .button-link:hover {
  color: #005177;
}

.dbpc-actions .delete-link:hover {
  color: #d63638;
}

/* Children container */
.dbpc-children {
  margin-left: 0;
}

.dbpc-collapsed > .dbpc-children {
  display: none;
}

/* Add buttons within children */
.dbpc-children > p {
  margin: 8px 16px 8px 36px;
  padding: 8px;
  background: #f6f7f7;
  border: 1px dashed #c3c4c7;
  text-align: center;
}

.dbpc-children > p .button {
  font-size: 12px;
}

/* Sortable placeholder */
.ui-sortable-placeholder {
  background: #f0f6fc;
  border: 2px dashed #0073aa;
  visibility: visible !important;
  height: 48px;
  margin: 2px 0;
}

/* WordPress Native Modal */
#dbpc-edit-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.7);
}

#dbpc-modal-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow: auto;
}

.dbpc-tab-content {
  padding: 20px 0;
}

/* Status indicators */
.dbpc-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  margin-right: 6px;
}

.dbpc-status-published {
  background: #00a32a;
  color: #fff;
}

.dbpc-status-draft {
  background: #dba617;
  color: #fff;
}

.dbpc-status-private {
  background: #d63638;
  color: #fff;
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
  .dbpc-row {
    flex-wrap: wrap;
    gap: 4px;
  }
  
  .dbpc-title {
    min-width: 150px;
    max-width: none;
    flex: 1 1 100%;
    order: 2;
  }
  
  .dbpc-actions {
    opacity: 1;
    order: 3;
    flex: 1 1 100%;
    justify-content: flex-start;
    margin-left: 0;
    margin-top: 4px;
  }
  
  .dbpc-handle,
  .dbpc-collapsible {
    order: 1;
  }
}

/* Override any unwanted styles */
.wp-list-table.dbpc-tree {
  border: 1px solid #c3c4c7;
  background: #fff;
}