// =============================================================================
// Lesson Sidebar Styles
// =============================================================================

// =============================================================================
// Main Container
// =============================================================================

.lithecourse-modules {
  margin: 2rem 0;
}

// =============================================================================
// Module Hierarchy
// =============================================================================

.lithe-module {
  border: 1px solid #e2e4e7;
  border-radius: 4px;
  margin-bottom: 1rem;
  background: #fff;
  overflow: hidden;
  transition: border-radius 0.3s;

  // Module Header
  .module-header {
    padding: 1rem;
    background: #ffffff;
    color: #000000;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition:
      background-color 0.2s,
      color 0.2s,
      border-radius 0.3s;

    &:hover {
      filter: brightness(0.95);
    }

    .module-title {
      margin: 0;
      font-size: 1.2rem;
      color: inherit;
    }

    .module-toggle {
      transition: transform 0.3s ease;
      color: inherit;
    }
  }

  // Module Content
  .module-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #fff;

    &.is-open {
      max-height: none;
      overflow: visible;
    }

    .module-lessons {
      list-style: none;
      margin: 0;
      padding: 0;
    }
  }
}

// =============================================================================
// Lesson Hierarchy
// =============================================================================

.lesson-item {
  margin: 0;
  border-bottom: 1px solid #f0f0f1;

  &:last-child {
    border-bottom: none;
  }

  // Lesson Link
  a {
    color: #2271b1;
    text-decoration: none;
    flex-grow: 1;
    transition: color 0.2s;
    display: block;

    &:hover {
      filter: brightness(0.9);
    }
  }

  // Current Lesson State
  &.current-lesson {
    background-color: #f0f7fc;

    a {
      font-weight: 600;
    }
  }

  .lesson-content {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    transition:
      background-color 0.2s,
      color 0.2s;
  }

  // =============================================================================
  // Completion Checkbox Hierarchy
  // =============================================================================

  .lesson-completion {
    display: flex;
    align-items: center;
    margin-right: 0.8rem;
    cursor: pointer;

    &.loading .completion-status {
      opacity: 0.5;
      pointer-events: none;
    }

    .lesson-completion-checkbox {
      display: none;

      &:checked + .completion-status {
        &::after {
          content: "";
          position: absolute;
          left: 6px;
          top: 3px;
          width: 4px;
          height: 8px;
          border: solid white;
          border-width: 0 2px 2px 0;
          transform: rotate(45deg);
        }
      }
    }

    .completion-status {
      width: 18px;
      height: 18px;
      border: 2px solid #2271b1;
      border-radius: 50%;
      display: inline-block;
      position: relative;
      transition: all 0.2s;
      background-color: transparent;
    }
  }
}
